Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [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@1.0; |
| 18 | |
| 19 | interface IWifiStaIfaceEventCallback { |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 20 | /** |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 21 | * Structure describing all the information about a single access point seen |
| 22 | * during the scan. |
| 23 | */ |
| 24 | struct ScanResult { |
Roshan Pius | 18eec81 | 2016-10-14 11:29:30 -0700 | [diff] [blame^] | 25 | TimeStampInUs timeStampInUs; |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 26 | vec<uint8_t> ssid; |
| 27 | Bssid bssid; |
Roshan Pius | 18eec81 | 2016-10-14 11:29:30 -0700 | [diff] [blame^] | 28 | Rssi rssi; |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 29 | WifiChannelInMhz frequency; |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 30 | uint16_t beaconPeriodInMs; |
| 31 | uint16_t capability; |
Roshan Pius | 18eec81 | 2016-10-14 11:29:30 -0700 | [diff] [blame^] | 32 | vec<WifiInformationElement> informationElements; |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 33 | }; |
| 34 | |
| 35 | /** |
| 36 | * Mask of flags set in the |ScanData| instance. |
| 37 | */ |
| 38 | enum ScanDataFlagMask { |
| 39 | /** |
| 40 | * Indicates that a scan was interrupted/did not occur so results may be |
| 41 | * incomplete. |
| 42 | */ |
| 43 | WIFI_SCAN_FLAG_INTERRUPTED = 1 << 0, |
| 44 | }; |
| 45 | |
| 46 | /** |
| 47 | * Structure describing all the information about all the access points seen during |
| 48 | * the scan. |
| 49 | */ |
| 50 | struct ScanData { |
| 51 | /** |
| 52 | * Bitset containing |ScanDataFlagMask| values. |
| 53 | */ |
| 54 | uint32_t flags; |
| 55 | /** |
| 56 | * Bitset where each bit indicates if the bucket with that index was |
| 57 | * scanned. |
| 58 | */ |
| 59 | uint32_t bucketsScanned; |
| 60 | /** |
| 61 | * List of scan results. |
| 62 | */ |
| 63 | vec<ScanResult> results; |
| 64 | }; |
| 65 | |
| 66 | /** |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 67 | * Callback indicating that an ongoing background scan request has failed. |
| 68 | * The background scan needs to be restarted to continue scanning. |
| 69 | */ |
| 70 | oneway onBackgroundScanFailure(CommandId cmdId); |
| 71 | |
| 72 | /** |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 73 | * Called for each received beacon/probe response for a scan with the |
| 74 | * |REPORT_EVENTS_FULL_RESULTS| flag set in |
| 75 | * |BackgroundScanBucketParameters.eventReportScheme|. |
| 76 | * |
| 77 | * @param cmdId command Id corresponding to the request. |
| 78 | * @parm result Full scan result for an AP. |
| 79 | */ |
| 80 | oneway onBackgroundFullScanResult(CommandId cmdId, ScanResult result); |
| 81 | |
| 82 | /** |
| 83 | * Called when the |BackgroundScanBucketParameters.eventReportScheme| flags |
| 84 | * for at least one bucket that was just scanned was |
| 85 | * |REPORT_EVENTS_EACH_SCAN| or one of the configured thresholds was |
| 86 | * breached. |
| 87 | * |
| 88 | * @param cmdId command Id corresponding to the request. |
| 89 | * @parm scanDatas List of scan result for all AP's seen since last callback. |
| 90 | */ |
| 91 | oneway onBackgroundScanResults(CommandId cmdId, vec<ScanData> scanDatas); |
| 92 | }; |