blob: 70750f808be330d3eac907bc04fafb93b556b2a9 [file] [log] [blame]
Ashutosh Joshi6104b272016-10-27 11:06:23 -07001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.hardware.contexthub@1.0;
18
19interface IContexthubCallback {
Andreas Huber40d3a9b2017-03-28 16:19:16 -070020 /**
Ashutosh Joshi6104b272016-10-27 11:06:23 -070021 * This callback is passed by the Contexthub service to the HAL
22 * implementation to allow the HAL to send asynchronous messages back
23 * to the service and registered clients of the ContextHub service.
24 *
Anthony Stange60016022021-01-11 15:53:30 -050025 * @param msg message being sent from the contexthub
Ashutosh Joshi6104b272016-10-27 11:06:23 -070026 *
27 */
Ashutosh Joshi69e3aa32016-11-22 14:08:20 -080028 handleClientMsg(ContextHubMsg msg);
Ashutosh Joshi6104b272016-10-27 11:06:23 -070029
Andreas Huber40d3a9b2017-03-28 16:19:16 -070030 /**
Ashutosh Joshi6104b272016-10-27 11:06:23 -070031 * This callback is passed by the Contexthub service to the HAL
32 * implementation to allow the HAL to send the response for a
33 * transaction.
34 *
Anthony Stange60016022021-01-11 15:53:30 -050035 * @param txnId transaction id whose result is being sent
36 * passed in by the service at start of transacation.
37 * @param result result of transaction.
Ashutosh Joshi6104b272016-10-27 11:06:23 -070038 *
39 */
Ashutosh Joshi69e3aa32016-11-22 14:08:20 -080040 handleTxnResult(uint32_t txnId, TransactionResult result);
Ashutosh Joshi6104b272016-10-27 11:06:23 -070041
Andreas Huber40d3a9b2017-03-28 16:19:16 -070042 /**
Ashutosh Joshi6104b272016-10-27 11:06:23 -070043 * This callback is passed by the Contexthub service to the HAL
44 * implementation to allow the HAL to send an asynchronous event
45 * to the ContextHub service.
46 *
Anthony Stange60016022021-01-11 15:53:30 -050047 * @param evt event being sent from the contexthub
Ashutosh Joshi6104b272016-10-27 11:06:23 -070048 *
49 */
Ashutosh Joshi69e3aa32016-11-22 14:08:20 -080050 handleHubEvent(AsyncEventType evt);
Ashutosh Joshi6104b272016-10-27 11:06:23 -070051
Andreas Huber40d3a9b2017-03-28 16:19:16 -070052 /**
Ashutosh Joshi8b268252017-01-10 13:55:20 -080053 * This callback is passed by the Contexthub service to the HAL
54 * implementation to allow the HAL to send a notification to the service
55 * that a nanp-app has aborted.
56 * This method must be called when a nanoapp invokes chreAbort(...)).
57 *
Anthony Stange60016022021-01-11 15:53:30 -050058 * @param appId app identifier
59 * @param abortCode code passed by the nanoApp.
Ashutosh Joshi8b268252017-01-10 13:55:20 -080060 *
61 * Also see chreAbort(...)
62 *
63 */
64 handleAppAbort(uint64_t appId, uint32_t abortCode);
65
Andreas Huber40d3a9b2017-03-28 16:19:16 -070066 /**
Ashutosh Joshi6104b272016-10-27 11:06:23 -070067 * This callback is passed by the Contexthub service to the HAL
68 * implementation to allow the HAL to send information about the
69 * currently loaded and active nanoapps on the hub.
Ashutosh Joshi69e3aa32016-11-22 14:08:20 -080070 *
Anthony Stange60016022021-01-11 15:53:30 -050071 * @param appInfo vector of HubAppinfo structure for each nanoApp on the
72 * hub that can be enabled, disabled and unloaded by the
73 * service. Any nanoApps that cannot be controlled by the
74 * service must not be reported. All nanoApps that can be
75 * controlled by the service must be reported.
Ashutosh Joshi6104b272016-10-27 11:06:23 -070076 */
Ashutosh Joshi69e3aa32016-11-22 14:08:20 -080077 handleAppsInfo(vec<HubAppInfo> appInfo);
Ashutosh Joshi6104b272016-10-27 11:06:23 -070078};