blob: 1f3969cdf24edc849662496f1d0e9b236630b28b [file] [log] [blame]
little_endian_packets
enum PacketBoundaryFlag : 1 {
COMPLETE = 0x00,
NOT_COMPLETE = 0x01,
}
enum GroupId : 4 {
CORE = 0x00,
SESSION_CONFIG = 0x01,
SESSION_CONTROL = 0x02,
DATA_CONTROL = 0x03,
TEST = 0x0d,
VENDOR_RESERVED_9 = 0x09,
VENDOR_RESERVED_A = 0x0a,
VENDOR_RESERVED_B = 0x0b,
VENDOR_ANDROID = 0x0c,
VENDOR_RESERVED_E = 0x0e,
VENDOR_RESERVED_F = 0x0f,
}
enum DataPacketFormat: 4 {
DATA_SND = 0x01,
DATA_RCV = 0x02,
RADAR_DATA_MESSAGE = 0x0f,
}
// Define a merged enum across GroupId & DataPacketFormat as they are at the same bits in
// |UciPacketHal|.
enum GroupIdOrDataPacketFormat : 4 {
CORE = 0x00,
SESSION_CONFIG_OR_DATA_SND = 0x01,
SESSION_CONTROL_OR_DATA_RCV = 0x02,
DATA_CONTROL = 0x03,
TEST = 0x0d,
VENDOR_RESERVED_9 = 0x09,
VENDOR_RESERVED_A = 0x0a,
VENDOR_RESERVED_B = 0x0b,
VENDOR_ANDROID = 0x0c,
VENDOR_RESERVED_E = 0x0e,
VENDOR_RESERVED_F = 0x0f,
}
enum CoreOpCode : 6 {
CORE_DEVICE_RESET = 0x00,
CORE_DEVICE_STATUS_NTF = 0x01,
CORE_DEVICE_INFO = 0x02,
CORE_GET_CAPS_INFO = 0x03,
CORE_SET_CONFIG = 0x04,
CORE_GET_CONFIG = 0x05,
CORE_DEVICE_SUSPEND = 0x06,
CORE_GENERIC_ERROR_NTF = 0x07,
CORE_QUERY_UWBS_TIMESTAMP = 0x08,
}
enum SessionConfigOpCode : 6 {
SESSION_INIT = 0x00,
SESSION_DEINIT = 0x01,
SESSION_STATUS_NTF = 0x02,
SESSION_SET_APP_CONFIG = 0x03,
SESSION_GET_APP_CONFIG = 0x04,
SESSION_GET_COUNT = 0x05,
SESSION_GET_STATE = 0x06,
SESSION_UPDATE_CONTROLLER_MULTICAST_LIST = 0x07,
SESSION_UPDATE_ACTIVE_ROUNDS_ANCHOR = 0x08,
SESSION_UPDATE_ACTIVE_ROUNDS_DT_TAG = 0x09,
SESSION_SET_INITIATOR_DT_ANCHOR_RR_RDM_LIST = 0x0a,
SESSION_QUERY_DATA_SIZE_IN_RANGING = 0x0b,
SESSION_SET_HUS_CONFIG = 0x0c,
}
enum SessionControlOpCode : 6 {
SESSION_START = 0x00,
SESSION_STOP = 0x01,
SESSION_RESERVED = 0x02,
SESSION_GET_RANGING_COUNT = 0x03,
SESSION_DATA_CREDIT_NTF = 0x04,
SESSION_DATA_TRANSFER_STATUS_NTF = 0x05,
}
enum AppDataOpCode : 6 {
APP_DATA_TX = 0x00,
APP_DATA_RX = 0x01,
}
// Android vendor commands
enum AndroidOpCode : 6 {
ANDROID_GET_POWER_STATS = 0x0,
ANDROID_SET_COUNTRY_CODE = 0x1,
ANDROID_FIRA_RANGE_DIAGNOSTICS = 0x2,
ANDROID_RADAR_SET_APP_CONFIG = 0x11,
ANDROID_RADAR_GET_APP_CONFIG = 0x12,
}
enum StatusCode : 8 {
// Generic Status Codes
UCI_STATUS_OK = 0x00,
UCI_STATUS_REJECTED = 0x01,
UCI_STATUS_FAILED = 0x02,
UCI_STATUS_SYNTAX_ERROR = 0x03,
UCI_STATUS_INVALID_PARAM = 0x04,
UCI_STATUS_INVALID_RANGE = 0x05,
UCI_STATUS_INVALID_MSG_SIZE = 0x06,
UCI_STATUS_UNKNOWN_GID = 0x07,
UCI_STATUS_UNKNOWN_OID = 0x08,
UCI_STATUS_READ_ONLY = 0x09,
UCI_STATUS_COMMAND_RETRY = 0x0A,
UCI_STATUS_UNKNOWN = 0x0B,
UCI_STATUS_NOT_APPLICABLE = 0x0C,
RFU_STATUS_CODE_RANGE_1 = 0x0D..0x10,
// UWB Session Specific Status Codes
UCI_STATUS_SESSION_NOT_EXIST = 0x11,
UCI_STATUS_SESSION_DUPLICATE = 0x12,
UCI_STATUS_SESSION_ACTIVE = 0x13,
UCI_STATUS_MAX_SESSIONS_EXCEEDED = 0x14,
UCI_STATUS_SESSION_NOT_CONFIGURED = 0x15,
UCI_STATUS_ACTIVE_SESSIONS_ONGOING = 0x16,
UCI_STATUS_MULTICAST_LIST_FULL = 0x17,
UCI_STATUS_ADDRESS_NOT_FOUND = 0x18,
UCI_STATUS_ADDRESS_ALREADY_PRESENT = 0x19,
UCI_STATUS_ERROR_UWB_INITIATION_TIME_TOO_OLD = 0x1A,
UCI_STATUS_OK_NEGATIVE_DISTANCE_REPORT = 0x1B,
RFU_STATUS_CODE_RANGE_2 = 0x1C..0x1F,
// UWB Ranging Session Specific Status Codes
UCI_STATUS_RANGING_TX_FAILED = 0x20,
UCI_STATUS_RANGING_RX_TIMEOUT = 0x21,
UCI_STATUS_RANGING_RX_PHY_DEC_FAILED = 0x22,
UCI_STATUS_RANGING_RX_PHY_TOA_FAILED = 0x23,
UCI_STATUS_RANGING_RX_PHY_STS_FAILED = 0x24,
UCI_STATUS_RANGING_RX_MAC_DEC_FAILED = 0x25,
UCI_STATUS_RANGING_RX_MAC_IE_DEC_FAILED = 0x26,
UCI_STATUS_RANGING_RX_MAC_IE_MISSING = 0x27,
UCI_STATUS_ERROR_ROUND_INDEX_NOT_ACTIVATED = 0x28,
UCI_STATUS_ERROR_NUMBER_OF_ACTIVE_RANGING_ROUNDS_EXCEEDED = 0x29,
UCI_STATUS_ERROR_DL_TDOA_DEVICE_ADDRESS_NOT_MATCHING_IN_REPLY_TIME_LIST = 0x2A,
RFU_STATUS_CODE_RANGE_3 = 0x2B..0x2F,
// UWB Data Session Specific Status Codes
UCI_STATUS_DATA_MAX_TX_PSDU_SIZE_EXCEEDED = 0x30,
UCI_STATUS_DATA_RX_CRC_ERROR = 0x31,
RFU_STATUS_CODE_RANGE_4 = 0x32..0x4F,
// Vendor Specific Status Codes
VENDOR_SPECIFIC_STATUS_CODE_RANGE_1 = 0x50..0xFE {
UCI_STATUS_ERROR_CCC_SE_BUSY = 0x50,
UCI_STATUS_ERROR_CCC_LIFECYCLE = 0x51,
UCI_STATUS_ERROR_STOPPED_DUE_TO_OTHER_SESSION_CONFLICT = 0x52,
UCI_STATUS_REGULATION_UWB_OFF = 0x53,
},
// For internal usage, we will use 0xFF as default.
VENDOR_SPECIFIC_STATUS_CODE_2 = 0xFF,
}
// This needs a separate StatusCode as the Status code values in the DATA_RCV packet have
// different values from the generic StatusCode above.
enum DataRcvStatusCode : 8 {
UCI_STATUS_SUCCESS = 0x00,
UCI_STATUS_ERROR = 0x01,
UCI_STATUS_UNKNOWN = 0x02,
}
enum CreditAvailability : 8 {
CREDIT_NOT_AVAILABLE = 0,
CREDIT_AVAILABLE = 1,
}
// The UCI spec defines these status codes for a DATA_TRANSFER_STATUS_NTF packet.
enum DataTransferNtfStatusCode : 8 {
UCI_DATA_TRANSFER_STATUS_REPETITION_OK = 0x00,
UCI_DATA_TRANSFER_STATUS_OK = 0x01,
UCI_DATA_TRANSFER_STATUS_ERROR_DATA_TRANSFER = 0x02,
UCI_DATA_TRANSFER_STATUS_ERROR_NO_CREDIT_AVAILABLE = 0x03,
UCI_DATA_TRANSFER_STATUS_ERROR_REJECTED = 0x04,
UCI_DATA_TRANSFER_STATUS_SESSION_TYPE_NOT_SUPPORTED = 0x05,
UCI_DATA_TRANSFER_STATUS_ERROR_DATA_TRANSFER_IS_ONGOING = 0x06,
UCI_DATA_TRANSFER_STATUS_INVALID_FORMAT = 0x07,
}
enum ResetConfig : 8 {
UWBS_RESET = 0x00,
}
enum DeviceConfigId : 8 {
DEVICE_STATE = 0x00,
LOW_POWER_MODE = 0x01,
}
enum AppConfigTlvType : 8 {
DEVICE_TYPE = 0x00,
RANGING_ROUND_USAGE = 0x01,
STS_CONFIG = 0x02,
MULTI_NODE_MODE = 0x03,
CHANNEL_NUMBER = 0x04,
NO_OF_CONTROLEE = 0x05,
DEVICE_MAC_ADDRESS = 0x06,
DST_MAC_ADDRESS = 0x07,
SLOT_DURATION = 0x08,
RANGING_DURATION = 0x09,
STS_INDEX = 0x0A,
MAC_FCS_TYPE = 0x0B,
RANGING_ROUND_CONTROL = 0x0C,
AOA_RESULT_REQ = 0x0D,
RNG_DATA_NTF = 0x0E,
RNG_DATA_NTF_PROXIMITY_NEAR = 0x0F,
RNG_DATA_NTF_PROXIMITY_FAR = 0x10,
DEVICE_ROLE = 0x11,
RFRAME_CONFIG = 0x12,
RSSI_REPORTING = 0x13,
PREAMBLE_CODE_INDEX = 0x14,
SFD_ID = 0x15,
PSDU_DATA_RATE = 0x16,
PREAMBLE_DURATION = 0x17,
LINK_LAYER_MODE = 0x18,
DATA_REPETITION_COUNT = 0x19,
RANGING_TIME_STRUCT = 0x1A,
SLOTS_PER_RR = 0x1B,
TX_ADAPTIVE_PAYLOAD_POWER = 0x1C,
// TODO: Ensure this value is correct in the final 2.0 specification.
RNG_DATA_NTF_AOA_BOUND = 0x1D,
RESPONDER_SLOT_INDEX = 0x1E,
PRF_MODE = 0x1F,
CAP_SIZE_RANGE = 0x20,
SCHEDULED_MODE = 0x22,
KEY_ROTATION = 0x23,
KEY_ROTATION_RATE = 0x24,
SESSION_PRIORITY = 0x25,
MAC_ADDRESS_MODE = 0x26,
VENDOR_ID = 0x27,
STATIC_STS_IV = 0x28,
NUMBER_OF_STS_SEGMENTS = 0x29,
MAX_RR_RETRY = 0x2A,
UWB_INITIATION_TIME = 0x2B,
HOPPING_MODE = 0x2C,
BLOCK_STRIDE_LENGTH = 0x2D,
RESULT_REPORT_CONFIG = 0x2E,
IN_BAND_TERMINATION_ATTEMPT_COUNT = 0x2F,
SUB_SESSION_ID = 0x30,
BPRF_PHR_DATA_RATE = 0x31,
MAX_NUMBER_OF_MEASUREMENTS = 0x32,
UL_TDOA_TX_INTERVAL = 0x33,
UL_TDOA_RANDOM_WINDOW = 0x34,
STS_LENGTH = 0x35,
SUSPEND_RANGING_ROUNDS = 0x36,
UL_TDOA_NTF_REPORT_CONFIG = 0x37,
UL_TDOA_DEVICE_ID = 0x38,
UL_TDOA_TX_TIMESTAMP = 0x39,
MIN_FRAMES_PER_RR = 0x3A,
MTU_SIZE = 0x3B,
INTER_FRAME_INTERVAL = 0x3C,
RFU_APP_CFG_TLV_TYPE_RANGE_1 = 0x3D..0x42,
DLTDOA_BLOCK_STRIDING = 0x43,
RFU_APP_CFG_TLV_TYPE_RANGE_2 = 0x44,
SESSION_KEY = 0x45,
SUBSESSION_KEY = 0x46,
SESSION_DATA_TRANSFER_STATUS_NTF_CONFIG = 0x47,
SESSION_TIME_BASE = 0x48,
RFU_APP_CFG_TLV_TYPE_RANGE_3 = 0x49..0x9F,
VENDOR_SPECIFIC_APP_CFG_TLV_TYPE_RANGE_1 = 0xA0..0xDF {
// CCC specific
CCC_HOP_MODE_KEY = 0xA0,
CCC_UWB_TIME0 = 0xA1,
CCC_RANGING_PROTOCOL_VER = 0xA3,
CCC_UWB_CONFIG_ID = 0xA4,
CCC_PULSESHAPE_COMBO = 0xA5,
CCC_URSK_TTL = 0xA6,
CCC_LAST_INDEX_USED = 0xA8,
},
// Reserved for extension IDs.
RFU_APP_CFG_TLV_TYPE_RANGE_4 = 0xE0..0xE2,
VENDOR_SPECIFIC_APP_CFG_TLV_TYPE_RANGE_2 = 0xE3..0xFF {
// Interleaving ratio if AOA_RESULT_REQ is set to 0xF0.
NB_OF_RANGE_MEASUREMENTS = 0xE3,
NB_OF_AZIMUTH_MEASUREMENTS = 0xE4,
NB_OF_ELEVATION_MEASUREMENTS = 0xE5,
ENABLE_DIAGNOSTICS = 0xE8,
DIAGRAMS_FRAME_REPORTS_FIELDS = 0xE9,
},
}
enum FrameReportTlvType : 8 {
RSSI = 0x0,
AOA = 0x1,
CIR = 0x2,
}
enum CapTlvType : 8 {
SUPPORTED_FIRA_PHY_VERSION_RANGE = 0x0,
SUPPORTED_FIRA_MAC_VERSION_RANGE = 0x1,
SUPPORTED_DEVICE_ROLES = 0x2,
SUPPORTED_RANGING_METHOD = 0x3,
SUPPORTED_STS_CONFIG = 0x4,
SUPPORTED_MULTI_NODE_MODES = 0x5,
SUPPORTED_RANGING_TIME_STRUCT = 0x6,
SUPPORTED_SCHEDULED_MODE = 0x7,
SUPPORTED_HOPPING_MODE = 0x8,
SUPPORTED_BLOCK_STRIDING = 0x9,
SUPPORTED_UWB_INITIATION_TIME = 0x0A,
SUPPORTED_CHANNELS = 0x0B,
SUPPORTED_RFRAME_CONFIG = 0x0C,
SUPPORTED_CC_CONSTRAINT_LENGTH = 0x0D,
SUPPORTED_BPRF_PARAMETER_SETS = 0x0E,
SUPPORTED_HPRF_PARAMETER_SETS = 0x0F,
SUPPORTED_AOA = 0x10,
SUPPORTED_EXTENDED_MAC_ADDRESS = 0x11,
SUPPORTED_MAX_MESSAGE_SIZE = 0x12,
SUPPORTED_MAX_DATA_PACKET_PAYLOAD_SIZE = 0x13,
RFU_CAP_TLV_TYPE_RANGE_1 = 0x14..0x9F,
VENDOR_SPECIFIC_CAP_TLV_TYPE_RANGE_1 = 0xA0..0xBF {
// CCC specific
CCC_SUPPORTED_CHAPS_PER_SLOT = 0xA0,
CCC_SUPPORTED_SYNC_CODES = 0xA1,
CCC_SUPPORTED_HOPPING_CONFIG_MODES_AND_SEQUENCES = 0xA2,
CCC_SUPPORTED_CHANNELS = 0xA3,
CCC_SUPPORTED_VERSIONS = 0xA4,
CCC_SUPPORTED_UWB_CONFIGS = 0xA5,
CCC_SUPPORTED_PULSE_SHAPE_COMBOS = 0xA6,
CCC_SUPPORTED_RAN_MULTIPLIER = 0xA7,
CCC_SUPPORTED_MAX_RANGING_SESSION_NUMBER = 0xA8,
// RADAR specific
RADAR_SUPPORT = 0xB0
},
SUPPORTED_POWER_STATS = 0xC0,
VENDOR_SPECIFIC_CAP_TLV_TYPE_RANGE_2 = 0xC1..0xDF,
RFU_CAP_TLV_TYPE_RANGE_2 = 0xE0..0xE2,
VENDOR_SPECIFIC_CAP_TLV_TYPE_RANGE_3 = 0xE3..0xFF {
SUPPORTED_AOA_RESULT_REQ_ANTENNA_INTERLEAVING = 0xE3,
SUPPORTED_MIN_RANGING_INTERVAL_MS = 0xE4,
SUPPORTED_RANGE_DATA_NTF_CONFIG = 0xE5,
SUPPORTED_RSSI_REPORTING = 0xE6,
SUPPORTED_DIAGNOSTICS = 0xE7,
SUPPORTED_MIN_SLOT_DURATION_RSTU = 0xE8,
SUPPORTED_MAX_RANGING_SESSION_NUMBER = 0xE9,
},
}
// AOA result request type.
// Values set for AOA_RESULT_REQ config ID.
enum AoaResultReqType : 8 {
AOA_DISABLE = 0x0,
AOA_ENABLE = 0x01,
AOA_ENABLE_AZIMUTH = 0x02,
AOA_ENABLE_ELEVATION = 0x03,
AOA_ENABLE_INTERLEAVED = 0xF0,
}
enum DeviceState : 8 {
DEVICE_STATE_READY = 0x01,
DEVICE_STATE_ACTIVE = 0x02,
DEVICE_STATE_ERROR = 0xff,
}
enum SessionState : 8 {
SESSION_STATE_INIT = 0x00,
SESSION_STATE_DEINIT = 0x01,
SESSION_STATE_ACTIVE = 0x02,
SESSION_STATE_IDLE = 0x03,
}
enum ReasonCode : 8 {
STATE_CHANGE_WITH_SESSION_MANAGEMENT_COMMANDS = 0x00,
MAX_RANGING_ROUND_RETRY_COUNT_REACHED = 0x01,
MAX_NUMBER_OF_MEASUREMENTS_REACHED = 0x02,
SESSION_SUSPENDED_DUE_TO_INBAND_SIGNAL = 0x03,
SESSION_RESUMED_DUE_TO_INBAND_SIGNAL = 0x04,
SESSION_STOPPED_DUE_TO_INBAND_SIGNAL = 0x05,
RFU_REASON_CODE_RANGE_1 = 0x06..0x1C,
ERROR_INVALID_UL_TDOA_RANDOM_WINDOW = 0x1D,
ERROR_MIN_RFRAMES_PER_RR_NOT_SUPPORTED = 0x1E,
ERROR_TX_DELAY_NOT_SUPPORTED = 0x1F,
ERROR_SLOT_LENGTH_NOT_SUPPORTED = 0x20,
ERROR_INSUFFICIENT_SLOTS_PER_RR = 0x21,
ERROR_MAC_ADDRESS_MODE_NOT_SUPPORTED = 0x22,
ERROR_INVALID_RANGING_DURATION = 0x23,
ERROR_INVALID_STS_CONFIG = 0x24,
ERROR_INVALID_RFRAME_CONFIG = 0x25,
ERROR_HUS_NOT_ENOUGH_SLOTS = 0x26,
ERROR_HUS_CFP_PHASE_TOO_SHORT = 0x27,
ERROR_HUS_CAP_PHASE_TOO_SHORT = 0x28,
ERROR_HUS_OTHERS = 0x29,
ERROR_STATUS_SESSION_KEY_NOT_FOUND = 0x2A,
ERROR_STATUS_SUB_SESSION_KEY_NOT_FOUND = 0x2B,
ERROR_INVALID_PREAMBLE_CODE_INDEX = 0x2C,
ERROR_INVALID_SFD_ID = 0x2D,
ERROR_INVALID_PSDU_DATA_RATE = 0x2E,
ERROR_INVALID_PHR_DATA_RATE = 0x2F,
ERROR_INVALID_PREAMBLE_DURATION = 0x30,
ERROR_INVALID_STS_LENGTH = 0x31,
ERROR_INVALID_NUM_OF_STS_SEGMENTS = 0x32,
ERROR_INVALID_NUM_OF_CONTROLEES = 0x33,
ERROR_MAX_RANGING_REPLY_TIME_EXCEEDED = 0x34,
ERROR_INVALID_DST_ADDRESS_LIST = 0x35,
ERROR_INVALID_OR_NOT_FOUND_SUB_SESSION_ID = 0x36,
ERROR_INVALID_RESULT_REPORT_CONFIG = 0x37,
ERROR_INVALID_RANGING_ROUND_CONTROL_CONFIG = 0x38,
ERROR_INVALID_RANGING_ROUND_USAGE = 0x39,
ERROR_INVALID_MULTI_NODE_MODE = 0x3A,
ERROR_RDS_FETCH_FAILURE = 0x3B,
ERROR_REF_UWB_SESSION_DOES_NOT_EXIST = 0x3C,
ERROR_REF_UWB_SESSION_RANGING_DURATION_MISMATCH = 0x3D,
ERROR_REF_UWB_SESSION_INVALID_OFFSET_TIME = 0x3E,
ERROR_REF_UWB_SESSION_LOST = 0x3F,
RFU_REASON_CODE_RANGE_2 = 0x40..0x7F {
ERROR_DT_ANCHOR_RANGING_ROUNDS_NOT_CONFIGURED = 0x40,
ERROR_DT_TAG_RANGING_ROUNDS_NOT_CONFIGURED = 0x41,
},
VENDOR_SPECIFIC_REASON_CODE_RANGE_1 = 0x80..0xFE {
ERROR_INVALID_CHANNEL_WITH_AOA = 0x80,
ERROR_STOPPED_DUE_TO_OTHER_SESSION_CONFLICT = 0x81,
},
// For internal usage, we will use 0xFF as default.
VENDOR_SPECIFIC_REASON_CODE_2 = 0xFF,
}
enum MulticastUpdateStatusCode : 8 {
STATUS_OK_MULTICAST_LIST_UPDATE = 0x00,
STATUS_ERROR_MULTICAST_LIST_FULL = 0x01,
STATUS_ERROR_KEY_FETCH_FAIL = 0x02,
STATUS_ERROR_SUB_SESSION_ID_NOT_FOUND = 0x03,
STATUS_ERROR_SUB_SESSION_KEY_NOT_FOUND = 0x04,
STATUS_ERROR_SUB_SESSION_KEY_NOT_APPLICABLE = 0x05,
STATUS_ERROR_SESSION_KEY_NOT_FOUND = 0x06,
STATUS_ERROR_ADDRESS_NOT_FOUND = 0x07,
STATUS_ERROR_ADDRESS_ALREADY_PRESENT = 0x08,
RFU_STATUS_CODE_RANGE_1 = 0x09..0xFF,
}
enum MacAddressIndicator : 8 {
SHORT_ADDRESS = 0x00,
EXTENDED_ADDRESS = 0x01,
}
enum SessionType: 8 {
FIRA_RANGING_SESSION = 0x00,
FIRA_RANGING_AND_IN_BAND_DATA_SESSION = 0x01,
FIRA_DATA_TRANSFER_SESSION = 0x02,
FIRA_RANGING_ONLY_PHASE = 0x03,
FIRA_IN_BAND_DATA_PHASE = 0x04,
FIRA_RANGING_WITH_DATA_PHASE = 0x05,
CCC = 0xA0,
RADAR_SESSION = 0xA1,
DEVICE_TEST_MODE = 0xD0,
}
enum MessageType: 3 {
DATA = 0x00,
COMMAND = 0x01,
RESPONSE = 0x02,
NOTIFICATION = 0x03,
RESERVED_FOR_TESTING_1 = 0x04,
RESERVED_FOR_TESTING_2 = 0x05,
}
// UCI packet description in compliance with the FIRA UCI spec.
// Only this packet should be sent/expected across the HAL interface.
packet UciPacketHal {
group_id_or_data_packet_format: GroupIdOrDataPacketFormat,
packet_boundary_flag: PacketBoundaryFlag,
message_type: MessageType,
_body_
}
// The UciDataPacketHal must be declared before the UciControlPacketHal for correct parsing to
// happen. This is required as the Data packet specifies a value for the 'message_type' constraint,
// while the Control packet does not (as it encompasses multiple 'message_type' values).
packet UciDataPacketHal: UciPacketHal (message_type = DATA) {
_reserved_: 8,
_size_(_payload_): 16,
_payload_,
}
packet UciControlPacketHal: UciPacketHal {
opcode: 6,
_reserved_: 2,
_reserved_: 8,
_size_(_payload_): 8,
_payload_,
}
// This control packet definition is used throughout the stack that holds a complete
// (i.e unfragmented) UCI command/response/notification.
//
// UciControlPacket needs to be converted to one or more UciControlPacketHal fragments before
// sending to the HAL. One or more UciControlPacketHal fragments needs to be converted to
// UciControlPacket when receiving from the HAL.
//
// TODO(b/202760099): Handle fragmentation more cleanly in the PDL.
packet UciControlPacket {
group_id: GroupId,
// This field is different from |UciControlPacketHal| to provide a placeholder for PBF flag.
_reserved_: 1,
message_type: MessageType,
opcode: 6,
_reserved_: 2,
_reserved_: 8,
// This field is different from |UciControlPacketHal| to allow holding a large unfragmented
// packet.
_size_(_payload_): 32,
_payload_,
}
// This data packet definition is used throughout the stack that holds a complete
// (i.e unfragmented) UCI data packet.
//
// UciDataPacket needs to be converted to one or more UciDataPacketHal fragments before sending to
// the HAL. One or more UciDataPacketHal fragments needs to be converted to UciDataPacket when
// receiving from the HAL.
//
// TODO(b/202760099): Handle fragmentation more cleanly in the PDL.
packet UciDataPacket {
data_packet_format: DataPacketFormat,
// This field is different from |UciDataPacketHal| to provide a placeholder for PBF flag.
_reserved_: 1,
message_type: MessageType,
_reserved_: 8,
// This field is different from |UciDataPacketHal| to allow holding large unfragmented packet.
_size_(_payload_): 32,
_payload_,
}
packet UciDataSnd : UciDataPacket (data_packet_format = DATA_SND, message_type = DATA) {
session_token: 32, // Session ID or Session Handle (based on UWBS version)
dest_mac_address: 64,
uci_sequence_number: 16,
_size_(data): 16,
data: 8[]
}
packet UciDataRcv : UciDataPacket (data_packet_format = DATA_RCV, message_type = DATA) {
session_token: 32, // Session ID or Session Handle (based on UWBS version)
status: StatusCode,
source_mac_address: 64,
uci_sequence_number: 16,
_size_(data): 16,
data: 8[]
}
packet UciCommand : UciControlPacket (message_type = COMMAND) {
_payload_,
}
packet UciResponse : UciControlPacket (message_type = RESPONSE) {
_payload_,
}
packet UciNotification : UciControlPacket (message_type = NOTIFICATION) {
_payload_,
}
packet CoreCommand : UciCommand (group_id = CORE) {
_body_,
}
packet CoreResponse : UciResponse (group_id = CORE) {
_body_,
}
packet CoreNotification : UciNotification (group_id = CORE) {
_body_,
}
packet SessionConfigCommand : UciCommand (group_id = SESSION_CONFIG) {
_body_,
}
packet SessionConfigResponse : UciResponse (group_id = SESSION_CONFIG) {
_body_,
}
packet SessionConfigNotification : UciNotification (group_id = SESSION_CONFIG) {
_body_,
}
packet SessionControlCommand : UciCommand (group_id = SESSION_CONTROL) {
_body_,
}
packet SessionControlResponse : UciResponse (group_id = SESSION_CONTROL) {
_body_,
}
packet SessionControlNotification : UciNotification (group_id = SESSION_CONTROL) {
_body_,
}
packet AndroidCommand : UciCommand (group_id = VENDOR_ANDROID) {
_body_,
}
packet AndroidResponse : UciResponse (group_id = VENDOR_ANDROID) {
_body_,
}
packet AndroidNotification : UciNotification (group_id = VENDOR_ANDROID) {
_body_,
}
// TODO: b/202760099: Use the correspnding opcode enum instead of the raw value in the |opcode| field.
packet DeviceResetCmd : CoreCommand (opcode = 0x0) { //CORE_DEVICE_RESET
reset_config: ResetConfig,
}
test DeviceResetCmd {
"\x20\x00\x00\x01\x00\x00\x00\x00",
}
packet DeviceResetRsp : CoreResponse (opcode = 0x0) { //CORE_DEVICE_RESET
status: StatusCode,
}
test DeviceResetRsp {
"\x40\x00\x00\x01\x00\x00\x00\x00",
}
packet DeviceStatusNtf : CoreNotification (opcode = 0x1) { //CORE_DEVICE_STATUS_NTF
device_state: DeviceState,
}
test DeviceStatusNtf {
"\x60\x01\x00\x01\x00\x00\x00\x01",
}
packet GetDeviceInfoCmd : CoreCommand (opcode = 0x2) { //CORE_DEVICE_INFO
}
test GetDeviceInfoCmd {
"\x20\x02\x00\x00\x00\x00\x00",
}
packet GetDeviceInfoRsp : CoreResponse (opcode = 0x2) { //CORE_DEVICE_INFO
status: StatusCode,
uci_version: 16,
mac_version: 16,
phy_version: 16,
uci_test_version: 16,
_count_(vendor_spec_info): 8,
vendor_spec_info: 8[],
}
test GetDeviceInfoRsp {
"\x40\x02\x00\x0b\x00\x00\x00\x01\x01\x00\x02\x00\x03\x00\x04\x00\x01\x0a",
}
packet GetCapsInfoCmd : CoreCommand (opcode = 0x3) { //CORE_GET_CAPS_INFO
}
test GetCapsInfoCmd {
"\x20\x03\x00\x00\x00\x00\x00",
}
struct CapTlv {
t: CapTlvType,
_count_(v): 8,
v: 8[],
}
packet GetCapsInfoRsp : CoreResponse (opcode = 0x3) { //CORE_GET_CAPS_INFO
status: StatusCode,
_count_(tlvs): 8,
tlvs: CapTlv[],
}
test GetCapsInfoRsp {
"\x40\x03\x00\x05\x00\x00\x00\x00\x01\x00\x01\x01",
}
struct DeviceConfigTlv {
cfg_id: DeviceConfigId,
_count_(v): 8,
v: 8[],
}
packet SetConfigCmd : CoreCommand (opcode = 0x4) { //CORE_SET_CONFIG
_count_(tlvs): 8,
tlvs: DeviceConfigTlv[],
}
test SetConfigCmd {
"\x20\x04\x00\x03\x00\x00\x00\x01\x01\x00",
}
struct DeviceConfigStatus {
cfg_id: DeviceConfigId,
status: StatusCode,
}
packet SetConfigRsp : CoreResponse (opcode = 0x4) { //CORE_SET_CONFIG
status: StatusCode,
_count_(cfg_status): 8,
cfg_status: DeviceConfigStatus[],
}
test SetConfigRsp {
"\x40\x04\x00\x04\x00\x00\x00\x01\x01\x01\x01",
"\x40\x04\x00\x04\x00\x00\x00\x01\x01\x01\x0B",
}
packet GetConfigCmd : CoreCommand (opcode = 0x5) { //CORE_GET_CONFIG
_count_(cfg_id): 8,
cfg_id: 8[], // DeviceConfigId (Infra does not allow array of enums)
}
test GetConfigCmd {
"\x20\x05\x00\x02\x00\x00\x00\x01\x01",
}
packet GetConfigRsp : CoreResponse (opcode = 0x5) { //CORE_GET_CONFIG
status: StatusCode,
_count_(tlvs): 8,
tlvs: DeviceConfigTlv[]
}
test GetConfigRsp {
"\x40\x05\x00\x05\x00\x00\x00\x01\x01\x00\x01\x01",
}
packet GenericError : CoreNotification (opcode = 0x7) { //CORE_GENERIC_ERROR_NTF
status: StatusCode,
}
test GenericError {
"\x60\x07\x00\x01\x00\x00\x00\x01",
}
packet CoreQueryTimeStampCmd : CoreCommand (opcode = 0x8) { //CORE_QUERY_UWBS_TIMESTAMP
}
test CoreQueryTimeStampCmd {
"\x20\x08\x00\\x00",
}
packet CoreQueryTimeStampRsp : CoreResponse (opcode = 0x8) { //CORE_QUERY_UWBS_TIMESTAMP
status: StatusCode,
timeStamp: 64,
}
test CoreQueryTimeStampRsp {
"\x40\x08\x00\x09\x00\x00\x00\x01\x01\x00\x01\x01\x01",
}
packet SessionInitCmd : SessionConfigCommand (opcode = 0x0) { //SESSION_INIT
session_id: 32,
session_type: SessionType,
}
test SessionInitCmd {
"\x21\x00\x00\x05\x00\x00\x00\x01\x02\x03\x04\x01",
}
// FIRA version 2 introduces a new version of SESSION_INIT_RSP which
// includes UWBS generated session handle.
packet SessionInitRsp_V2 : SessionConfigResponse (opcode = 0x0) { //SESSION_INIT
status: StatusCode,
session_handle: 32,
}
test SessionInitRsp_V2 {
"\x41\x00\x00\x01\x00\x00\x00\x11\x00\x00\x00\x01",
}
packet SessionInitRsp : SessionConfigResponse (opcode = 0x0) { //SESSION_INIT
status: StatusCode,
}
test SessionInitRsp {
"\x41\x00\x00\x01\x00\x00\x00\x11",
}
packet SessionDeinitCmd : SessionConfigCommand (opcode = 0x1) { //SESSION_DEINIT
session_token: 32, // Session ID or Session Handle (based on UWBS version)
}
test SessionDeinitCmd {
"\x21\x01\x00\x04\x00\x00\x00\x01\x02\x03\x04",
}
packet SessionDeinitRsp : SessionConfigResponse (opcode = 0x1) { //SESSION_DEINIT
status: StatusCode,
}
test SessionDeinitRsp {
"\x41\x01\x00\x01\x00\x00\x00\x00",
}
packet SessionStatusNtf : SessionConfigNotification (opcode = 0x2) { //SESSION_STATUS_NTF
session_token: 32, // Session ID or Session Handle (based on UWBS version)
session_state: SessionState,
// TODO(b/272775225): Switch back to the enum type ReasonCode, once PDL supports defining a
// range inside an enum (for the vendor-specific space), in b/267339120.
reason_code: 8,
}
test SessionStatusNtf {
"\x61\x02\x00\x06\x00\x00\x00\x01\x02\x03\x04\x02\x21",
"\x61\x02\x00\x06\x00\x00\x00\x01\x02\x03\x04\x01\x82", // Vendor Specific Reason Code
}
struct AppConfigTlv {
cfg_id: AppConfigTlvType,
_count_(v): 8,
v: 8[],
}
packet SessionSetAppConfigCmd : SessionConfigCommand (opcode = 0x3) { //SESSION_SET_APP_CONFIG
session_token: 32, // Session ID or Session Handle (based on UWBS version)
_count_(tlvs): 8,
tlvs: AppConfigTlv[]
}
test SessionSetAppConfigCmd {
"\x21\x03\x00\x05\x00\x00\x00\x01\x02\x03\x04\x00",
}
struct AppConfigStatus {
cfg_id: AppConfigTlvType,
status: StatusCode,
}
packet SessionSetAppConfigRsp : SessionConfigResponse (opcode = 0x3) { //SESSION_SET_APP_CONFIG
status: StatusCode,
_count_(cfg_status): 8,
cfg_status: AppConfigStatus[],
}
test SessionSetAppConfigRsp {
"\x41\x03\x00\x04\x00\x00\x00\x01\x01\x01\x00",
}
packet SessionGetAppConfigCmd : SessionConfigCommand (opcode = 0x4) { //SESSION_GET_APP_CONFIG
session_token: 32, // Session ID or Session Handle (based on UWBS version)
_count_(app_cfg): 8,
app_cfg: 8[], // AppConfigTlvType (Infra does not allow array of enums)
}
test SessionGetAppConfigCmd {
"\x21\x04\x00\x05\x00\x00\x00\x01\x02\x03\x04\x00",
}
packet SessionGetAppConfigRsp : SessionConfigResponse (opcode = 0x4) { //SESSION_GET_APP_CONFIG
status: StatusCode,
_count_(tlvs): 8,
tlvs: AppConfigTlv[],
}
test SessionGetAppConfigRsp {
"\x41\x04\x00\x02\x00\x00\x00\x01\x00",
}
packet SessionGetCountCmd : SessionConfigCommand (opcode = 0x5) { //SESSION_GET_COUNT
}
test SessionGetCountCmd {
"\x21\x05\x00\x00\x00\x00\x00",
}
packet SessionGetCountRsp : SessionConfigResponse (opcode = 0x5) { //SESSION_GET_COUNT
status: StatusCode,
session_count: 8,
}
test SessionGetCountRsp {
"\x41\x05\x00\x02\x00\x00\x00\x00\x01",
}
packet SessionGetStateCmd : SessionConfigCommand (opcode = 0x6) { //SESSION_GET_STATE
session_token: 32, // Session ID or Session Handle (based on UWBS version)
}
test SessionGetStateCmd {
"\x21\x06\x00\x04\x00\x00\x00\x00\x01\x02\x03",
}
packet SessionGetStateRsp : SessionConfigResponse (opcode = 0x6) { //SESSION_GET_STATE
status: StatusCode,
session_state: SessionState,
}
test SessionGetStateRsp {
"\x41\x06\x00\x02\x00\x00\x00\x00\x01",
}
packet SessionUpdateDtTagRangingRoundsCmd : SessionConfigCommand (opcode = 0x9) { //SESSION_UPDATE_ACTIVE_ROUNDS_DT_TAG
session_token: 32, // Session ID or Session Handle (based on UWBS version)
_count_(ranging_round_indexes): 8,
ranging_round_indexes: 8[],
}
test SessionUpdateDtTagRangingRoundsCmd {
"\x21\x09\x00\x0a\x00\x00\x00\x03\x03\x0f\x0c\x05\x08\x00\x00\x00\x00",
}
packet SessionUpdateDtTagRangingRoundsRsp : SessionConfigResponse (opcode = 0x9) { //SESSION_UPDATE_ACTIVE_ROUNDS_DT_TAG
status: StatusCode,
_count_(ranging_round_indexes): 8,
ranging_round_indexes: 8[],
}
test SessionUpdateDtTagRangingRoundsRsp {
"\x41\x09\x00\x03\x00\x00\x00\x01\x01\x01",
}
struct Controlee {
short_address: 8[2],
subsession_id: 32,
}
struct Controlee_V2_0_16_Byte_Version {
short_address: 8[2],
subsession_id: 32,
subsession_key: 8[16],
}
struct Controlee_V2_0_32_Byte_Version {
short_address: 8[2],
subsession_id: 32,
subsession_key: 8[32],
}
enum UpdateMulticastListAction: 8 {
ADD_CONTROLEE = 0x00,
REMOVE_CONTROLEE = 0x01,
ADD_CONTROLEE_WITH_SHORT_SUB_SESSION_KEY = 0x02,
ADD_CONTROLEE_WITH_LONG_SUB_SESSION_KEY = 0x03,
}
packet SessionUpdateControllerMulticastListCmd : SessionConfigCommand (opcode = 0x7) { //SESSION_UPDATE_CONTROLLER_MULTICAST_LIST
session_token: 32, // Session ID or Session Handle (based on UWBS version)
action: UpdateMulticastListAction,
_payload_,
}
struct PhaseList {
session_token: 32,
start_slot_index: 16,
end_slot_index: 16,
}
packet SessionSetHybridConfigCmd : SessionConfigCommand (opcode = 0x0c) { //SESSION_SET_HUS_CONFIG
session_token: 32,
number_of_phases: 8,
update_time: 8[8],
phase_list: PhaseList[],
}
packet SessionSetHybridConfigRsp : SessionConfigResponse (opcode = 0x0c) { //SESSION_SET_HUS_CONFIG
status: StatusCode,
}
struct SessionUpdateControllerMulticastListCmdPayload {
_count_(controlees): 8,
controlees: Controlee[],
}
struct SessionUpdateControllerMulticastListCmd_2_0_16_Byte_Payload {
_count_(controlees): 8,
controlees: Controlee_V2_0_16_Byte_Version[],
}
struct SessionUpdateControllerMulticastListCmd_2_0_32_Byte_Payload {
_count_(controlees): 8,
controlees: Controlee_V2_0_32_Byte_Version[],
}
packet SessionUpdateControllerMulticastListRsp : SessionConfigResponse (opcode = 0x7) { //SESSION_UPDATE_CONTROLLER_MULTICAST_LIST
status: StatusCode,
}
test SessionUpdateControllerMulticastListRsp {
"\x41\x07\x00\x01\x00\x00\x00\x00",
}
struct ControleeStatus {
mac_address: 8[2],
subsession_id: 32,
status: MulticastUpdateStatusCode,
}
packet SessionUpdateControllerMulticastListNtf : SessionConfigNotification (opcode = 0x7) { //SESSION_UPDATE_CONTROLLER_MULTICAST_LIST
session_token: 32, // Session ID or Session Handle (based on UWBS version)
remaining_multicast_list_size: 8,
_count_(controlee_status): 8,
controlee_status: ControleeStatus[],
}
test SessionUpdateControllerMulticastListNtf {
"\x61\x07\x00\x06\x00\x00\x00\x00\x01\x02\x03\x04\x00",
}
packet DataCreditNtf : SessionControlNotification (opcode = 0x04) { // SESSION_DATA_CREDIT_NTF
session_token: 32, // Session ID or Session Handle (based on UWBS version)
credit_availability: CreditAvailability,
}
test DataCreditNtf {
"\x62\x04\x00\x05\x00\x00\x00\x00\x00\x00\x01\x01",
}
packet DataTransferStatusNtf : SessionControlNotification (opcode = 0x05) { // SESSION_DATA_TRANSFER_STATUS_NTF
session_token: 32, // Session ID or Session Handle (based on UWBS version)
uci_sequence_number: 16,
status: DataTransferNtfStatusCode,
tx_count: 8,
}
test DataTransferStatusNtf {
"\x62\x05\x00\x06\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00",
}
packet SessionQueryMaxDataSizeCmd : SessionConfigCommand (opcode = 0xB) { //QUERY_MAX_DATA_SIZE
session_token: 32, // Session ID or Session Handle (based on UWBS version)
}
test SessionQueryMaxDataSizeCmd {
"\x21\x0B\x00\x04\x00\x00\x00\x00",
}
packet SessionQueryMaxDataSizeRsp : SessionConfigResponse (opcode = 0xB) { //QUER_MAX_DATA_SIZE
session_token: 32, // Session ID or Session Handle (based on UWBS version)
status: StatusCode,
max_data_size: 16,
}
test SessionQueryMaxDataSizeRsp {
"\x41\x0B\x00\x06\x00\x00\x00\x00\x00\x0E7\0x07",
}
packet SessionStartCmd : SessionControlCommand (opcode = 0x0) { //RANGE_START
session_token: 32, // Session ID or Session Handle (based on UWBS version)
}
test SessionStartCmd {
"\x22\x00\x00\x04\x00\x00\x00\x00\x01\x02\x03",
}
packet SessionStartRsp : SessionControlResponse (opcode = 0x0) { //RANGE_START
status: StatusCode,
}
test SessionStartRsp {
"\x42\x00\x00\x01\x00\x00\x00\x00",
}
struct ShortAddressTwoWayRangingMeasurement {
mac_address: 16,
status: StatusCode,
nlos: 8,
distance: 16,
aoa_azimuth: 16,
aoa_azimuth_fom: 8,
aoa_elevation: 16,
aoa_elevation_fom: 8,
aoa_destination_azimuth: 16,
aoa_destination_azimuth_fom: 8,
aoa_destination_elevation: 16,
aoa_destination_elevation_fom: 8,
slot_index: 8,
rssi: 8,
// b/272301550: The pdl compiler cannot handle individual fields
// larger than 64 bit. The work around is to split the 88 bit
// field into two.
_reserved_: 64,
_reserved_: 24,
}
struct ExtendedAddressTwoWayRangingMeasurement {
mac_address: 64,
status: StatusCode,
nlos: 8,
distance: 16,
aoa_azimuth: 16,
aoa_azimuth_fom: 8,
aoa_elevation: 16,
aoa_elevation_fom: 8,
aoa_destination_azimuth: 16,
aoa_destination_azimuth_fom: 8,
aoa_destination_elevation: 16,
aoa_destination_elevation_fom: 8,
slot_index: 8,
rssi: 8,
_reserved_: 40,
}
struct ShortAddressOwrAoaRangingMeasurement {
mac_address: 16,
status: StatusCode,
nlos: 8,
frame_sequence_number: 8,
block_index: 16,
aoa_azimuth: 16,
aoa_azimuth_fom: 8,
aoa_elevation: 16,
aoa_elevation_fom: 8,
}
struct ExtendedAddressOwrAoaRangingMeasurement {
mac_address: 64,
status: StatusCode,
nlos: 8,
frame_sequence_number: 8,
block_index: 16,
aoa_azimuth: 16,
aoa_azimuth_fom: 8,
aoa_elevation: 16,
aoa_elevation_fom: 8,
}
enum RangingMeasurementType : 8 {
ONE_WAY = 0x0,
TWO_WAY = 0x1,
DL_TDOA = 0x02,
OWR_AOA = 0x03,
}
packet SessionInfoNtf : SessionControlNotification (opcode = 0x0) { // SESSION_INFO
sequence_number: 32,
session_token: 32, // Session ID or Session Handle (based on UWBS version)
rcr_indicator: 8,
current_ranging_interval: 32,
ranging_measurement_type: RangingMeasurementType,
_reserved_: 8,
mac_address_indicator: MacAddressIndicator,
_reserved_: 64,
_body_,
}
packet ShortMacTwoWaySessionInfoNtf : SessionInfoNtf (ranging_measurement_type = TWO_WAY, mac_address_indicator = SHORT_ADDRESS) {
_count_(two_way_ranging_measurements) : 8,
two_way_ranging_measurements : ShortAddressTwoWayRangingMeasurement[],
vendor_data: 8[],
}
test ShortMacTwoWaySessionInfoNtf {
"\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",
}
packet ExtendedMacTwoWaySessionInfoNtf : SessionInfoNtf (ranging_measurement_type = TWO_WAY, mac_address_indicator = EXTENDED_ADDRESS) {
_count_(two_way_ranging_measurements) : 8,
two_way_ranging_measurements : ExtendedAddressTwoWayRangingMeasurement[],
vendor_data: 8[],
}
test ExtendedMacTwoWaySessionInfoNtf {
"\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",
}
packet ShortMacDlTDoASessionInfoNtf : SessionInfoNtf (ranging_measurement_type = DL_TDOA, mac_address_indicator = SHORT_ADDRESS) {
no_of_ranging_measurements : 8,
dl_tdoa_measurements : 8[],
}
test ShortMacDlTDoASessionInfoNtf {
"\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",
}
packet ExtendedMacDlTDoASessionInfoNtf : SessionInfoNtf (ranging_measurement_type = DL_TDOA, mac_address_indicator = EXTENDED_ADDRESS) {
no_of_ranging_measurements : 8,
dl_tdoa_measurements : 8[],
}
test ExtendedMacDlTDoASessionInfoNtf {
"\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",
}
packet ShortMacOwrAoaSessionInfoNtf : SessionInfoNtf (ranging_measurement_type = OWR_AOA, mac_address_indicator = SHORT_ADDRESS) {
_count_(owr_aoa_ranging_measurements) : 8,
owr_aoa_ranging_measurements : ShortAddressOwrAoaRangingMeasurement[],
vendor_data: 8[],
}
test ShortMacOwrAoaSessionInfoNtf {
"\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",
"\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",
}
packet ExtendedMacOwrAoaSessionInfoNtf : SessionInfoNtf (ranging_measurement_type = OWR_AOA, mac_address_indicator = EXTENDED_ADDRESS) {
_count_(owr_aoa_ranging_measurements) : 8,
owr_aoa_ranging_measurements : ExtendedAddressOwrAoaRangingMeasurement[],
vendor_data: 8[],
}
test ExtendedMacOwrAoaSessionInfoNtf {
"\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",
"\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",
}
packet SessionStopCmd : SessionControlCommand (opcode = 0x1) { // SESSION_STOP
session_token: 32, // Session ID or Session Handle (based on UWBS version)
}
test SessionStopCmd {
"\x22\x01\x00\x04\x00\x00\x00\x00\x02\x03\x04",
}
packet SessionStopRsp : SessionControlResponse (opcode = 0x1) { // SESSION_STOP
status: StatusCode,
}
test SessionStopRsp {
"\x42\x01\x00\x01\x00\x00\x00\x00",
}
packet SessionGetRangingCountCmd : SessionControlCommand (opcode = 0x3) { // SESSION_GET_RANGING_COUNT
session_token: 32, // Session ID or Session Handle (based on UWBS version)
}
test SessionGetRangingCountCmd {
"\x22\x03\x00\x04\x00\x00\x00\x00\x02\x03\x04",
}
packet SessionGetRangingCountRsp : SessionControlResponse (opcode = 0x3) { // SESSION_GET_RANGING_COUNT
status: StatusCode,
count: 32,
}
test SessionGetRangingCountRsp {
"\x42\x03\x00\x05\x00\x00\x00\x00\x02\x03\x04\x05",
}
packet AndroidGetPowerStatsCmd: AndroidCommand (opcode = 0x0) { //ANDROID_GET_POWER_STATS
}
test AndroidGetPowerStatsCmd {
"\x2c\x00\x00\x00\x00\x00\x00",
}
struct PowerStats {
status: StatusCode,
idle_time_ms: 32,
tx_time_ms: 32,
rx_time_ms: 32,
total_wake_count:32,
}
packet AndroidGetPowerStatsRsp : AndroidResponse (opcode = 0x0) { //ANDROID_GET_POWER_STATS
stats: PowerStats,
}
test AndroidGetPowerStatsRsp {
"\x4c\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
}
packet AndroidSetCountryCodeCmd: AndroidCommand (opcode = 0x1) { //ANDROID_SET_COUNTRY_CODE
country_code : 8[2],
}
// Set country code to US.
test AndroidSetCountryCodeCmd {
"\x2c\x01\x00\x02\x00\x00\x00\x55\x53",
}
packet AndroidSetCountryCodeRsp : AndroidResponse (opcode = 0x1) { //ANDROID_SET_COUNTRY_CODE
status: StatusCode,
}
test AndroidSetCountryCodeRsp {
"\x4c\x01\x00\x01\x00\x00\x00\x00",
}
struct FrameReportTlv {
t: FrameReportTlvType,
_size_(v): 16,
v: 8[],
}
packet FrameReportTlvPacket {
t: FrameReportTlvType,
_size_(_body_): 16,
_body_,
}
packet Rssi : FrameReportTlvPacket (t = RSSI) {
rssi: 8[],
}
struct AoaMeasurement {
tdoa: 16,
pdoa: 16,
aoa: 16,
fom: 8,
t: 8,
}
packet Aoa : FrameReportTlvPacket (t = AOA) {
aoa: AoaMeasurement[],
}
test Aoa {
"\x01\x08\x00\x00\x01\x00\x01\x00\x01\x01\x01",
}
struct CirValue {
first_path_index : 16,
first_path_snr: 16,
first_path_ns: 16,
peak_path_index: 16,
peak_path_snr: 16,
peak_path_ns: 16,
first_path_sample_offset: 8,
samples_number: 8,
_size_(sample_window): 16,
sample_window: 8[],
}
packet Cir : FrameReportTlvPacket (t = CIR) {
_count_(cir_value): 8,
cir_value: CirValue[],
}
test Cir {
"\x02\x15\x00\x01\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x00\x02\x04\x00\x01\x02\x03\x04",
}
struct FrameReport {
uwb_msg_id: 8,
action: 8,
antenna_set: 8,
_count_(frame_report_tlvs): 8,
frame_report_tlvs: FrameReportTlv[],
}
packet AndroidRangeDiagnosticsNtf : AndroidNotification (opcode = 0x2) { //FIRA_RANGE_DIAGNOSTICS
session_token: 32, // Session ID or Session Handle (based on UWBS version)
sequence_number: 32,
_count_(frame_reports): 8,
frame_reports: FrameReport[],
}
test AndroidRangeDiagnosticsNtf {
"\x6c\x02\x00\x11\x00\x00\x00\x01\x01\x01\x01\x02\x02\x02\x02\x01\x00\x01\x02\x01\x00\x01\x00\x00",
"\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",
}
packet UciVendor_9_Response : UciResponse (group_id = VENDOR_RESERVED_9) {
_payload_,
}
packet UciVendor_A_Response : UciResponse (group_id = VENDOR_RESERVED_A) {
_payload_,
}
packet UciVendor_B_Response : UciResponse (group_id = VENDOR_RESERVED_B) {
_payload_,
}
packet UciVendor_E_Response : UciResponse (group_id = VENDOR_RESERVED_E) {
_payload_,
}
packet UciVendor_F_Response : UciResponse (group_id = VENDOR_RESERVED_F) {
_payload_,
}
packet UciVendor_9_Notification : UciNotification (group_id = VENDOR_RESERVED_9) {
_payload_,
}
packet UciVendor_A_Notification : UciNotification (group_id = VENDOR_RESERVED_A) {
_payload_,
}
packet UciVendor_B_Notification : UciNotification (group_id = VENDOR_RESERVED_B) {
_payload_,
}
packet UciVendor_E_Notification : UciNotification (group_id = VENDOR_RESERVED_E) {
_payload_,
}
packet UciVendor_F_Notification : UciNotification (group_id = VENDOR_RESERVED_F) {
_payload_,
}
packet TestNotification : UciNotification (group_id = TEST) {
_payload_,
}
enum RadarDataType : 8 {
RADAR_SWEEP_SAMPLES = 0x00,
}
enum RadarConfigTlvType : 8 {
RADAR_TIMING_PARAMS = 0x00,
SAMPLES_PER_SWEEP = 0x01,
CHANNEL_NUMBER = 0x02,
SWEEP_OFFSET = 0x03,
RFRAME_CONFIG = 0x04,
PREAMBLE_DURATION = 0x05,
PREAMBLE_CODE_INDEX = 0x06,
SESSION_PRIORITY = 0x07,
BITS_PER_SAMPLE = 0x08,
PRF_MODE = 0x09,
NUMBER_OF_BURSTS = 0x0A,
RADAR_DATA_TYPE = 0x0B,
RFU_RADAR_APP_CFG_TLV_TYPE_RANGE = 0x0C..0x9F,
VENDOR_SPECIFIC_RADAR_APP_CFG_TLV_TYPE_RANGE = 0xA0..0xDF,
}
struct RadarConfigTlv {
cfg_id: RadarConfigTlvType,
_count_(v): 8,
v: 8[],
}
struct RadarConfigStatus {
cfg_id: RadarConfigTlvType,
status: StatusCode,
}
packet AndroidSetRadarConfigCmd: AndroidCommand (opcode = 0x11) {
session_token: 32,
_count_(tlvs): 8,
tlvs: RadarConfigTlv[]
}
packet AndroidSetRadarConfigRsp : AndroidResponse (opcode = 0x11) {
status: StatusCode,
_count_(cfg_status): 8,
cfg_status: RadarConfigStatus[],
}
packet AndroidGetRadarConfigCmd: AndroidCommand (opcode = 0x12) {
session_token: 32,
_count_(tlvs): 8,
tlvs: 8[], // RadarConfigTlvType (Infra does not allow array of enums)
}
packet AndroidGetRadarConfigRsp : AndroidResponse (opcode = 0x12) {
status: StatusCode,
_count_(tlvs): 8,
tlvs: RadarConfigTlv[],
}
enum BitsPerSample : 8 {
VALUE_32 = 0x00,
VALUE_48 = 0x01,
VALUE_64 = 0x02
}
struct RadarSweepDataRaw {
sequence_number: 32,
timestamp: 32,
_count_(vendor_specific_data): 8,
vendor_specific_data: 8[],
sample_data: 8[],
}
packet RadarDataRcv : UciDataPacket (data_packet_format = RADAR_DATA_MESSAGE, message_type = DATA) {
session_handle: 32,
status: DataRcvStatusCode,
radar_data_type: RadarDataType,
number_of_sweeps: 8,
samples_per_sweep: 8,
bits_per_sample: BitsPerSample,
sweep_offset: 16,
sweep_data_size: 16,
sweep_data: 8[],
}