blob: 129c258104bec39d089eabaa2180554f4cd9006a [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 /**
21 * Information elements contained within the |ScanResult| structure.
22 * These elements correspond to the IEEE_802.11 standard.
23 */
24 struct InformationElement {
25 uint8_t id;
26 vec<uint8_t> data;
27 };
28
29 /**
Roshan Pius7b777472016-10-07 13:15:59 -070030 * Structure describing all the information about a single access point seen
31 * during the scan.
32 */
33 struct ScanResult {
34 int64_t timeStampInUs;
35 vec<uint8_t> ssid;
36 Bssid bssid;
Roshan Pius7b777472016-10-07 13:15:59 -070037 int8_t rssi;
Roshan Pius120f94c2016-10-13 11:48:42 -070038 WifiChannelInMhz frequency;
Roshan Pius7b777472016-10-07 13:15:59 -070039 uint16_t beaconPeriodInMs;
40 uint16_t capability;
41 vec<InformationElement> informationElements;
42 };
43
44 /**
45 * Mask of flags set in the |ScanData| instance.
46 */
47 enum ScanDataFlagMask {
48 /**
49 * Indicates that a scan was interrupted/did not occur so results may be
50 * incomplete.
51 */
52 WIFI_SCAN_FLAG_INTERRUPTED = 1 << 0,
53 };
54
55 /**
56 * Structure describing all the information about all the access points seen during
57 * the scan.
58 */
59 struct ScanData {
60 /**
61 * Bitset containing |ScanDataFlagMask| values.
62 */
63 uint32_t flags;
64 /**
65 * Bitset where each bit indicates if the bucket with that index was
66 * scanned.
67 */
68 uint32_t bucketsScanned;
69 /**
70 * List of scan results.
71 */
72 vec<ScanResult> results;
73 };
74
75 /**
Roshan Piusa52dc732016-10-10 11:53:07 -070076 * Callback indicating that an ongoing background scan request has failed.
77 * The background scan needs to be restarted to continue scanning.
78 */
79 oneway onBackgroundScanFailure(CommandId cmdId);
80
81 /**
Roshan Pius7b777472016-10-07 13:15:59 -070082 * Called for each received beacon/probe response for a scan with the
83 * |REPORT_EVENTS_FULL_RESULTS| flag set in
84 * |BackgroundScanBucketParameters.eventReportScheme|.
85 *
86 * @param cmdId command Id corresponding to the request.
87 * @parm result Full scan result for an AP.
88 */
89 oneway onBackgroundFullScanResult(CommandId cmdId, ScanResult result);
90
91 /**
92 * Called when the |BackgroundScanBucketParameters.eventReportScheme| flags
93 * for at least one bucket that was just scanned was
94 * |REPORT_EVENTS_EACH_SCAN| or one of the configured thresholds was
95 * breached.
96 *
97 * @param cmdId command Id corresponding to the request.
98 * @parm scanDatas List of scan result for all AP's seen since last callback.
99 */
100 oneway onBackgroundScanResults(CommandId cmdId, vec<ScanData> scanDatas);
101};