diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2022-12-19 17:40:20 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2022-12-19 17:40:20 +0000 |
commit | 22aa713e81ab176356c42bd6cb9f99f871e55e41 (patch) | |
tree | e6846c9b05a4c8b403547eed484b2f1cf60b51c1 | |
parent | d937de94dd6b3e1df8455f7f179360041b64f626 (diff) | |
parent | 6fb46c645eb14fe1aca90a64e365b1fcb027b4ee (diff) | |
download | libhardware_legacy-22aa713e81ab176356c42bd6cb9f99f871e55e41.tar.gz |
Merge "Add frequency/Bandwidth to RttResults"
-rw-r--r-- | include/hardware_legacy/rtt.h | 32 | ||||
-rw-r--r-- | include/hardware_legacy/wifi_hal.h | 1 |
2 files changed, 25 insertions, 8 deletions
diff --git a/include/hardware_legacy/rtt.h b/include/hardware_legacy/rtt.h index 4ef7770..ce17443 100644 --- a/include/hardware_legacy/rtt.h +++ b/include/hardware_legacy/rtt.h @@ -38,13 +38,14 @@ typedef enum { /* RTT Measurement Bandwidth */ typedef enum { - WIFI_RTT_BW_5 = 0x01, - WIFI_RTT_BW_10 = 0x02, - WIFI_RTT_BW_20 = 0x04, - WIFI_RTT_BW_40 = 0x08, - WIFI_RTT_BW_80 = 0x10, - WIFI_RTT_BW_160 = 0x20, - WIFI_RTT_BW_320 = 0x40 + WIFI_RTT_BW_UNSPECIFIED = 0x00, + WIFI_RTT_BW_5 = 0x01, + WIFI_RTT_BW_10 = 0x02, + WIFI_RTT_BW_20 = 0x04, + WIFI_RTT_BW_40 = 0x08, + WIFI_RTT_BW_80 = 0x10, + WIFI_RTT_BW_160 = 0x20, + WIFI_RTT_BW_320 = 0x40 } wifi_rtt_bw; /* RTT Measurement Preamble */ @@ -150,9 +151,24 @@ typedef struct { wifi_information_element *LCR; // for 11mc only } wifi_rtt_result; -/* RTT result callback */ +/* RTT results version 2 */ typedef struct { + wifi_rtt_result rtt_result; // Legacy wifi rtt result structure + wifi_channel frequency; // primary channel frequency (MHz) used for ranging measurements + // If frequency is unknown, this will be set to |UNSPECIFIED(-1)| + wifi_rtt_bw packet_bw; // RTT packet bandwidth is an average BW of the BWs of RTT frames. + // Cap the average close to a specific valid RttBw. +} wifi_rtt_result_v2; + +/* RTT result callbacks */ +typedef struct { + /* + * This callback is deprecated on Android 14 and onwards. + * Newer implementations should support on_rtt_results_v2 callback + */ void (*on_rtt_results) (wifi_request_id id, unsigned num_results, wifi_rtt_result *rtt_result[]); + /* Called when vendor implementation supports sending RTT results version 2 */ + void (*on_rtt_results_v2) (wifi_request_id id, unsigned num_results, wifi_rtt_result_v2 *rtt_result_v2[]); } wifi_rtt_event_handler; /* API to request RTT measurement */ diff --git a/include/hardware_legacy/wifi_hal.h b/include/hardware_legacy/wifi_hal.h index 7cd17af..011694f 100644 --- a/include/hardware_legacy/wifi_hal.h +++ b/include/hardware_legacy/wifi_hal.h @@ -24,6 +24,7 @@ extern "C" #include <stdint.h> #define IFNAMSIZ 16 +#define UNSPECIFIED -1 // wifi HAL common definition for unspecified value /* typedefs */ typedef unsigned char byte; |