blob: 48195195fbbf87fa2a3f8a916c10c9feee90599a [file] [log] [blame]
Sohani Rao63f17c02017-02-16 17:34:28 -08001/*
2 * Copyright 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.wifi.offload@1.0;
18
19import IOffloadCallback;
20
21interface IOffload {
22 /**
23 * Configure the offload module to perform scans and filter results
24 * Scans must not be triggered due to configuration of the module.
25 *
26 * @param ScanParam paramters for scanning
27 * @param ScanFilter settings to filter scan result
Sohani Rao452ed302017-05-11 17:34:03 -070028 * @return OffloadStatus indicating status of operation provided by this API
29 * If OffloadStatusCode::OK is returned, the operation was successful
30 * If OffloadStatusCode::NO_CONNECTION is returned, connection to the hardware is lost
31 * If OffloadStatusCode::ERROR is returned, requested operation could not be completed
Sohani Rao63f17c02017-02-16 17:34:28 -080032 */
33 @entry
34 @callflow(next={"setEventCallback", "subscribeScanResults"})
Sohani Rao452ed302017-05-11 17:34:03 -070035 configureScans(ScanParam param, ScanFilter filter) generates (OffloadStatus status);
Sohani Rao63f17c02017-02-16 17:34:28 -080036
37 /**
38 * Get scan statistics
39 *
Sohani Rao452ed302017-05-11 17:34:03 -070040 * @return OffloadStatus indicating status of operation provided by this API
Sohani Rao63f17c02017-02-16 17:34:28 -080041 * @return ScanStats statistics of scans performed
Sohani Rao452ed302017-05-11 17:34:03 -070042 * If OffloadStatusCode::OK is returned, the operation was successful
43 * If OffloadStatusCode::NO_CONNECTION is returned, connection to the hardware is lost
44 * If OffloadStatusCode::ERROR is returned, requested operation could not be completed
45 * If OffloadStatusCode::TIMEOUT is returned, time out waiting for the requested data
Sohani Rao63f17c02017-02-16 17:34:28 -080046 */
47 @exit
48 @callflow(next={"subscribeScanResults", "unsubscribeScanResults", "getScanStats"})
Sohani Rao452ed302017-05-11 17:34:03 -070049 getScanStats() generates (OffloadStatus status, ScanStats scanStats);
Sohani Rao63f17c02017-02-16 17:34:28 -080050
51 /**
52 * Subscribe to asynchronous scan events sent by offload module. This enables
53 * offload scans to be performed as per scan parameters, filtering the scan
54 * results based on configured scan filter and delivering the results after
55 * at least delayMs milliseconds from this call. If the client is already
56 * subscribed to the scan results, a call to this API must be a no-op.
57 *
58 * @param delayMs an integer expressing the minimum delay in mS after
59 * subscribing when scan results must be delivered to the client
Sohani Rao452ed302017-05-11 17:34:03 -070060 * @return OffloadStatus indicating status of operation provided by this API
61 * If OffloadStatusCode::OK is returned, the operation was successful
62 * If OffloadStatusCode::NO_CONNECTION is returned, connection to the hardware is lost
63 * If OffloadStatusCode::ERROR is returned, requested operation could not be completed
Sohani Rao63f17c02017-02-16 17:34:28 -080064 */
65 @callflow(next={"unsubscribeScanResults", "getScanStats"})
Sohani Rao452ed302017-05-11 17:34:03 -070066 subscribeScanResults(uint32_t delayMs) generates (OffloadStatus status);
Sohani Rao63f17c02017-02-16 17:34:28 -080067
68 /**
69 * Unsubscribe to scan events sent by the offload module, hence disabling scans.
70 * If the client is already unsubscribed, a call to this API will be a no-op.
71 */
72 @exit
73 @callflow(next={"*"})
74 unsubscribeScanResults();
75
76 /**
77 * Setup the HIDL interface for reporting asynchronous scan events. A maximum
78 * of one callback interface is supported. Only one callback must be registered
79 * at any given time. If two consecutive calls are made with different callback
80 * interface objects, the latest one must be used to deliver events to client.
81 *
82 * @param cb An instance of the |IOffloadCallback| HIDL interface object
83 */
84 @entry
85 @callflow(next={"subscribeScanStats", "configureScans"})
86 setEventCallback(IOffloadCallback cb);
87};