Sohani Rao | 63f17c0 | 2017-02-16 17:34:28 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package android.hardware.wifi.offload@1.0; |
| 18 | |
| 19 | import IOffloadCallback; |
| 20 | |
| 21 | interface 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 |
| 28 | * @return boolean status indicating success (true) when configuration |
| 29 | * is applied or failure (false) for invalid configuration |
| 30 | */ |
| 31 | @entry |
| 32 | @callflow(next={"setEventCallback", "subscribeScanResults"}) |
| 33 | configureScans(ScanParam param, ScanFilter filter); |
| 34 | |
| 35 | /** |
| 36 | * Get scan statistics |
| 37 | * |
| 38 | * @return ScanStats statistics of scans performed |
| 39 | */ |
| 40 | @exit |
| 41 | @callflow(next={"subscribeScanResults", "unsubscribeScanResults", "getScanStats"}) |
| 42 | getScanStats() generates (ScanStats scanStats); |
| 43 | |
| 44 | /** |
| 45 | * Subscribe to asynchronous scan events sent by offload module. This enables |
| 46 | * offload scans to be performed as per scan parameters, filtering the scan |
| 47 | * results based on configured scan filter and delivering the results after |
| 48 | * at least delayMs milliseconds from this call. If the client is already |
| 49 | * subscribed to the scan results, a call to this API must be a no-op. |
| 50 | * |
| 51 | * @param delayMs an integer expressing the minimum delay in mS after |
| 52 | * subscribing when scan results must be delivered to the client |
| 53 | */ |
| 54 | @callflow(next={"unsubscribeScanResults", "getScanStats"}) |
| 55 | subscribeScanResults(uint32_t delayMs); |
| 56 | |
| 57 | /** |
| 58 | * Unsubscribe to scan events sent by the offload module, hence disabling scans. |
| 59 | * If the client is already unsubscribed, a call to this API will be a no-op. |
| 60 | */ |
| 61 | @exit |
| 62 | @callflow(next={"*"}) |
| 63 | unsubscribeScanResults(); |
| 64 | |
| 65 | /** |
| 66 | * Setup the HIDL interface for reporting asynchronous scan events. A maximum |
| 67 | * of one callback interface is supported. Only one callback must be registered |
| 68 | * at any given time. If two consecutive calls are made with different callback |
| 69 | * interface objects, the latest one must be used to deliver events to client. |
| 70 | * |
| 71 | * @param cb An instance of the |IOffloadCallback| HIDL interface object |
| 72 | */ |
| 73 | @entry |
| 74 | @callflow(next={"subscribeScanStats", "configureScans"}) |
| 75 | setEventCallback(IOffloadCallback cb); |
| 76 | }; |