blob: 7466fc33a6730428927fe159a84a8d3f29128480 [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 /**
30 * BSSID type. 6 octets representing the physical address of an AP.
31 */
32 typedef uint8_t[6] Bssid;
33
34 /**
35 * Structure describing all the information about a single access point seen
36 * during the scan.
37 */
38 struct ScanResult {
39 int64_t timeStampInUs;
40 vec<uint8_t> ssid;
41 Bssid bssid;
42 uint32_t frequencyInMhz;
43 int8_t rssi;
44 uint16_t beaconPeriodInMs;
45 uint16_t capability;
46 vec<InformationElement> informationElements;
47 };
48
49 /**
50 * Mask of flags set in the |ScanData| instance.
51 */
52 enum ScanDataFlagMask {
53 /**
54 * Indicates that a scan was interrupted/did not occur so results may be
55 * incomplete.
56 */
57 WIFI_SCAN_FLAG_INTERRUPTED = 1 << 0,
58 };
59
60 /**
61 * Structure describing all the information about all the access points seen during
62 * the scan.
63 */
64 struct ScanData {
65 /**
66 * Bitset containing |ScanDataFlagMask| values.
67 */
68 uint32_t flags;
69 /**
70 * Bitset where each bit indicates if the bucket with that index was
71 * scanned.
72 */
73 uint32_t bucketsScanned;
74 /**
75 * List of scan results.
76 */
77 vec<ScanResult> results;
78 };
79
80 /**
Roshan Piusa52dc732016-10-10 11:53:07 -070081 * Callback indicating that an ongoing background scan request has failed.
82 * The background scan needs to be restarted to continue scanning.
83 */
84 oneway onBackgroundScanFailure(CommandId cmdId);
85
86 /**
Roshan Pius7b777472016-10-07 13:15:59 -070087 * Called for each received beacon/probe response for a scan with the
88 * |REPORT_EVENTS_FULL_RESULTS| flag set in
89 * |BackgroundScanBucketParameters.eventReportScheme|.
90 *
91 * @param cmdId command Id corresponding to the request.
92 * @parm result Full scan result for an AP.
93 */
94 oneway onBackgroundFullScanResult(CommandId cmdId, ScanResult result);
95
96 /**
97 * Called when the |BackgroundScanBucketParameters.eventReportScheme| flags
98 * for at least one bucket that was just scanned was
99 * |REPORT_EVENTS_EACH_SCAN| or one of the configured thresholds was
100 * breached.
101 *
102 * @param cmdId command Id corresponding to the request.
103 * @parm scanDatas List of scan result for all AP's seen since last callback.
104 */
105 oneway onBackgroundScanResults(CommandId cmdId, vec<ScanData> scanDatas);
106};