• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1little_endian_packets
2
3enum PacketBoundaryFlag : 1 {
4    COMPLETE = 0x00,
5    NOT_COMPLETE = 0x01,
6}
7
8enum GroupId : 4 {
9    CORE = 0x00,
10    SESSION_CONFIG = 0x01,
11    SESSION_CONTROL = 0x02,
12    DATA_CONTROL = 0x03,
13    TEST = 0x0d,
14    VENDOR_RESERVED_9 = 0x09,
15    VENDOR_RESERVED_A = 0x0a,
16    VENDOR_RESERVED_B = 0x0b,
17    VENDOR_ANDROID    = 0x0c,
18    VENDOR_RESERVED_E = 0x0e,
19    VENDOR_RESERVED_F = 0x0f,
20}
21
22enum DataPacketFormat: 4 {
23    DATA_SND = 0x01,
24    DATA_RCV = 0x02,
25    RADAR_DATA_MESSAGE = 0x0f,
26}
27
28// Define a merged enum across GroupId & DataPacketFormat as they are at the same bits in
29// |UciPacketHal|.
30enum GroupIdOrDataPacketFormat : 4 {
31    CORE = 0x00,
32    SESSION_CONFIG_OR_DATA_SND = 0x01,
33    SESSION_CONTROL_OR_DATA_RCV = 0x02,
34    DATA_CONTROL = 0x03,
35    TEST = 0x0d,
36    VENDOR_RESERVED_9 = 0x09,
37    VENDOR_RESERVED_A = 0x0a,
38    VENDOR_RESERVED_B = 0x0b,
39    VENDOR_ANDROID    = 0x0c,
40    VENDOR_RESERVED_E = 0x0e,
41    VENDOR_RESERVED_F = 0x0f,
42}
43
44enum CoreOpCode : 6 {
45    CORE_DEVICE_RESET = 0x00,
46    CORE_DEVICE_STATUS_NTF = 0x01,
47    CORE_DEVICE_INFO = 0x02,
48    CORE_GET_CAPS_INFO = 0x03,
49    CORE_SET_CONFIG = 0x04,
50    CORE_GET_CONFIG = 0x05,
51    CORE_DEVICE_SUSPEND = 0x06,
52    CORE_GENERIC_ERROR_NTF = 0x07,
53    CORE_QUERY_UWBS_TIMESTAMP = 0x08,
54}
55
56enum SessionConfigOpCode : 6 {
57    SESSION_INIT = 0x00,
58    SESSION_DEINIT = 0x01,
59    SESSION_STATUS_NTF = 0x02,
60    SESSION_SET_APP_CONFIG = 0x03,
61    SESSION_GET_APP_CONFIG = 0x04,
62    SESSION_GET_COUNT = 0x05,
63    SESSION_GET_STATE = 0x06,
64    SESSION_UPDATE_CONTROLLER_MULTICAST_LIST = 0x07,
65    SESSION_UPDATE_ACTIVE_ROUNDS_ANCHOR = 0x08,
66    SESSION_UPDATE_ACTIVE_ROUNDS_DT_TAG = 0x09,
67    SESSION_SET_INITIATOR_DT_ANCHOR_RR_RDM_LIST = 0x0a,
68    SESSION_QUERY_DATA_SIZE_IN_RANGING = 0x0b,
69    SESSION_SET_HUS_CONTROLLER_CONFIG = 0x0c,
70    SESSION_SET_HUS_CONTROLEE_CONFIG = 0x0d,
71    SESSION_DATA_TRANSFER_PHASE_CONFIGURATION = 0x0e,
72}
73
74enum SessionControlOpCode : 6 {
75    SESSION_START = 0x00,
76    SESSION_STOP = 0x01,
77    SESSION_RESERVED = 0x02,
78    SESSION_GET_RANGING_COUNT = 0x03,
79    SESSION_DATA_CREDIT_NTF = 0x04,
80    SESSION_DATA_TRANSFER_STATUS_NTF = 0x05,
81}
82
83enum AppDataOpCode : 6 {
84    APP_DATA_TX = 0x00,
85    APP_DATA_RX = 0x01,
86}
87
88// Android vendor commands
89enum AndroidOpCode : 6 {
90    ANDROID_GET_POWER_STATS = 0x0,
91    ANDROID_SET_COUNTRY_CODE = 0x1,
92    ANDROID_FIRA_RANGE_DIAGNOSTICS = 0x2,
93    ANDROID_RADAR_SET_APP_CONFIG = 0x11,
94    ANDROID_RADAR_GET_APP_CONFIG = 0x12,
95}
96
97enum StatusCode : 8 {
98    // Generic Status Codes
99    UCI_STATUS_OK = 0x00,
100    UCI_STATUS_REJECTED = 0x01,
101    UCI_STATUS_FAILED = 0x02,
102    UCI_STATUS_SYNTAX_ERROR = 0x03,
103    UCI_STATUS_INVALID_PARAM = 0x04,
104    UCI_STATUS_INVALID_RANGE = 0x05,
105    UCI_STATUS_INVALID_MSG_SIZE = 0x06,
106    UCI_STATUS_UNKNOWN_GID = 0x07,
107    UCI_STATUS_UNKNOWN_OID = 0x08,
108    UCI_STATUS_READ_ONLY = 0x09,
109    UCI_STATUS_COMMAND_RETRY = 0x0A,
110    UCI_STATUS_UNKNOWN = 0x0B,
111    UCI_STATUS_NOT_APPLICABLE = 0x0C,
112    RFU_STATUS_CODE_RANGE_1 = 0x0D..0x10,
113
114    // UWB Session Specific Status Codes
115    UCI_STATUS_SESSION_NOT_EXIST = 0x11,
116    UCI_STATUS_SESSION_DUPLICATE = 0x12,
117    UCI_STATUS_SESSION_ACTIVE = 0x13,
118    UCI_STATUS_MAX_SESSIONS_EXCEEDED = 0x14,
119    UCI_STATUS_SESSION_NOT_CONFIGURED = 0x15,
120    UCI_STATUS_ACTIVE_SESSIONS_ONGOING = 0x16,
121    UCI_STATUS_MULTICAST_LIST_FULL = 0x17,
122    UCI_STATUS_ADDRESS_NOT_FOUND = 0x18,
123    UCI_STATUS_ADDRESS_ALREADY_PRESENT = 0x19,
124    UCI_STATUS_ERROR_UWB_INITIATION_TIME_TOO_OLD = 0x1A,
125    UCI_STATUS_OK_NEGATIVE_DISTANCE_REPORT = 0x1B,
126    RFU_STATUS_CODE_RANGE_2 = 0x1C..0x1F,
127
128    // UWB Ranging Session Specific Status Codes
129    UCI_STATUS_RANGING_TX_FAILED = 0x20,
130    UCI_STATUS_RANGING_RX_TIMEOUT = 0x21,
131    UCI_STATUS_RANGING_RX_PHY_DEC_FAILED = 0x22,
132    UCI_STATUS_RANGING_RX_PHY_TOA_FAILED = 0x23,
133    UCI_STATUS_RANGING_RX_PHY_STS_FAILED = 0x24,
134    UCI_STATUS_RANGING_RX_MAC_DEC_FAILED = 0x25,
135    UCI_STATUS_RANGING_RX_MAC_IE_DEC_FAILED = 0x26,
136    UCI_STATUS_RANGING_RX_MAC_IE_MISSING = 0x27,
137    UCI_STATUS_ERROR_ROUND_INDEX_NOT_ACTIVATED = 0x28,
138    UCI_STATUS_ERROR_NUMBER_OF_ACTIVE_RANGING_ROUNDS_EXCEEDED = 0x29,
139    UCI_STATUS_ERROR_DL_TDOA_DEVICE_ADDRESS_NOT_MATCHING_IN_REPLY_TIME_LIST = 0x2A,
140    RFU_STATUS_CODE_RANGE_3 = 0x2B..0x2F,
141
142    // UWB Data Session Specific Status Codes
143    UCI_STATUS_DATA_MAX_TX_PSDU_SIZE_EXCEEDED = 0x30,
144    UCI_STATUS_DATA_RX_CRC_ERROR = 0x31,
145    RFU_STATUS_CODE_RANGE_4 = 0x32..0x4F,
146
147    // Vendor Specific Status Codes
148    VENDOR_SPECIFIC_STATUS_CODE_RANGE_1 = 0x50..0xFE {
149        UCI_STATUS_ERROR_CCC_SE_BUSY = 0x50,
150        UCI_STATUS_ERROR_CCC_LIFECYCLE = 0x51,
151        UCI_STATUS_ERROR_STOPPED_DUE_TO_OTHER_SESSION_CONFLICT = 0x52,
152        UCI_STATUS_REGULATION_UWB_OFF = 0x53,
153    },
154
155    // For internal usage, we will use 0xFF as default.
156    VENDOR_SPECIFIC_STATUS_CODE_2 = 0xFF,
157}
158
159// This needs a separate StatusCode as the Status code values in the DATA_RCV packet have
160// different values from the generic StatusCode above.
161enum DataRcvStatusCode : 8 {
162    UCI_STATUS_SUCCESS = 0x00,
163    UCI_STATUS_ERROR = 0x01,
164    UCI_STATUS_UNKNOWN = 0x02,
165}
166
167enum CreditAvailability : 8 {
168    CREDIT_NOT_AVAILABLE = 0,
169    CREDIT_AVAILABLE = 1,
170}
171
172// The UCI spec defines these status codes for a DATA_TRANSFER_STATUS_NTF packet.
173enum DataTransferNtfStatusCode : 8 {
174    UCI_DATA_TRANSFER_STATUS_REPETITION_OK = 0x00,
175    UCI_DATA_TRANSFER_STATUS_OK = 0x01,
176    UCI_DATA_TRANSFER_STATUS_ERROR_DATA_TRANSFER = 0x02,
177    UCI_DATA_TRANSFER_STATUS_ERROR_NO_CREDIT_AVAILABLE = 0x03,
178    UCI_DATA_TRANSFER_STATUS_ERROR_REJECTED = 0x04,
179    UCI_DATA_TRANSFER_STATUS_SESSION_TYPE_NOT_SUPPORTED = 0x05,
180    UCI_DATA_TRANSFER_STATUS_ERROR_DATA_TRANSFER_IS_ONGOING = 0x06,
181    UCI_DATA_TRANSFER_STATUS_INVALID_FORMAT = 0x07,
182}
183
184// The UCI spec defines these status codes for a SESSION_DATA_TRANSFER_PHASE_CONFIG_NTF packet.
185enum DataTransferPhaseConfigUpdateStatusCode : 8 {
186    UCI_DTPCM_CONFIG_SUCCESS_STATUS_OK = 0x00,
187    UCI_DTPCM_STATUS_ERROR_DUPLICATE_SLOT_ASSIGMENT = 0x01,
188}
189
190enum ResetConfig : 8 {
191    UWBS_RESET = 0x00,
192}
193
194enum DeviceConfigId : 8 {
195    DEVICE_STATE = 0x00,
196    LOW_POWER_MODE = 0x01,
197}
198
199enum AppConfigTlvType : 8 {
200    DEVICE_TYPE = 0x00,
201    RANGING_ROUND_USAGE = 0x01,
202    STS_CONFIG = 0x02,
203    MULTI_NODE_MODE = 0x03,
204    CHANNEL_NUMBER = 0x04,
205    NO_OF_CONTROLEE = 0x05,
206    DEVICE_MAC_ADDRESS = 0x06,
207    DST_MAC_ADDRESS = 0x07,
208    SLOT_DURATION = 0x08,
209    RANGING_DURATION = 0x09,
210    STS_INDEX = 0x0A,
211    MAC_FCS_TYPE = 0x0B,
212    RANGING_ROUND_CONTROL = 0x0C,
213    AOA_RESULT_REQ = 0x0D,
214    RNG_DATA_NTF = 0x0E,
215    RNG_DATA_NTF_PROXIMITY_NEAR = 0x0F,
216    RNG_DATA_NTF_PROXIMITY_FAR = 0x10,
217    DEVICE_ROLE = 0x11,
218    RFRAME_CONFIG = 0x12,
219    RSSI_REPORTING = 0x13,
220    PREAMBLE_CODE_INDEX = 0x14,
221    SFD_ID = 0x15,
222    PSDU_DATA_RATE = 0x16,
223    PREAMBLE_DURATION = 0x17,
224    LINK_LAYER_MODE = 0x18,
225    DATA_REPETITION_COUNT = 0x19,
226    RANGING_TIME_STRUCT = 0x1A,
227    SLOTS_PER_RR = 0x1B,
228    TX_ADAPTIVE_PAYLOAD_POWER = 0x1C,
229    // TODO: Ensure this value is correct in the final 2.0 specification.
230    RNG_DATA_NTF_AOA_BOUND = 0x1D,
231    RESPONDER_SLOT_INDEX = 0x1E,
232    PRF_MODE = 0x1F,
233    CAP_SIZE_RANGE = 0x20,
234    TX_JITTER_WINDOW_SIZE = 0x21,
235    SCHEDULED_MODE = 0x22,
236    KEY_ROTATION = 0x23,
237    KEY_ROTATION_RATE = 0x24,
238    SESSION_PRIORITY = 0x25,
239    MAC_ADDRESS_MODE = 0x26,
240    VENDOR_ID = 0x27,
241    STATIC_STS_IV = 0x28,
242    NUMBER_OF_STS_SEGMENTS = 0x29,
243    MAX_RR_RETRY = 0x2A,
244    UWB_INITIATION_TIME = 0x2B,
245    HOPPING_MODE = 0x2C,
246    BLOCK_STRIDE_LENGTH = 0x2D,
247    RESULT_REPORT_CONFIG = 0x2E,
248    IN_BAND_TERMINATION_ATTEMPT_COUNT = 0x2F,
249    SUB_SESSION_ID = 0x30,
250    BPRF_PHR_DATA_RATE = 0x31,
251    MAX_NUMBER_OF_MEASUREMENTS = 0x32,
252    UL_TDOA_TX_INTERVAL = 0x33,
253    UL_TDOA_RANDOM_WINDOW = 0x34,
254    STS_LENGTH = 0x35,
255    SUSPEND_RANGING_ROUNDS = 0x36,
256    UL_TDOA_NTF_REPORT_CONFIG = 0x37,
257    UL_TDOA_DEVICE_ID = 0x38,
258    UL_TDOA_TX_TIMESTAMP = 0x39,
259    MIN_FRAMES_PER_RR = 0x3A,
260    MTU_SIZE = 0x3B,
261    INTER_FRAME_INTERVAL = 0x3C,
262    DL_TDOA_RANGING_METHOD  = 0x3D,
263    DL_TDOA_TX_TIMESTAMP_CONF = 0x3E,
264    DL_TDOA_HOP_COUNT = 0x3F,
265    DL_TDOA_ANCHOR_CFO = 0x40,
266    DL_TDOA_ANCHOR_LOCATION = 0x41,
267    DL_TDOA_TX_ACTIVE_RANGING_ROUNDS = 0x42,
268    DL_TDOA_BLOCK_STRIDING = 0x43,
269    DL_TDOA_TIME_REFERENCE_ANCHOR = 0x44,
270    SESSION_KEY = 0x45,
271    SUBSESSION_KEY = 0x46,
272    SESSION_DATA_TRANSFER_STATUS_NTF_CONFIG = 0x47,
273    SESSION_TIME_BASE = 0x48,
274    DL_TDOA_RESPONDER_TOF = 0x49,
275    SECURE_RANGING_NEFA_LEVEL = 0x4A,
276    SECURE_RANGING_CSW_LENGTH = 0x4B,
277    APPLICATION_DATA_ENDPOINT = 0x4C,
278    OWR_AOA_MEASUREMENT_NTF_PERIOD = 0x4D,
279    RFU_APP_CFG_TLV_TYPE_RANGE = 0x4E..0x9F,
280
281    VENDOR_SPECIFIC_APP_CFG_TLV_TYPE_RANGE_1 = 0xA0..0xDF {
282        // CCC specific
283        CCC_HOP_MODE_KEY = 0xA0,
284        CCC_UWB_TIME0 = 0xA1,
285        CCC_RANGING_PROTOCOL_VER = 0xA3,
286        CCC_UWB_CONFIG_ID = 0xA4,
287        CCC_PULSESHAPE_COMBO = 0xA5,
288        CCC_URSK_TTL = 0xA6,
289        CCC_LAST_INDEX_USED  = 0xA8,
290    },
291
292    // Reserved for extension IDs.
293    RFU_APP_CFG_TLV_TYPE_RANGE_4 = 0xE0..0xE2,
294
295    VENDOR_SPECIFIC_APP_CFG_TLV_TYPE_RANGE_2 = 0xE3..0xFF {
296        // Interleaving ratio if AOA_RESULT_REQ is set to 0xF0.
297        NB_OF_RANGE_MEASUREMENTS = 0xE3,
298        NB_OF_AZIMUTH_MEASUREMENTS = 0xE4,
299        NB_OF_ELEVATION_MEASUREMENTS = 0xE5,
300        ENABLE_DIAGNOSTICS = 0xE8,
301        DIAGRAMS_FRAME_REPORTS_FIELDS = 0xE9,
302        ANTENNA_MODE = 0xEA,
303    },
304}
305
306enum FrameReportTlvType : 8 {
307    RSSI = 0x0,
308    AOA = 0x1,
309    CIR = 0x2,
310    SEGMENT_METRICS = 0x6,
311}
312
313enum CapTlvType : 8 {
314    // Defining the parameters for both Fira v1.0 and v2.0 in one enum, as PDL
315    // does not allow to define two separate enum fields with the same value.
316    SUPPORTED_V1_FIRA_PHY_VERSION_RANGE_V2_MAX_MESSAGE_SIZE = 0x0,
317    SUPPORTED_V1_FIRA_MAC_VERSION_RANGE_V2_MAX_DATA_PAYLOAD_SIZE = 0x1,
318    SUPPORTED_V1_DEVICE_ROLES_V2_FIRA_PHY_VERSION_RANGE = 0x2,
319    SUPPORTED_V1_RANGING_METHOD_V2_FIRA_MAC_VERSION_RANGE = 0x3,
320    SUPPORTED_V1_STS_CONFIG_V2_DEVICE_TYPE = 0x4,
321    SUPPORTED_V1_MULTI_NODE_MODES_V2_DEVICE_ROLES = 0x5,
322    SUPPORTED_V1_RANGING_TIME_STRUCT_V2_RANGING_METHOD = 0x6,
323    SUPPORTED_V1_SCHEDULED_MODE_V2_STS_CONFIG = 0x7,
324    SUPPORTED_V1_HOPPING_MODE_V2_MULTI_NODE_MODE = 0x8,
325    SUPPORTED_V1_BLOCK_STRIDING_V2_RANGING_TIME_STRUCT = 0x9,
326    SUPPORTED_V1_UWB_INITIATION_TIME_V2_SCHEDULE_MODE = 0x0A,
327    SUPPORTED_V1_CHANNELS_V2_HOPPING_MODE = 0x0B,
328    SUPPORTED_V1_RFRAME_CONFIG_V2_BLOCK_STRIDING = 0x0C,
329    SUPPORTED_V1_CC_CONSTRAINT_LENGTH_V2_UWB_INITIATION_TIME = 0x0D,
330    SUPPORTED_V1_BPRF_PARAMETER_SETS_V2_CHANNELS = 0x0E,
331    SUPPORTED_V1_HPRF_PARAMETER_SETS_V2_RFRAME_CONFIG = 0x0F,
332    SUPPORTED_V1_AOA_V2_CC_CONSTRAINT_LENGTH = 0x10,
333    SUPPORTED_V1_EXTENDED_MAC_ADDRESS_V2_BPRF_PARAMETER_SETS = 0x11,
334    SUPPORTED_V1_MAX_MESSAGE_SIZE_V2_HPRF_PARAMETER_SETS = 0x12,
335    SUPPORTED_V1_MAX_DATA_PACKET_PAYLOAD_SIZE_V2_AOA_SUPPORT = 0x13,
336    SUPPORTED_V2_EXTENDED_MAC_ADDRESS = 0x14,
337    SUPPORTED_V2_ASSIGNED = 0x15,
338    SUPPORTED_V2_SESSION_KEY_LENGTH = 0x16,
339    SUPPORTED_V2_DT_ANCHOR_MAX_ACTIVE_RR = 0x17,
340    SUPPORTED_V2_DT_TAG_MAX_ACTIVE_RR = 0x18,
341    SUPPORTED_V2_DT_TAG_BLOCK_SHIPPING = 0x19,
342    SUPPORTED_V2_PSDU_LENGTH_SUPPORT = 0x1A,
343    RFU_CAP_TLV_TYPE_RANGE_1 = 0x1B..0x9F,
344
345    VENDOR_SPECIFIC_CAP_TLV_TYPE_RANGE_1 = 0xA0..0xBF {
346        // CCC specific
347        CCC_SUPPORTED_CHAPS_PER_SLOT = 0xA0,
348        CCC_SUPPORTED_SYNC_CODES = 0xA1,
349        CCC_SUPPORTED_HOPPING_CONFIG_MODES_AND_SEQUENCES = 0xA2,
350        CCC_SUPPORTED_CHANNELS = 0xA3,
351        CCC_SUPPORTED_VERSIONS = 0xA4,
352        CCC_SUPPORTED_UWB_CONFIGS = 0xA5,
353        CCC_SUPPORTED_PULSE_SHAPE_COMBOS = 0xA6,
354        CCC_SUPPORTED_RAN_MULTIPLIER = 0xA7,
355        CCC_SUPPORTED_MAX_RANGING_SESSION_NUMBER = 0xA8,
356        CCC_SUPPORTED_MIN_UWB_INITIATION_TIME_MS = 0xA9,
357        CCC_PRIORITIZED_CHANNEL_LIST = 0xAA,
358        CCC_SUPPORTED_UWBS_MAX_PPM = 0xAB,
359
360        // RADAR specific
361        RADAR_SUPPORT = 0xB0
362    },
363
364    SUPPORTED_POWER_STATS = 0xC0,
365    VENDOR_SPECIFIC_CAP_TLV_TYPE_RANGE_2 = 0xC1..0xDF,
366    RFU_CAP_TLV_TYPE_RANGE_2 = 0xE0..0xE2,
367
368    VENDOR_SPECIFIC_CAP_TLV_TYPE_RANGE_3 = 0xE3..0xFF {
369        SUPPORTED_AOA_RESULT_REQ_ANTENNA_INTERLEAVING = 0xE3,
370        SUPPORTED_MIN_RANGING_INTERVAL_MS = 0xE4,
371        SUPPORTED_RANGE_DATA_NTF_CONFIG = 0xE5,
372        SUPPORTED_RSSI_REPORTING = 0xE6,
373        SUPPORTED_DIAGNOSTICS = 0xE7,
374        SUPPORTED_MIN_SLOT_DURATION_RSTU = 0xE8,
375        SUPPORTED_MAX_RANGING_SESSION_NUMBER = 0xE9,
376    },
377}
378
379
380// AOA result request type.
381// Values set for AOA_RESULT_REQ config ID.
382enum AoaResultReqType : 8 {
383    AOA_DISABLE = 0x0,
384    AOA_ENABLE = 0x01,
385    AOA_ENABLE_AZIMUTH = 0x02,
386    AOA_ENABLE_ELEVATION = 0x03,
387    AOA_ENABLE_INTERLEAVED = 0xF0,
388}
389
390enum DeviceState : 8 {
391    DEVICE_STATE_READY = 0x01,
392    DEVICE_STATE_ACTIVE = 0x02,
393    DEVICE_STATE_ERROR = 0xff,
394}
395
396enum SessionState : 8 {
397    SESSION_STATE_INIT = 0x00,
398    SESSION_STATE_DEINIT = 0x01,
399    SESSION_STATE_ACTIVE = 0x02,
400    SESSION_STATE_IDLE = 0x03,
401}
402
403enum ReasonCode : 8 {
404    STATE_CHANGE_WITH_SESSION_MANAGEMENT_COMMANDS = 0x00,
405    MAX_RANGING_ROUND_RETRY_COUNT_REACHED = 0x01,
406    MAX_NUMBER_OF_MEASUREMENTS_REACHED = 0x02,
407    SESSION_SUSPENDED_DUE_TO_INBAND_SIGNAL = 0x03,
408    SESSION_RESUMED_DUE_TO_INBAND_SIGNAL = 0x04,
409    SESSION_STOPPED_DUE_TO_INBAND_SIGNAL = 0x05,
410    RFU_REASON_CODE_RANGE_1 = 0x06..0x1C,
411    ERROR_INVALID_UL_TDOA_RANDOM_WINDOW = 0x1D,
412    ERROR_MIN_RFRAMES_PER_RR_NOT_SUPPORTED = 0x1E,
413    ERROR_TX_DELAY_NOT_SUPPORTED = 0x1F,
414    ERROR_SLOT_LENGTH_NOT_SUPPORTED = 0x20,
415    ERROR_INSUFFICIENT_SLOTS_PER_RR = 0x21,
416    ERROR_MAC_ADDRESS_MODE_NOT_SUPPORTED = 0x22,
417    ERROR_INVALID_RANGING_DURATION = 0x23,
418    ERROR_INVALID_STS_CONFIG = 0x24,
419    ERROR_INVALID_RFRAME_CONFIG = 0x25,
420    ERROR_HUS_NOT_ENOUGH_SLOTS = 0x26,
421    ERROR_HUS_CFP_PHASE_TOO_SHORT = 0x27,
422    ERROR_HUS_CAP_PHASE_TOO_SHORT = 0x28,
423    ERROR_HUS_OTHERS = 0x29,
424    ERROR_STATUS_SESSION_KEY_NOT_FOUND = 0x2A,
425    ERROR_STATUS_SUB_SESSION_KEY_NOT_FOUND = 0x2B,
426    ERROR_INVALID_PREAMBLE_CODE_INDEX = 0x2C,
427    ERROR_INVALID_SFD_ID = 0x2D,
428    ERROR_INVALID_PSDU_DATA_RATE = 0x2E,
429    ERROR_INVALID_PHR_DATA_RATE = 0x2F,
430    ERROR_INVALID_PREAMBLE_DURATION = 0x30,
431    ERROR_INVALID_STS_LENGTH = 0x31,
432    ERROR_INVALID_NUM_OF_STS_SEGMENTS = 0x32,
433    ERROR_INVALID_NUM_OF_CONTROLEES = 0x33,
434    ERROR_MAX_RANGING_REPLY_TIME_EXCEEDED = 0x34,
435    ERROR_INVALID_DST_ADDRESS_LIST = 0x35,
436    ERROR_INVALID_OR_NOT_FOUND_SUB_SESSION_ID = 0x36,
437    ERROR_INVALID_RESULT_REPORT_CONFIG = 0x37,
438    ERROR_INVALID_RANGING_ROUND_CONTROL_CONFIG = 0x38,
439    ERROR_INVALID_RANGING_ROUND_USAGE = 0x39,
440    ERROR_INVALID_MULTI_NODE_MODE = 0x3A,
441    ERROR_RDS_FETCH_FAILURE = 0x3B,
442    ERROR_REF_UWB_SESSION_DOES_NOT_EXIST = 0x3C,
443    ERROR_REF_UWB_SESSION_RANGING_DURATION_MISMATCH = 0x3D,
444    ERROR_REF_UWB_SESSION_INVALID_OFFSET_TIME = 0x3E,
445    ERROR_REF_UWB_SESSION_LOST = 0x3F,
446    RFU_REASON_CODE_RANGE_2 = 0x40..0x7F {
447        ERROR_DT_ANCHOR_RANGING_ROUNDS_NOT_CONFIGURED = 0x40,
448        ERROR_DT_TAG_RANGING_ROUNDS_NOT_CONFIGURED = 0x41,
449    },
450    VENDOR_SPECIFIC_REASON_CODE_RANGE_1 = 0x80..0xFE {
451        ERROR_INVALID_CHANNEL_WITH_AOA = 0x80,
452        ERROR_STOPPED_DUE_TO_OTHER_SESSION_CONFLICT = 0x81,
453    },
454    // For internal usage, we will use 0xFF as default.
455    VENDOR_SPECIFIC_REASON_CODE_2 = 0xFF,
456}
457
458enum MulticastUpdateStatusCode : 8 {
459    STATUS_OK_MULTICAST_LIST_UPDATE = 0x00,
460    STATUS_ERROR_MULTICAST_LIST_FULL = 0x01,
461    STATUS_ERROR_KEY_FETCH_FAIL = 0x02,
462    STATUS_ERROR_SUB_SESSION_ID_NOT_FOUND = 0x03,
463    STATUS_ERROR_SUB_SESSION_KEY_NOT_FOUND = 0x04,
464    STATUS_ERROR_SUB_SESSION_KEY_NOT_APPLICABLE = 0x05,
465    STATUS_ERROR_SESSION_KEY_NOT_FOUND = 0x06,
466    STATUS_ERROR_ADDRESS_NOT_FOUND = 0x07,
467    STATUS_ERROR_ADDRESS_ALREADY_PRESENT = 0x08,
468    RFU_STATUS_CODE_RANGE_1 = 0x09..0xFF,
469}
470
471enum MacAddressIndicator : 8 {
472    SHORT_ADDRESS = 0x00,
473    EXTENDED_ADDRESS = 0x01,
474}
475
476enum SessionType: 8 {
477    FIRA_RANGING_SESSION = 0x00,
478    FIRA_RANGING_AND_IN_BAND_DATA_SESSION = 0x01,
479    FIRA_DATA_TRANSFER_SESSION = 0x02,
480    FIRA_RANGING_ONLY_PHASE = 0x03,
481    FIRA_IN_BAND_DATA_PHASE = 0x04,
482    FIRA_RANGING_WITH_DATA_PHASE = 0x05,
483    CCC = 0xA0,
484    RADAR_SESSION = 0xA1,
485    ALIRO = 0xA2,
486    DEVICE_TEST_MODE = 0xD0,
487}
488
489enum MessageType: 3 {
490    DATA = 0x00,
491    COMMAND = 0x01,
492    RESPONSE = 0x02,
493    NOTIFICATION = 0x03,
494    RESERVED_FOR_TESTING_1 = 0x04,
495    RESERVED_FOR_TESTING_2 = 0x05,
496}
497
498// UCI packet description in compliance with the FIRA UCI spec.
499// Only this packet should be sent/expected across the HAL interface.
500packet UciPacketHal {
501    group_id_or_data_packet_format: GroupIdOrDataPacketFormat,
502    packet_boundary_flag: PacketBoundaryFlag,
503    message_type: MessageType,
504    _body_
505}
506
507// The UciDataPacketHal must be declared before the UciControlPacketHal for correct parsing to
508// happen. This is required as the Data packet specifies a value for the 'message_type' constraint,
509// while the Control packet does not (as it encompasses multiple 'message_type' values).
510packet UciDataPacketHal: UciPacketHal (message_type = DATA) {
511    _reserved_: 8,
512    _size_(_payload_): 16,
513    _payload_,
514}
515
516packet UciControlPacketHal: UciPacketHal {
517    opcode: 6,
518    _reserved_: 2,
519    _reserved_: 8,
520    _size_(_payload_): 8,
521    _payload_,
522}
523
524// This control packet definition is used throughout the stack that holds a complete
525// (i.e unfragmented) UCI command/response/notification.
526//
527// UciControlPacket needs to be converted to one or more UciControlPacketHal fragments before
528// sending to the HAL. One or more UciControlPacketHal fragments needs to be converted to
529// UciControlPacket when receiving from the HAL.
530//
531// TODO(b/202760099): Handle fragmentation more cleanly in the PDL.
532packet UciControlPacket {
533    group_id: GroupId,
534    // This field is different from |UciControlPacketHal| to provide a placeholder for PBF flag.
535    _reserved_: 1,
536    message_type: MessageType,
537    opcode: 6,
538    _reserved_: 2,
539    _reserved_: 8,
540     // This field is different from |UciControlPacketHal| to allow holding a large unfragmented
541     // packet.
542    _size_(_payload_): 32,
543    _payload_,
544}
545
546// This data packet definition is used throughout the stack that holds a complete
547// (i.e unfragmented) UCI data packet.
548//
549// UciDataPacket needs to be converted to one or more UciDataPacketHal fragments before sending to
550// the HAL. One or more UciDataPacketHal fragments needs to be converted to UciDataPacket when
551// receiving from the HAL.
552//
553// TODO(b/202760099): Handle fragmentation more cleanly in the PDL.
554packet UciDataPacket {
555    data_packet_format: DataPacketFormat,
556    // This field is different from |UciDataPacketHal| to provide a placeholder for PBF flag.
557    _reserved_: 1,
558    message_type: MessageType,
559    _reserved_: 8,
560     // This field is different from |UciDataPacketHal| to allow holding large unfragmented packet.
561    _size_(_payload_): 32,
562    _payload_,
563}
564
565packet UciDataSnd : UciDataPacket (data_packet_format = DATA_SND, message_type = DATA) {
566    session_token: 32, // Session ID or Session Handle (based on UWBS version)
567    dest_mac_address: 64,
568    uci_sequence_number: 16,
569    _size_(data): 16,
570    data: 8[]
571}
572
573packet UciDataRcv : UciDataPacket (data_packet_format = DATA_RCV, message_type = DATA) {
574    session_token: 32, // Session ID or Session Handle (based on UWBS version)
575    status: StatusCode,
576    source_mac_address: 64,
577    uci_sequence_number: 16,
578    _size_(data): 16,
579    data: 8[]
580}
581
582packet UciCommand : UciControlPacket (message_type = COMMAND) {
583    _payload_,
584}
585
586packet UciResponse : UciControlPacket (message_type = RESPONSE) {
587    _payload_,
588}
589
590packet UciNotification : UciControlPacket (message_type = NOTIFICATION) {
591    _payload_,
592}
593
594packet CoreCommand : UciCommand (group_id = CORE) {
595    _body_,
596}
597
598packet CoreResponse : UciResponse (group_id = CORE) {
599    _body_,
600}
601
602packet CoreNotification : UciNotification (group_id = CORE) {
603    _body_,
604}
605
606packet SessionConfigCommand : UciCommand (group_id = SESSION_CONFIG) {
607    _body_,
608}
609
610packet SessionConfigResponse : UciResponse (group_id = SESSION_CONFIG) {
611    _body_,
612}
613
614packet SessionConfigNotification : UciNotification (group_id = SESSION_CONFIG) {
615    _body_,
616}
617
618packet SessionControlCommand : UciCommand (group_id = SESSION_CONTROL) {
619    _body_,
620}
621
622packet SessionControlResponse : UciResponse (group_id = SESSION_CONTROL) {
623    _body_,
624}
625
626packet SessionControlNotification : UciNotification (group_id = SESSION_CONTROL) {
627    _body_,
628}
629
630packet AndroidCommand : UciCommand (group_id = VENDOR_ANDROID) {
631    _body_,
632}
633
634packet AndroidResponse : UciResponse (group_id = VENDOR_ANDROID) {
635    _body_,
636}
637
638packet AndroidNotification : UciNotification (group_id = VENDOR_ANDROID) {
639    _body_,
640}
641
642// TODO: b/202760099: Use the correspnding opcode enum instead of the raw value in the |opcode| field.
643packet DeviceResetCmd : CoreCommand (opcode = 0x0) { //CORE_DEVICE_RESET
644    reset_config: ResetConfig,
645}
646
647test DeviceResetCmd {
648    "\x20\x00\x00\x01\x00\x00\x00\x00",
649}
650
651packet DeviceResetRsp : CoreResponse (opcode = 0x0) { //CORE_DEVICE_RESET
652    status: StatusCode,
653}
654
655test DeviceResetRsp {
656    "\x40\x00\x00\x01\x00\x00\x00\x00",
657}
658
659packet DeviceStatusNtf : CoreNotification (opcode = 0x1) { //CORE_DEVICE_STATUS_NTF
660    device_state: DeviceState,
661}
662
663test DeviceStatusNtf {
664    "\x60\x01\x00\x01\x00\x00\x00\x01",
665}
666
667packet GetDeviceInfoCmd : CoreCommand (opcode = 0x2) { //CORE_DEVICE_INFO
668}
669
670test GetDeviceInfoCmd {
671    "\x20\x02\x00\x00\x00\x00\x00",
672}
673
674packet GetDeviceInfoRsp : CoreResponse (opcode = 0x2) { //CORE_DEVICE_INFO
675    status: StatusCode,
676    uci_version: 16,
677    mac_version: 16,
678    phy_version: 16,
679    uci_test_version: 16,
680    _count_(vendor_spec_info): 8,
681    vendor_spec_info: 8[],
682}
683
684test GetDeviceInfoRsp {
685    "\x40\x02\x00\x0b\x00\x00\x00\x01\x01\x00\x02\x00\x03\x00\x04\x00\x01\x0a",
686}
687
688packet GetCapsInfoCmd : CoreCommand (opcode = 0x3) { //CORE_GET_CAPS_INFO
689}
690
691test GetCapsInfoCmd {
692    "\x20\x03\x00\x00\x00\x00\x00",
693}
694
695struct CapTlv {
696    t: CapTlvType,
697    _count_(v): 8,
698    v: 8[],
699}
700
701
702packet GetCapsInfoRsp : CoreResponse (opcode = 0x3) { //CORE_GET_CAPS_INFO
703    status: StatusCode,
704    _count_(tlvs): 8,
705    tlvs: CapTlv[],
706}
707
708test GetCapsInfoRsp {
709    "\x40\x03\x00\x05\x00\x00\x00\x00\x01\x00\x01\x01",
710}
711
712struct DeviceConfigTlv {
713    cfg_id: DeviceConfigId,
714    _count_(v): 8,
715    v: 8[],
716}
717
718packet SetConfigCmd : CoreCommand (opcode = 0x4) { //CORE_SET_CONFIG
719    _count_(tlvs): 8,
720    tlvs: DeviceConfigTlv[],
721}
722
723test SetConfigCmd {
724    "\x20\x04\x00\x03\x00\x00\x00\x01\x01\x00",
725}
726
727struct DeviceConfigStatus {
728    cfg_id: DeviceConfigId,
729    status: StatusCode,
730}
731
732packet SetConfigRsp : CoreResponse (opcode = 0x4) { //CORE_SET_CONFIG
733    status: StatusCode,
734    _count_(cfg_status): 8,
735    cfg_status: DeviceConfigStatus[],
736}
737
738test SetConfigRsp {
739    "\x40\x04\x00\x04\x00\x00\x00\x01\x01\x01\x01",
740    "\x40\x04\x00\x04\x00\x00\x00\x01\x01\x01\x0B",
741}
742
743packet GetConfigCmd : CoreCommand (opcode = 0x5) { //CORE_GET_CONFIG
744    _count_(cfg_id): 8,
745    cfg_id: 8[], // DeviceConfigId (Infra does not allow array of enums)
746}
747
748test GetConfigCmd {
749    "\x20\x05\x00\x02\x00\x00\x00\x01\x01",
750}
751
752packet GetConfigRsp : CoreResponse (opcode = 0x5) { //CORE_GET_CONFIG
753    status: StatusCode,
754    _count_(tlvs): 8,
755    tlvs: DeviceConfigTlv[]
756}
757
758test GetConfigRsp {
759    "\x40\x05\x00\x05\x00\x00\x00\x01\x01\x00\x01\x01",
760}
761
762packet GenericError : CoreNotification (opcode = 0x7) { //CORE_GENERIC_ERROR_NTF
763    status: StatusCode,
764}
765
766test GenericError {
767    "\x60\x07\x00\x01\x00\x00\x00\x01",
768}
769
770
771packet CoreQueryTimeStampCmd : CoreCommand (opcode = 0x8) { //CORE_QUERY_UWBS_TIMESTAMP
772}
773
774test CoreQueryTimeStampCmd {
775    "\x20\x08\x00\\x00",
776}
777
778packet CoreQueryTimeStampRsp : CoreResponse (opcode = 0x8) { //CORE_QUERY_UWBS_TIMESTAMP
779    status: StatusCode,
780    timeStamp: 64,
781}
782
783test CoreQueryTimeStampRsp {
784    "\x40\x08\x00\x09\x00\x00\x00\x01\x01\x00\x01\x01\x01",
785}
786
787packet SessionInitCmd : SessionConfigCommand (opcode = 0x0) { //SESSION_INIT
788    session_id: 32,
789    session_type: SessionType,
790}
791
792test SessionInitCmd {
793    "\x21\x00\x00\x05\x00\x00\x00\x01\x02\x03\x04\x01",
794}
795
796// FIRA version 2 introduces a new version of SESSION_INIT_RSP which
797// includes UWBS generated session handle.
798packet SessionInitRsp_V2 : SessionConfigResponse (opcode = 0x0) { //SESSION_INIT
799    status: StatusCode,
800    session_handle: 32,
801}
802
803test SessionInitRsp_V2 {
804    "\x41\x00\x00\x01\x00\x00\x00\x11\x00\x00\x00\x01",
805}
806
807packet SessionInitRsp : SessionConfigResponse (opcode = 0x0) { //SESSION_INIT
808    status: StatusCode,
809}
810
811test SessionInitRsp {
812    "\x41\x00\x00\x01\x00\x00\x00\x11",
813}
814
815packet SessionDeinitCmd : SessionConfigCommand (opcode = 0x1) { //SESSION_DEINIT
816    session_token: 32, // Session ID or Session Handle (based on UWBS version)
817}
818
819test SessionDeinitCmd {
820    "\x21\x01\x00\x04\x00\x00\x00\x01\x02\x03\x04",
821}
822
823packet SessionDeinitRsp : SessionConfigResponse (opcode = 0x1) { //SESSION_DEINIT
824    status: StatusCode,
825}
826
827test SessionDeinitRsp {
828    "\x41\x01\x00\x01\x00\x00\x00\x00",
829}
830
831packet SessionStatusNtf : SessionConfigNotification (opcode = 0x2) { //SESSION_STATUS_NTF
832    session_token: 32, // Session ID or Session Handle (based on UWBS version)
833    session_state: SessionState,
834    // TODO(b/272775225): Switch back to the enum type ReasonCode, once PDL supports defining a
835    // range inside an enum (for the vendor-specific space), in b/267339120.
836    reason_code: 8,
837}
838
839test SessionStatusNtf {
840    "\x61\x02\x00\x06\x00\x00\x00\x01\x02\x03\x04\x02\x21",
841    "\x61\x02\x00\x06\x00\x00\x00\x01\x02\x03\x04\x01\x82", // Vendor Specific Reason Code
842}
843
844struct AppConfigTlv {
845    cfg_id: AppConfigTlvType,
846    _count_(v): 8,
847    v: 8[],
848}
849
850packet SessionSetAppConfigCmd : SessionConfigCommand (opcode = 0x3) { //SESSION_SET_APP_CONFIG
851    session_token: 32, // Session ID or Session Handle (based on UWBS version)
852    _count_(tlvs): 8,
853    tlvs: AppConfigTlv[]
854}
855
856test SessionSetAppConfigCmd {
857    "\x21\x03\x00\x05\x00\x00\x00\x01\x02\x03\x04\x00",
858}
859
860struct AppConfigStatus {
861    cfg_id: AppConfigTlvType,
862    status: StatusCode,
863}
864
865packet SessionSetAppConfigRsp : SessionConfigResponse (opcode = 0x3) { //SESSION_SET_APP_CONFIG
866    status: StatusCode,
867    _count_(cfg_status): 8,
868    cfg_status: AppConfigStatus[],
869}
870
871test SessionSetAppConfigRsp {
872    "\x41\x03\x00\x04\x00\x00\x00\x01\x01\x01\x00",
873}
874
875packet SessionGetAppConfigCmd : SessionConfigCommand (opcode = 0x4) { //SESSION_GET_APP_CONFIG
876    session_token: 32, // Session ID or Session Handle (based on UWBS version)
877    _count_(app_cfg): 8,
878    app_cfg: 8[], // AppConfigTlvType (Infra does not allow array of enums)
879}
880
881test SessionGetAppConfigCmd {
882    "\x21\x04\x00\x05\x00\x00\x00\x01\x02\x03\x04\x00",
883}
884
885packet SessionGetAppConfigRsp : SessionConfigResponse (opcode = 0x4) { //SESSION_GET_APP_CONFIG
886    status: StatusCode,
887    _count_(tlvs): 8,
888    tlvs: AppConfigTlv[],
889}
890
891test SessionGetAppConfigRsp {
892    "\x41\x04\x00\x02\x00\x00\x00\x01\x00",
893}
894
895packet SessionGetCountCmd : SessionConfigCommand (opcode = 0x5) { //SESSION_GET_COUNT
896}
897
898test SessionGetCountCmd {
899    "\x21\x05\x00\x00\x00\x00\x00",
900}
901
902packet SessionGetCountRsp : SessionConfigResponse (opcode = 0x5) { //SESSION_GET_COUNT
903    status: StatusCode,
904    session_count: 8,
905}
906
907test SessionGetCountRsp {
908    "\x41\x05\x00\x02\x00\x00\x00\x00\x01",
909}
910
911packet SessionGetStateCmd : SessionConfigCommand (opcode = 0x6) { //SESSION_GET_STATE
912    session_token: 32, // Session ID or Session Handle (based on UWBS version)
913}
914
915test SessionGetStateCmd {
916    "\x21\x06\x00\x04\x00\x00\x00\x00\x01\x02\x03",
917}
918
919packet SessionGetStateRsp : SessionConfigResponse (opcode = 0x6) { //SESSION_GET_STATE
920    status: StatusCode,
921    session_state: SessionState,
922}
923
924test SessionGetStateRsp {
925    "\x41\x06\x00\x02\x00\x00\x00\x00\x01",
926}
927
928packet SessionUpdateDtTagRangingRoundsCmd : SessionConfigCommand (opcode = 0x9) { //SESSION_UPDATE_ACTIVE_ROUNDS_DT_TAG
929    session_token: 32, // Session ID or Session Handle (based on UWBS version)
930    _count_(ranging_round_indexes): 8,
931    ranging_round_indexes: 8[],
932}
933
934test SessionUpdateDtTagRangingRoundsCmd {
935    "\x21\x09\x00\x0a\x00\x00\x00\x03\x03\x0f\x0c\x05\x08\x00\x00\x00\x00",
936}
937
938packet SessionUpdateDtTagRangingRoundsRsp : SessionConfigResponse (opcode = 0x9) { //SESSION_UPDATE_ACTIVE_ROUNDS_DT_TAG
939    status: StatusCode,
940    _count_(ranging_round_indexes): 8,
941    ranging_round_indexes: 8[],
942}
943
944test SessionUpdateDtTagRangingRoundsRsp {
945    "\x41\x09\x00\x03\x00\x00\x00\x01\x01\x01",
946}
947
948struct Controlee {
949    short_address: 8[2],
950    subsession_id: 32,
951}
952
953struct Controlee_V2_0_16_Byte_Version {
954    short_address: 8[2],
955    subsession_id: 32,
956    subsession_key: 8[16],
957}
958
959struct Controlee_V2_0_32_Byte_Version {
960    short_address: 8[2],
961    subsession_id: 32,
962    subsession_key: 8[32],
963}
964
965enum UpdateMulticastListAction: 8 {
966    ADD_CONTROLEE = 0x00,
967    REMOVE_CONTROLEE = 0x01,
968    ADD_CONTROLEE_WITH_SHORT_SUB_SESSION_KEY = 0x02,
969    ADD_CONTROLEE_WITH_LONG_SUB_SESSION_KEY = 0x03,
970}
971
972packet SessionUpdateControllerMulticastListCmd : SessionConfigCommand (opcode = 0x7) { //SESSION_UPDATE_CONTROLLER_MULTICAST_LIST
973    session_token: 32, // Session ID or Session Handle (based on UWBS version)
974    action: UpdateMulticastListAction,
975    _payload_,
976}
977
978
979struct SessionUpdateControllerMulticastListCmdPayload {
980    _count_(controlees): 8,
981    controlees: Controlee[],
982}
983
984struct SessionUpdateControllerMulticastListCmd_2_0_16_Byte_Payload {
985    _count_(controlees): 8,
986    controlees: Controlee_V2_0_16_Byte_Version[],
987}
988
989struct SessionUpdateControllerMulticastListCmd_2_0_32_Byte_Payload {
990    _count_(controlees): 8,
991    controlees: Controlee_V2_0_32_Byte_Version[],
992}
993
994packet SessionUpdateControllerMulticastListRsp : SessionConfigResponse (opcode = 0x7) { //SESSION_UPDATE_CONTROLLER_MULTICAST_LIST
995    _payload_,
996}
997
998test SessionUpdateControllerMulticastListRsp {
999    "\x41\x07\x00\x01\x00\x00\x00\x00",
1000}
1001
1002struct SessionUpdateControllerMulticastListRspV1Payload {
1003    status: StatusCode,
1004}
1005
1006struct SessionUpdateControllerMulticastListRspV2Payload {
1007    status: StatusCode,
1008    _count_(controlee_status): 8,
1009    controlee_status: ControleeStatusV2[],
1010}
1011
1012struct ControleeStatusV1 {
1013    mac_address: 8[2],
1014    subsession_id: 32,
1015    status: MulticastUpdateStatusCode,
1016}
1017
1018struct ControleeStatusV2 {
1019    mac_address: 8[2],
1020    status: MulticastUpdateStatusCode,
1021}
1022
1023packet SessionUpdateControllerMulticastListNtf : SessionConfigNotification (opcode = 0x7) { //SESSION_UPDATE_CONTROLLER_MULTICAST_LIST
1024    session_token: 32, // Session ID or Session Handle (based on UWBS version)
1025    _payload_,
1026}
1027
1028test SessionUpdateControllerMulticastListNtf {
1029    "\x61\x07\x00\x06\x00\x00\x00\x00\x01\x02\x03\x04\x00",
1030}
1031
1032struct SessionUpdateControllerMulticastListNtfV1Payload {
1033    remaining_multicast_list_size: 8,
1034    _count_(controlee_status): 8,
1035    controlee_status: ControleeStatusV1[],
1036}
1037
1038struct SessionUpdateControllerMulticastListNtfV2Payload {
1039    _count_(controlee_status): 8,
1040    controlee_status: ControleeStatusV2[],
1041}
1042
1043packet DataCreditNtf : SessionControlNotification (opcode = 0x04) { // SESSION_DATA_CREDIT_NTF
1044    session_token: 32, // Session ID or Session Handle (based on UWBS version)
1045    credit_availability: CreditAvailability,
1046}
1047
1048test DataCreditNtf {
1049    "\x62\x04\x00\x05\x00\x00\x00\x00\x00\x00\x01\x01",
1050}
1051
1052packet DataTransferStatusNtf : SessionControlNotification (opcode = 0x05) { // SESSION_DATA_TRANSFER_STATUS_NTF
1053    session_token: 32, // Session ID or Session Handle (based on UWBS version)
1054    uci_sequence_number: 16,
1055    status: DataTransferNtfStatusCode,
1056    tx_count: 8,
1057}
1058
1059test DataTransferStatusNtf {
1060    "\x62\x05\x00\x06\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00",
1061}
1062
1063packet SessionQueryMaxDataSizeCmd : SessionConfigCommand (opcode = 0xB) { //QUERY_MAX_DATA_SIZE
1064    session_token: 32, // Session ID or Session Handle (based on UWBS version)
1065}
1066
1067test SessionQueryMaxDataSizeCmd {
1068 "\x21\x0B\x00\x04\x00\x00\x00\x00",
1069}
1070
1071packet SessionQueryMaxDataSizeRsp : SessionConfigResponse (opcode = 0xB) { //QUER_MAX_DATA_SIZE
1072    session_token: 32, // Session ID or Session Handle (based on UWBS version)
1073    status: StatusCode,
1074    max_data_size: 16,
1075}
1076
1077test SessionQueryMaxDataSizeRsp {
1078  "\x41\x0B\x00\x06\x00\x00\x00\x00\x00\x0E7\0x07",
1079}
1080
1081packet SessionDataTransferPhaseConfigCmd : SessionConfigCommand (opcode = 0x0e) { //SESSION_DATA_TRANSFER_PHASE_CONFIGURATION
1082    session_token: 32, // Session ID or Session Handle (based on UWBS version)
1083    dtpcm_repetition: 8,
1084    data_transfer_control: 8,
1085    dtpml_size: 8,
1086    _payload_,
1087}
1088
1089packet SessionDataTransferPhaseConfigRsp : SessionConfigResponse (opcode = 0x0e) { //SESSION_DATA_TRANSFER_PHASE_CONFIGURATION
1090    status: StatusCode,
1091}
1092
1093packet SessionDataTransferPhaseConfigNtf : SessionConfigNotification (opcode = 0x0e) { //SESSION_DATA_TRANSFER_PHASE_CONFIGURATION
1094    session_token: 32, // Session ID or Session Handle (based on UWBS version)
1095    status: DataTransferPhaseConfigUpdateStatusCode,
1096}
1097
1098test SessionDataTransferPhaseConfigNtf {
1099    "\x61\x0E\x00\x05\x00\x00\x00\x00\x00"
1100}
1101
1102struct PhaseListShortMacAddress {
1103    session_token: 32,
1104    start_slot_index: 16,
1105    end_slot_index: 16,
1106    phase_participation: 8,
1107    mac_address: 8[2],
1108}
1109
1110struct PhaseListExtendedMacAddress {
1111    session_token: 32,
1112    start_slot_index: 16,
1113    end_slot_index: 16,
1114    phase_participation: 8,
1115    mac_address: 8[8],
1116}
1117
1118packet SessionSetHybridControllerConfigCmd : SessionConfigCommand (opcode = 0x0C) { //SESSION_SET_HUS_CONTROLLER_CONFIG
1119    session_token: 32,
1120    message_control: 8,
1121    number_of_phases: 8,
1122    update_time: 8[8],
1123    _payload_,
1124}
1125
1126test SessionSetHybridControllerConfigCmd {
1127"\x21\x0C\x00\x23\x03\x00\x00\x01\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x05\x01\x00\x19\x00\x00\x30\x00\x02\x00\x00\x03\x1A\x00\x32\x00\x00\x30\x00",
1128}
1129
1130packet SessionSetHybridControllerConfigRsp : SessionConfigResponse (opcode = 0x0C) { //SESSION_SET_HUS_CONTROLLER_CONFIG
1131    status: StatusCode,
1132}
1133
1134test SessionSetHybridControllerConfigRsp {
1135     "\x41\x0C\x00\x01\x00"
1136}
1137
1138struct ControleePhaseList {
1139    session_token: 32,
1140    phase_participation: 8,
1141}
1142
1143packet SessionSetHybridControleeConfigCmd : SessionConfigCommand (opcode = 0x0D) { //SESSION_SET_HUS_CONTROLEE_CONFIG
1144    session_token: 32,
1145    _count_(controlee_phase_list): 8,
1146    controlee_phase_list: ControleePhaseList[],
1147}
1148
1149test SessionSetHybridControleeConfigCmd {
1150    "\x21\x0D\x00\x0F\x03\x00\x00\x01\x02\x01\x00\x00\x05\x02\x02\x00\x00\x03\x02",
1151}
1152
1153packet SessionSetHybridControleeConfigRsp : SessionConfigResponse (opcode = 0x0D) { //SESSION_SET_HUS_CONTROLEE_CONFIG
1154    status: StatusCode,
1155}
1156
1157test SessionSetHybridControleeConfigRsp {
1158     "\x41\x0D\x00\x01\x00"
1159}
1160
1161packet SessionStartCmd : SessionControlCommand (opcode = 0x0) { //RANGE_START
1162    session_token: 32, // Session ID or Session Handle (based on UWBS version)
1163}
1164
1165test SessionStartCmd {
1166    "\x22\x00\x00\x04\x00\x00\x00\x00\x01\x02\x03",
1167}
1168
1169packet SessionStartRsp : SessionControlResponse (opcode = 0x0) { //RANGE_START
1170    status: StatusCode,
1171}
1172
1173test SessionStartRsp {
1174    "\x42\x00\x00\x01\x00\x00\x00\x00",
1175}
1176
1177struct ShortAddressTwoWayRangingMeasurement {
1178    mac_address: 16,
1179    status: StatusCode,
1180    nlos: 8,
1181    distance: 16,
1182    aoa_azimuth: 16,
1183    aoa_azimuth_fom: 8,
1184    aoa_elevation: 16,
1185    aoa_elevation_fom: 8,
1186    aoa_destination_azimuth: 16,
1187    aoa_destination_azimuth_fom: 8,
1188    aoa_destination_elevation: 16,
1189    aoa_destination_elevation_fom: 8,
1190    slot_index: 8,
1191    rssi: 8,
1192    // b/272301550: The pdl compiler cannot handle individual fields
1193    // larger than 64 bit. The work around is to split the 88 bit
1194    // field into two.
1195    _reserved_: 64,
1196    _reserved_: 24,
1197}
1198
1199struct ExtendedAddressTwoWayRangingMeasurement {
1200    mac_address: 64,
1201    status: StatusCode,
1202    nlos: 8,
1203    distance: 16,
1204    aoa_azimuth: 16,
1205    aoa_azimuth_fom: 8,
1206    aoa_elevation: 16,
1207    aoa_elevation_fom: 8,
1208    aoa_destination_azimuth: 16,
1209    aoa_destination_azimuth_fom: 8,
1210    aoa_destination_elevation: 16,
1211    aoa_destination_elevation_fom: 8,
1212    slot_index: 8,
1213    rssi: 8,
1214    _reserved_: 40,
1215}
1216
1217struct ShortAddressOwrAoaRangingMeasurement {
1218    mac_address: 16,
1219    status: StatusCode,
1220    nlos: 8,
1221    frame_sequence_number: 8,
1222    block_index: 16,
1223    aoa_azimuth: 16,
1224    aoa_azimuth_fom: 8,
1225    aoa_elevation: 16,
1226    aoa_elevation_fom: 8,
1227}
1228
1229struct ExtendedAddressOwrAoaRangingMeasurement {
1230    mac_address: 64,
1231    status: StatusCode,
1232    nlos: 8,
1233    frame_sequence_number: 8,
1234    block_index: 16,
1235    aoa_azimuth: 16,
1236    aoa_azimuth_fom: 8,
1237    aoa_elevation: 16,
1238    aoa_elevation_fom: 8,
1239}
1240
1241enum RangingMeasurementType : 8 {
1242    ONE_WAY = 0x0,
1243    TWO_WAY = 0x1,
1244    DL_TDOA = 0x02,
1245    OWR_AOA = 0x03,
1246}
1247
1248packet SessionInfoNtf : SessionControlNotification (opcode = 0x0) { // SESSION_INFO
1249    sequence_number: 32,
1250    session_token: 32, // Session ID or Session Handle (based on UWBS version)
1251    rcr_indicator: 8,
1252    current_ranging_interval: 32,
1253    ranging_measurement_type: RangingMeasurementType,
1254    _reserved_: 8,
1255    mac_address_indicator: MacAddressIndicator,
1256    _reserved_: 64,
1257    _body_,
1258}
1259
1260packet ShortMacTwoWaySessionInfoNtf : SessionInfoNtf (ranging_measurement_type = TWO_WAY, mac_address_indicator = SHORT_ADDRESS) {
1261    _count_(two_way_ranging_measurements) : 8,
1262    two_way_ranging_measurements : ShortAddressTwoWayRangingMeasurement[],
1263    vendor_data: 8[],
1264}
1265
1266test ShortMacTwoWaySessionInfoNtf {
1267    "\x62\x00\x00\x19\x00\x00\x00\x00\x02\x03\x04\x05\x06\x07\x08\x00\x0a\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
1268}
1269
1270packet ExtendedMacTwoWaySessionInfoNtf : SessionInfoNtf (ranging_measurement_type = TWO_WAY, mac_address_indicator = EXTENDED_ADDRESS) {
1271    _count_(two_way_ranging_measurements) : 8,
1272    two_way_ranging_measurements : ExtendedAddressTwoWayRangingMeasurement[],
1273    vendor_data: 8[],
1274}
1275
1276test ExtendedMacTwoWaySessionInfoNtf {
1277    "\x62\x00\x00\x19\x00\x00\x00\x00\x02\x03\x04\x05\x06\x07\x08\x00\x0a\x01\x01\x01\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00",
1278}
1279
1280packet ShortMacDlTDoASessionInfoNtf : SessionInfoNtf (ranging_measurement_type = DL_TDOA, mac_address_indicator = SHORT_ADDRESS) {
1281    no_of_ranging_measurements : 8,
1282    dl_tdoa_measurements : 8[],
1283}
1284
1285test ShortMacDlTDoASessionInfoNtf {
1286     "\x62\x00\x00\x19\x00\x00\x00\x00\x02\x03\x04\x05\x06\x07\x08\x00\x0a\x02\x01\x01\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
1287}
1288
1289packet ExtendedMacDlTDoASessionInfoNtf : SessionInfoNtf (ranging_measurement_type = DL_TDOA, mac_address_indicator = EXTENDED_ADDRESS) {
1290    no_of_ranging_measurements : 8,
1291    dl_tdoa_measurements : 8[],
1292}
1293
1294test ExtendedMacDlTDoASessionInfoNtf {
1295     "\x62\x00\x00\x19\x00\x00\x00\x00\x02\x03\x04\x05\x06\x07\x08\x00\x0a\x01\x01\x01\x02\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00",
1296}
1297
1298packet ShortMacOwrAoaSessionInfoNtf : SessionInfoNtf (ranging_measurement_type = OWR_AOA, mac_address_indicator = SHORT_ADDRESS) {
1299    _count_(owr_aoa_ranging_measurements) : 8,
1300    owr_aoa_ranging_measurements : ShortAddressOwrAoaRangingMeasurement[],
1301    vendor_data: 8[],
1302}
1303
1304test ShortMacOwrAoaSessionInfoNtf {
1305    "\x62\x00\x00\x19\x00\x00\x00\x00\x02\x03\x04\x05\x06\x07\x08\x00\x0a\x01\x01\x01\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
1306    "\x62\x00\x00\x26\x00\x00\x00\x00\x02\x03\x04\x05\x06\x07\x08\x00\x0a\x01\x01\x01\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xaa\xbb\x00\x00\x01\x01\x00\x03\x04\x60\x05\x06\x50",
1307}
1308
1309packet ExtendedMacOwrAoaSessionInfoNtf : SessionInfoNtf (ranging_measurement_type = OWR_AOA, mac_address_indicator = EXTENDED_ADDRESS) {
1310    _count_(owr_aoa_ranging_measurements) : 8,
1311    owr_aoa_ranging_measurements : ExtendedAddressOwrAoaRangingMeasurement[],
1312    vendor_data: 8[],
1313}
1314
1315test ExtendedMacOwrAoaSessionInfoNtf {
1316    "\x62\x00\x00\x19\x00\x00\x00\x00\x02\x03\x04\x05\x06\x07\x08\x00\x0a\x01\x01\x01\x03\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00",
1317    "\x62\x00\x00\x2c\x00\x00\x00\x00\x02\x03\x04\x05\x06\x07\x08\x00\x0a\x01\x01\x01\x03\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x01\xaa\xbb\xcc\xdd\x01\x02\x03\x04\x00\x00\x01\x01\x00\x03\x04\x60\x05\x06\x50",
1318}
1319
1320packet SessionStopCmd : SessionControlCommand (opcode = 0x1) { // SESSION_STOP
1321    session_token: 32, // Session ID or Session Handle (based on UWBS version)
1322}
1323
1324test SessionStopCmd {
1325    "\x22\x01\x00\x04\x00\x00\x00\x00\x02\x03\x04",
1326}
1327
1328packet SessionStopRsp : SessionControlResponse (opcode = 0x1) { // SESSION_STOP
1329    status: StatusCode,
1330}
1331
1332test SessionStopRsp {
1333    "\x42\x01\x00\x01\x00\x00\x00\x00",
1334}
1335
1336packet SessionGetRangingCountCmd : SessionControlCommand (opcode = 0x3) { // SESSION_GET_RANGING_COUNT
1337    session_token: 32, // Session ID or Session Handle (based on UWBS version)
1338}
1339
1340test SessionGetRangingCountCmd {
1341    "\x22\x03\x00\x04\x00\x00\x00\x00\x02\x03\x04",
1342}
1343
1344packet SessionGetRangingCountRsp : SessionControlResponse (opcode = 0x3) { // SESSION_GET_RANGING_COUNT
1345    status: StatusCode,
1346    count: 32,
1347}
1348
1349test SessionGetRangingCountRsp {
1350    "\x42\x03\x00\x05\x00\x00\x00\x00\x02\x03\x04\x05",
1351}
1352
1353packet AndroidGetPowerStatsCmd: AndroidCommand (opcode = 0x0) { //ANDROID_GET_POWER_STATS
1354}
1355
1356test AndroidGetPowerStatsCmd {
1357    "\x2c\x00\x00\x00\x00\x00\x00",
1358}
1359
1360struct PowerStats {
1361    status: StatusCode,
1362    idle_time_ms: 32,
1363    tx_time_ms: 32,
1364    rx_time_ms: 32,
1365    total_wake_count:32,
1366}
1367
1368packet AndroidGetPowerStatsRsp : AndroidResponse (opcode = 0x0) { //ANDROID_GET_POWER_STATS
1369    stats: PowerStats,
1370}
1371
1372test AndroidGetPowerStatsRsp {
1373    "\x4c\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
1374}
1375
1376packet AndroidSetCountryCodeCmd: AndroidCommand (opcode = 0x1) { //ANDROID_SET_COUNTRY_CODE
1377    country_code : 8[2],
1378}
1379
1380// Set country code to US.
1381test AndroidSetCountryCodeCmd {
1382    "\x2c\x01\x00\x02\x00\x00\x00\x55\x53",
1383}
1384
1385packet AndroidSetCountryCodeRsp : AndroidResponse (opcode = 0x1) { //ANDROID_SET_COUNTRY_CODE
1386    status: StatusCode,
1387}
1388
1389test AndroidSetCountryCodeRsp {
1390    "\x4c\x01\x00\x01\x00\x00\x00\x00",
1391}
1392
1393struct FrameReportTlv {
1394    t: FrameReportTlvType,
1395    _size_(v): 16,
1396    v: 8[],
1397}
1398
1399packet FrameReportTlvPacket {
1400    t: FrameReportTlvType,
1401    _size_(_body_): 16,
1402    _body_,
1403}
1404
1405packet Rssi : FrameReportTlvPacket (t = RSSI) {
1406    rssi: 8[],
1407}
1408
1409struct AoaMeasurement {
1410    tdoa: 16,
1411    pdoa: 16,
1412    aoa: 16,
1413    fom: 8,
1414    t: 8,
1415}
1416
1417packet Aoa : FrameReportTlvPacket (t = AOA) {
1418    aoa: AoaMeasurement[],
1419}
1420
1421test Aoa {
1422    "\x01\x08\x00\x00\x01\x00\x01\x00\x01\x01\x01",
1423}
1424
1425struct CirValue {
1426    first_path_index : 16,
1427    first_path_snr: 16,
1428    first_path_ns: 16,
1429    peak_path_index: 16,
1430    peak_path_snr: 16,
1431    peak_path_ns: 16,
1432    first_path_sample_offset: 8,
1433    samples_number: 8,
1434    _size_(sample_window): 16,
1435    sample_window: 8[],
1436}
1437
1438packet Cir : FrameReportTlvPacket (t = CIR) {
1439    _count_(cir_value): 8,
1440    cir_value: CirValue[],
1441}
1442
1443test Cir {
1444    "\x02\x15\x00\x01\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x00\x02\x04\x00\x01\x02\x03\x04",
1445}
1446
1447packet SegmentMetrics : FrameReportTlvPacket (t = SEGMENT_METRICS) {
1448    segment_metrics: SegmentMetricsValue[],
1449}
1450
1451struct SegmentMetricsValue {
1452    receiver: 8,
1453    rf_noise_floor: 16,
1454    segment_rsl: 16,
1455    first_path_index: 16,
1456    first_path_rsl: 16,
1457    first_path_time_ns: 16,
1458    peak_path_index: 16,
1459    peak_path_rsl: 16,
1460    peak_path_time_ns: 16,
1461}
1462
1463test SegmentMetrics {
1464    "\x08\xB0\xFF\x04\x3C\xE1\x02\xA1\xFF\x52\xB8\xE3\x02\xC4\xFF\xC0\xB8",
1465}
1466
1467struct FrameReport {
1468    uwb_msg_id: 8,
1469    action: 8,
1470    antenna_set: 8,
1471    _count_(frame_report_tlvs): 8,
1472    frame_report_tlvs: FrameReportTlv[],
1473}
1474
1475packet AndroidRangeDiagnosticsNtf : AndroidNotification (opcode = 0x2) { //FIRA_RANGE_DIAGNOSTICS
1476    session_token: 32, // Session ID or Session Handle (based on UWBS version)
1477    sequence_number: 32,
1478    _count_(frame_reports): 8,
1479    frame_reports: FrameReport[],
1480}
1481
1482test AndroidRangeDiagnosticsNtf {
1483    "\x6c\x02\x00\x11\x00\x00\x00\x01\x01\x01\x01\x02\x02\x02\x02\x01\x00\x01\x02\x01\x00\x01\x00\x00",
1484    "\x6c\x02\x00\x34\x00\x00\x00\x01\x01\x01\x01\x02\x02\x02\x02\x01\x00\x01\x02\x03\x01\x08\x00\x01\x02\x01\x02\x01\x02\x01\x01\x02\x15\x00\x01\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x00\x02\x04\x00\x01\x02\x03\x04\x00\x01\x00\x00",
1485}
1486
1487packet UciVendor_9_Response : UciResponse (group_id = VENDOR_RESERVED_9) {
1488    _payload_,
1489}
1490
1491packet UciVendor_A_Response : UciResponse (group_id = VENDOR_RESERVED_A) {
1492    _payload_,
1493}
1494
1495packet UciVendor_B_Response : UciResponse (group_id = VENDOR_RESERVED_B) {
1496    _payload_,
1497}
1498
1499packet UciVendor_E_Response : UciResponse (group_id = VENDOR_RESERVED_E) {
1500    _payload_,
1501}
1502
1503packet UciVendor_F_Response : UciResponse (group_id = VENDOR_RESERVED_F) {
1504    _payload_,
1505}
1506
1507packet UciVendor_9_Notification : UciNotification (group_id = VENDOR_RESERVED_9) {
1508    _payload_,
1509}
1510
1511packet UciVendor_A_Notification : UciNotification (group_id = VENDOR_RESERVED_A) {
1512    _payload_,
1513}
1514
1515packet UciVendor_B_Notification : UciNotification (group_id = VENDOR_RESERVED_B) {
1516    _payload_,
1517}
1518
1519packet UciVendor_E_Notification : UciNotification (group_id = VENDOR_RESERVED_E) {
1520    _payload_,
1521}
1522
1523packet UciVendor_F_Notification : UciNotification (group_id = VENDOR_RESERVED_F) {
1524    _payload_,
1525}
1526
1527packet TestNotification : UciNotification (group_id = TEST) {
1528    _payload_,
1529}
1530
1531enum RadarDataType : 8 {
1532    RADAR_SWEEP_SAMPLES = 0x00,
1533}
1534
1535enum RadarConfigTlvType : 8 {
1536    RADAR_TIMING_PARAMS = 0x00,
1537    SAMPLES_PER_SWEEP = 0x01,
1538    CHANNEL_NUMBER = 0x02,
1539    SWEEP_OFFSET = 0x03,
1540    RFRAME_CONFIG = 0x04,
1541    PREAMBLE_DURATION = 0x05,
1542    PREAMBLE_CODE_INDEX = 0x06,
1543    SESSION_PRIORITY = 0x07,
1544    BITS_PER_SAMPLE = 0x08,
1545    PRF_MODE = 0x09,
1546    NUMBER_OF_BURSTS = 0x0A,
1547    RADAR_DATA_TYPE = 0x0B,
1548
1549    RFU_RADAR_APP_CFG_TLV_TYPE_RANGE = 0x0C..0x9F,
1550
1551    VENDOR_SPECIFIC_RADAR_APP_CFG_TLV_TYPE_RANGE = 0xA0..0xDF,
1552}
1553
1554struct RadarConfigTlv {
1555    cfg_id: RadarConfigTlvType,
1556    _count_(v): 8,
1557    v: 8[],
1558}
1559
1560struct RadarConfigStatus {
1561    cfg_id: RadarConfigTlvType,
1562    status: StatusCode,
1563}
1564
1565packet AndroidSetRadarConfigCmd: AndroidCommand (opcode = 0x11) {
1566    session_token: 32,
1567    _count_(tlvs): 8,
1568    tlvs: RadarConfigTlv[]
1569}
1570
1571packet AndroidSetRadarConfigRsp : AndroidResponse (opcode = 0x11) {
1572    status: StatusCode,
1573    _count_(cfg_status): 8,
1574    cfg_status: RadarConfigStatus[],
1575}
1576
1577packet AndroidGetRadarConfigCmd: AndroidCommand (opcode = 0x12) {
1578    session_token: 32,
1579    _count_(tlvs): 8,
1580    tlvs: 8[], // RadarConfigTlvType (Infra does not allow array of enums)
1581}
1582
1583packet AndroidGetRadarConfigRsp : AndroidResponse (opcode = 0x12) {
1584    status: StatusCode,
1585    _count_(tlvs): 8,
1586    tlvs: RadarConfigTlv[],
1587}
1588
1589enum BitsPerSample : 8 {
1590    VALUE_32 = 0x00,
1591    VALUE_48 = 0x01,
1592    VALUE_64 = 0x02
1593}
1594
1595struct RadarSweepDataRaw {
1596    sequence_number: 32,
1597    timestamp: 32,
1598    _count_(vendor_specific_data): 8,
1599    vendor_specific_data: 8[],
1600    sample_data: 8[],
1601}
1602
1603packet RadarDataRcv : UciDataPacket (data_packet_format = RADAR_DATA_MESSAGE, message_type = DATA) {
1604    session_handle: 32,
1605    status: DataRcvStatusCode,
1606    radar_data_type: RadarDataType,
1607    number_of_sweeps: 8,
1608    samples_per_sweep: 8,
1609    bits_per_sample: BitsPerSample,
1610    sweep_offset: 16,
1611    sweep_data_size: 16,
1612    sweep_data: 8[],
1613}
1614
1615