blob: 6bffc7d7d5d3dab997a1595c7b716b0fef4f7107 [file] [log] [blame]
Roshan Pius7b777472016-10-07 13:15:59 -07001/*
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@1.0;
18
19interface IWifiStaIfaceEventCallback {
Roshan Pius7b777472016-10-07 13:15:59 -070020 /**
Roshan Pius7b777472016-10-07 13:15:59 -070021 * Structure describing all the information about a single access point seen
22 * during the scan.
23 */
24 struct ScanResult {
Roshan Pius18eec812016-10-14 11:29:30 -070025 TimeStampInUs timeStampInUs;
Roshan Pius7b777472016-10-07 13:15:59 -070026 vec<uint8_t> ssid;
27 Bssid bssid;
Roshan Pius18eec812016-10-14 11:29:30 -070028 Rssi rssi;
Roshan Pius120f94c2016-10-13 11:48:42 -070029 WifiChannelInMhz frequency;
Roshan Pius7b777472016-10-07 13:15:59 -070030 uint16_t beaconPeriodInMs;
31 uint16_t capability;
Roshan Pius18eec812016-10-14 11:29:30 -070032 vec<WifiInformationElement> informationElements;
Roshan Pius7b777472016-10-07 13:15:59 -070033 };
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 Piusa52dc732016-10-10 11:53:07 -070067 * 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 Pius7b777472016-10-07 13:15:59 -070073 * 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};