little_endian_packets custom_field Address : 48 "hci/" custom_field ClassOfDevice : 24 "hci/" enum Enable : 8 { DISABLED = 0x00, ENABLED = 0x01, } // https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile enum GapDataType : 8 { INVALID = 0x00, FLAGS = 0x01, INCOMPLETE_LIST_16_BIT_UUIDS = 0x02, COMPLETE_LIST_16_BIT_UUIDS = 0x03, INCOMPLETE_LIST_32_BIT_UUIDS = 0x04, COMPLETE_LIST_32_BIT_UUIDS = 0x05, INCOMPLETE_LIST_128_BIT_UUIDS = 0x06, COMPLETE_LIST_128_BIT_UUIDS = 0x07, SHORTENED_LOCAL_NAME = 0x08, COMPLETE_LOCAL_NAME = 0x09, TX_POWER_LEVEL = 0x0A, CLASS_OF_DEVICE = 0x0D, SERVICE_DATA_16_BIT_UUIDS = 0x16, APPEARANCE = 0x19, SERVICE_DATA_32_BIT_UUIDS = 0x20, SERVICE_DATA_128_BIT_UUIDS = 0x21, MANUFACTURER_SPECIFIC_DATA = 0xFF, } struct GapData { _size_(data) : 8, // Including one byte for data_type data_type : GapDataType, data : 8[+1*8], } // HCI ACL Packets enum PacketBoundaryFlag : 2 { FIRST_NON_AUTOMATICALLY_FLUSHABLE = 0, CONTINUING_FRAGMENT = 1, FIRST_AUTOMATICALLY_FLUSHABLE = 2, } enum BroadcastFlag : 2 { POINT_TO_POINT = 0, ACTIVE_SLAVE_BROADCAST = 1, } packet AclPacket { handle : 12, packet_boundary_flag : PacketBoundaryFlag, broadcast_flag : BroadcastFlag, _size_(_payload_) : 16, _payload_, } // HCI SCO Packets enum PacketStatusFlag : 2 { CORRECTLY_RECEIVED = 0, POSSIBLY_INCOMPLETE = 1, NO_DATA = 2, PARTIALLY_LOST = 3, } packet ScoPacket { handle : 12, packet_status_flag : PacketStatusFlag, _reserved_ : 2, // BroadcastFlag _size_(data) : 8, data : 8[], } // HCI Command Packets enum OpCode : 16 { NONE = 0x0000, // LINK_CONTROL INQUIRY = 0x0401, INQUIRY_CANCEL = 0x0402, PERIODIC_INQUIRY_MODE = 0x0403, EXIT_PERIODIC_INQUIRY_MODE = 0x0404, CREATE_CONNECTION = 0x0405, DISCONNECT = 0x0406, CREATE_CONNECTION_CANCEL = 0x0408, ACCEPT_CONNECTION_REQUEST = 0x0409, REJECT_CONNECTION_REQUEST = 0x040A, LINK_KEY_REQUEST_REPLY = 0x040B, LINK_KEY_REQUEST_NEGATIVE_REPLY = 0x040C, PIN_CODE_REQUEST_REPLY = 0x040D, PIN_CODE_REQUEST_NEGATIVE_REPLY = 0x040E, CHANGE_CONNECTION_PACKET_TYPE = 0x040F, AUTHENTICATION_REQUESTED = 0x0411, SET_CONNECTION_ENCRYPTION = 0x0413, CHANGE_CONNECTION_LINK_KEY = 0x0415, MASTER_LINK_KEY = 0x0417, REMOTE_NAME_REQUEST = 0x0419, REMOTE_NAME_REQUEST_CANCEL = 0x041A, READ_REMOTE_SUPPORTED_FEATURES = 0x041B, READ_REMOTE_EXTENDED_FEATURES = 0x041C, READ_REMOTE_VERSION_INFORMATION = 0x041D, READ_CLOCK_OFFSET = 0x041F, READ_LMP_HANDLE = 0x0420, SETUP_SYNCHRONOUS_CONNECTION = 0x0428, ACCEPT_SYNCHRONOUS_CONNECTION = 0x0429, REJECT_SYNCHRONOUS_CONNECTION = 0x042A, IO_CAPABILITY_REQUEST_REPLY = 0x042B, USER_CONFIRMATION_REQUEST_REPLY = 0x042C, USER_CONFIRMATION_REQUEST_NEGATIVE_REPLY = 0x042D, USER_PASSKEY_REQUEST_REPLY = 0x042E, USER_PASSKEY_REQUEST_NEGATIVE_REPLY = 0x042F, REMOTE_OOB_DATA_REQUEST_REPLY = 0x0430, REMOTE_OOB_DATA_REQUEST_NEGATIVE_REPLY = 0x0433, IO_CAPABILITY_REQUEST_NEGATIVE_REPLY = 0x0434, ENHANCED_SETUP_SYNCHRONOUS_CONNECTION = 0x043D, ENHANCED_ACCEPT_SYNCHRONOUS_CONNECTION = 0x043E, // LINK_POLICY HOLD_MODE = 0x0801, SNIFF_MODE = 0x0803, EXIT_SNIFF_MODE = 0x0804, QOS_SETUP = 0x0807, ROLE_DISCOVERY = 0x0809, SWITCH_ROLE = 0x080B, READ_LINK_POLICY_SETTINGS = 0x080C, WRITE_LINK_POLICY_SETTINGS = 0x080D, READ_DEFAULT_LINK_POLICY_SETTINGS = 0x080E, WRITE_DEFAULT_LINK_POLICY_SETTINGS = 0x080F, FLOW_SPECIFICATION = 0x0810, SNIFF_SUBRATING = 0x0811, // CONTROLLER_AND_BASEBAND SET_EVENT_MASK = 0x0C01, RESET = 0x0C03, SET_EVENT_FILTER = 0x0C05, FLUSH = 0x0C08, READ_PIN_TYPE = 0x0C09, WRITE_PIN_TYPE = 0x0C0A, CREATE_NEW_UNIT_KEY = 0x0C0B, READ_STORED_LINK_KEY = 0x0C0D, WRITE_STORED_LINK_KEY = 0x0C11, DELETE_STORED_LINK_KEY = 0x0C12, WRITE_LOCAL_NAME = 0x0C13, READ_LOCAL_NAME = 0x0C14, READ_CONNECTION_ACCEPT_TIMEOUT = 0x0C15, WRITE_CONNECTION_ACCEPT_TIMEOUT = 0x0C16, READ_PAGE_TIMEOUT = 0x0C17, WRITE_PAGE_TIMEOUT = 0x0C18, READ_SCAN_ENABLE = 0x0C19, WRITE_SCAN_ENABLE = 0x0C1A, READ_PAGE_SCAN_ACTIVITY = 0x0C1B, WRITE_PAGE_SCAN_ACTIVITY = 0x0C1C, READ_INQUIRY_SCAN_ACTIVITY = 0x0C1D, WRITE_INQUIRY_SCAN_ACTIVITY = 0x0C1E, READ_AUTHENTICATION_ENABLE = 0x0C1F, WRITE_AUTHENTICATION_ENABLE = 0x0C20, READ_CLASS_OF_DEVICE = 0x0C23, WRITE_CLASS_OF_DEVICE = 0x0C24, READ_VOICE_SETTING = 0x0C25, WRITE_VOICE_SETTING = 0x0C26, READ_AUTOMATIC_FLUSH_TIMEOUT = 0x0C27, WRITE_AUTOMATIC_FLUSH_TIMEOUT = 0x0C28, READ_NUM_BROADCAST_RETRANSMITS = 0x0C29, WRITE_NUM_BROADCAST_RETRANSMITS = 0x0C2A, READ_HOLD_MODE_ACTIVITY = 0x0C2B, WRITE_HOLD_MODE_ACTIVITY = 0x0C2C, READ_TRANSMIT_POWER_LEVEL = 0x0C2D, READ_SYNCHRONOUS_FLOW_CONTROL_ENABLE = 0x0C2E, WRITE_SYNCHRONOUS_FLOW_CONTROL_ENABLE = 0x0C2F, SET_CONTROLLER_TO_HOST_FLOW_CONTROL = 0x0C31, HOST_BUFFER_SIZE = 0x0C33, HOST_NUM_COMPLETED_PACKETS = 0x0C35, READ_LINK_SUPERVISION_TIMEOUT = 0x0C36, WRITE_LINK_SUPERVISION_TIMEOUT = 0x0C37, READ_NUMBER_OF_SUPPORTED_IAC = 0x0C38, READ_CURRENT_IAC_LAP = 0x0C39, WRITE_CURRENT_IAC_LAP = 0x0C3A, SET_AFH_HOST_CHANNEL_CLASSIFICATION = 0x0C3F, READ_INQUIRY_SCAN_TYPE = 0x0C42, WRITE_INQUIRY_SCAN_TYPE = 0x0C43, READ_INQUIRY_MODE = 0x0C44, WRITE_INQUIRY_MODE = 0x0C45, READ_PAGE_SCAN_TYPE = 0x0C46, WRITE_PAGE_SCAN_TYPE = 0x0C47, READ_AFH_CHANNEL_ASSESSMENT_MODE = 0x0C48, WRITE_AFH_CHANNEL_ASSESSMENT_MODE = 0x0C49, READ_EXTENDED_INQUIRY_RESPONSE = 0x0C51, WRITE_EXTENDED_INQUIRY_RESPONSE = 0x0C52, REFRESH_ENCRYPTION_KEY = 0x0C53, READ_SIMPLE_PAIRING_MODE = 0x0C55, WRITE_SIMPLE_PAIRING_MODE = 0x0C56, READ_LOCAL_OOB_DATA = 0x0C57, READ_INQUIRY_RESPONSE_TRANSMIT_POWER_LEVEL = 0x0C58, WRITE_INQUIRY_TRANSMIT_POWER_LEVEL = 0x0C59, SEND_KEYPRESS_NOTIFICATION = 0x0C60, READ_LE_HOST_SUPPORT = 0x0C6C, WRITE_LE_HOST_SUPPORT = 0x0C6D, READ_SECURE_CONNECTIONS_HOST_SUPPORT = 0x0C79, WRITE_SECURE_CONNECTIONS_HOST_SUPPORT = 0x0C7A, READ_LOCAL_OOB_EXTENDED_DATA = 0x0C7D, // INFORMATIONAL_PARAMETERS READ_LOCAL_VERSION_INFORMATION = 0x1001, READ_LOCAL_SUPPORTED_COMMANDS = 0x1002, READ_LOCAL_SUPPORTED_FEATURES = 0x1003, READ_LOCAL_EXTENDED_FEATURES = 0x1004, READ_BUFFER_SIZE = 0x1005, READ_BD_ADDR = 0x1009, READ_DATA_BLOCK_SIZE = 0x100A, READ_LOCAL_SUPPORTED_CODECS = 0x100B, // STATUS_PARAMETERS READ_FAILED_CONTACT_COUNTER = 0x1401, RESET_FAILED_CONTACT_COUNTER = 0x1402, READ_LINK_QUALITY = 0x1403, READ_RSSI = 0x1405, READ_AFH_CHANNEL_MAP = 0x1406, READ_CLOCK = 0x1407, READ_ENCRYPTION_KEY_SIZE = 0x1408, // TESTING READ_LOOPBACK_MODE = 0x1801, WRITE_LOOPBACK_MODE = 0x1802, ENABLE_DEVICE_UNDER_TEST_MODE = 0x1803, WRITE_SIMPLE_PAIRING_DEBUG_MODE = 0x1804, WRITE_SECURE_CONNECTIONS_TEST_MODE = 0x180A, // LE_CONTROLLER LE_SET_EVENT_MASK = 0x2001, LE_READ_BUFFER_SIZE = 0x2002, LE_READ_LOCAL_SUPPORTED_FEATURES = 0x2003, LE_SET_RANDOM_ADDRESS = 0x2005, LE_SET_ADVERTISING_PARAMETERS = 0x2006, LE_READ_ADVERTISING_CHANNEL_TX_POWER = 0x2007, LE_SET_ADVERTISING_DATA = 0x2008, LE_SET_SCAN_RESPONSE_DATA = 0x2009, LE_SET_ADVERTISING_ENABLE = 0x200A, LE_SET_SCAN_PARAMETERS = 0x200B, LE_SET_SCAN_ENABLE = 0x200C, LE_CREATE_CONNECTION = 0x200D, LE_CREATE_CONNECTION_CANCEL = 0x200E, LE_READ_WHITE_LIST_SIZE = 0x200F, LE_CLEAR_WHITE_LIST = 0x2010, LE_ADD_DEVICE_TO_WHITE_LIST = 0x2011, LE_REMOVE_DEVICE_FROM_WHITE_LIST = 0x2012, LE_CONNECTION_UPDATE = 0x2013, LE_SET_HOST_CHANNEL_CLASSIFICATION = 0x2014, LE_READ_CHANNEL_MAP = 0x2015, LE_READ_REMOTE_FEATURES = 0x2016, LE_ENCRYPT = 0x2017, LE_RAND = 0x2018, LE_START_ENCRYPTION = 0x2019, LE_LONG_TERM_KEY_REQUEST_REPLY = 0x201A, LE_LONG_TERM_KEY_REQUEST_NEGATIVE_REPLY = 0x201B, LE_READ_SUPPORTED_STATES = 0x201C, LE_RECEIVER_TEST = 0x201D, LE_TRANSMITTER_TEST = 0x201E, LE_TEST_END = 0x201F, LE_REMOTE_CONNECTION_PARAMETER_REQUEST_REPLY = 0x2020, LE_REMOTE_CONNECTION_PARAMETER_REQUEST_NEGATIVE_REPLY = 0x2021, LE_SET_DATA_LENGTH = 0x2022, LE_READ_SUGGESTED_DEFAULT_DATA_LENGTH = 0x2023, LE_WRITE_SUGGESTED_DEFAULT_DATA_LENGTH = 0x2024, LE_READ_LOCAL_P_256_PUBLIC_KEY_COMMAND = 0x2025, LE_GENERATE_DHKEY_COMMAND_V1 = 0x2026, LE_ADD_DEVICE_TO_RESOLVING_LIST = 0x2027, LE_REMOVE_DEVICE_FROM_RESOLVING_LIST = 0x2028, LE_CLEAR_RESOLVING_LIST = 0x2029, LE_READ_RESOLVING_LIST_SIZE = 0x202A, LE_READ_PEER_RESOLVABLE_ADDRESS = 0x202B, LE_READ_LOCAL_RESOLVABLE_ADDRESS = 0x202C, LE_SET_ADDRESS_RESOLUTION_ENABLE = 0x202D, LE_SET_RESOLVABLE_PRIVATE_ADDRESS_TIMEOUT = 0x202E, LE_READ_MAXIMUM_DATA_LENGTH = 0x202F, LE_READ_PHY = 0x2030, LE_SET_DEFAULT_PHY = 0x2031, LE_SET_PHY = 0x2032, LE_ENHANCED_RECEIVER_TEST = 0x2033, LE_ENHANCED_TRANSMITTER_TEST = 0x2034, LE_SET_EXTENDED_ADVERTISING_RANDOM_ADDRESS = 0x2035, LE_SET_EXTENDED_ADVERTISING_PARAMETERS = 0x2036, LE_SET_EXTENDED_ADVERTISING_DATA = 0x2037, LE_SET_EXTENDED_ADVERTISING_SCAN_RESPONSE = 0x2038, LE_SET_EXTENDED_ADVERTISING_ENABLE = 0x2039, LE_READ_MAXIMUM_ADVERTISING_DATA_LENGTH = 0x203A, LE_READ_NUMBER_OF_SUPPORTED_ADVERTISING_SETS = 0x203B, LE_REMOVE_ADVERTISING_SET = 0x203C, LE_CLEAR_ADVERTISING_SETS = 0x203D, LE_SET_PERIODIC_ADVERTISING_PARAM = 0x203E, LE_SET_PERIODIC_ADVERTISING_DATA = 0x203F, LE_SET_PERIODIC_ADVERTISING_ENABLE = 0x2040, LE_SET_EXTENDED_SCAN_PARAMETERS = 0x2041, LE_SET_EXTENDED_SCAN_ENABLE = 0x2042, LE_EXTENDED_CREATE_CONNECTION = 0x2043, LE_PERIODIC_ADVERTISING_CREATE_SYNC = 0x2044, LE_PERIODIC_ADVERTISING_CREATE_SYNC_CANCEL = 0x2045, LE_PERIODIC_ADVERTISING_TERMINATE_SYNC = 0x2046, LE_ADD_DEVICE_TO_PERIODIC_ADVERTISING_LIST = 0x2047, LE_REMOVE_DEVICE_FROM_PERIODIC_ADVERTISING_LIST = 0x2048, LE_CLEAR_PERIODIC_ADVERTISING_LIST = 0x2049, LE_READ_PERIODIC_ADVERTISING_LIST_SIZE = 0x204A, LE_READ_TRANSMIT_POWER = 0x204B, LE_READ_RF_PATH_COMPENSATION_POWER = 0x204C, LE_WRITE_RF_PATH_COMPENSATION_POWER = 0x204D, LE_SET_PRIVACY_MODE = 0x204E, LE_GENERATE_DHKEY_COMMAND = 0x205E, // VENDOR_SPECIFIC LE_GET_VENDOR_CAPABILITIES = 0xFD53, LE_MULTI_ADVT = 0xFD54, LE_BATCH_SCAN = 0xFD56, LE_ADV_FILTER = 0xFD57, LE_TRACK_ADV = 0xFD58, LE_ENERGY_INFO = 0xFD59, LE_EXTENDED_SCAN_PARAMS = 0xFD5A, CONTROLLER_DEBUG_INFO = 0xFD5B, CONTROLLER_A2DP_OPCODE = 0xFD5D, CONTROLLER_BQR = 0xFD5E, } // For mapping Local Supported Commands command // Value = Octet * 10 + bit enum OpCodeIndex : 16 { INQUIRY = 0, INQUIRY_CANCEL = 1, PERIODIC_INQUIRY_MODE = 2, EXIT_PERIODIC_INQUIRY_MODE = 3, CREATE_CONNECTION = 4, DISCONNECT = 5, CREATE_CONNECTION_CANCEL = 7, ACCEPT_CONNECTION_REQUEST = 10, REJECT_CONNECTION_REQUEST = 11, LINK_KEY_REQUEST_REPLY = 12, LINK_KEY_REQUEST_NEGATIVE_REPLY = 13, PIN_CODE_REQUEST_REPLY = 14, PIN_CODE_REQUEST_NEGATIVE_REPLY = 15, CHANGE_CONNECTION_PACKET_TYPE = 16, AUTHENTICATION_REQUESTED = 17, SET_CONNECTION_ENCRYPTION = 20, CHANGE_CONNECTION_LINK_KEY = 21, MASTER_LINK_KEY = 22, REMOTE_NAME_REQUEST = 23, REMOTE_NAME_REQUEST_CANCEL = 24, READ_REMOTE_SUPPORTED_FEATURES = 25, READ_REMOTE_EXTENDED_FEATURES = 26, READ_REMOTE_VERSION_INFORMATION = 27, READ_CLOCK_OFFSET = 30, READ_LMP_HANDLE = 31, HOLD_MODE = 41, SNIFF_MODE = 42, EXIT_SNIFF_MODE = 43, QOS_SETUP = 46, ROLE_DISCOVERY = 47, SWITCH_ROLE = 50, READ_LINK_POLICY_SETTINGS = 51, WRITE_LINK_POLICY_SETTINGS = 52, READ_DEFAULT_LINK_POLICY_SETTINGS = 53, WRITE_DEFAULT_LINK_POLICY_SETTINGS = 54, FLOW_SPECIFICATION = 55, SET_EVENT_MASK = 56, RESET = 57, SET_EVENT_FILTER = 60, FLUSH = 61, READ_PIN_TYPE = 62, WRITE_PIN_TYPE = 63, READ_STORED_LINK_KEY = 65, WRITE_STORED_LINK_KEY = 66, DELETE_STORED_LINK_KEY = 67, WRITE_LOCAL_NAME = 70, READ_LOCAL_NAME = 71, READ_CONNECTION_ACCEPT_TIMEOUT = 72, WRITE_CONNECTION_ACCEPT_TIMEOUT = 73, READ_PAGE_TIMEOUT = 74, WRITE_PAGE_TIMEOUT = 75, READ_SCAN_ENABLE = 76, WRITE_SCAN_ENABLE = 77, READ_PAGE_SCAN_ACTIVITY = 80, WRITE_PAGE_SCAN_ACTIVITY = 81, READ_INQUIRY_SCAN_ACTIVITY = 82, WRITE_INQUIRY_SCAN_ACTIVITY = 83, READ_AUTHENTICATION_ENABLE = 84, WRITE_AUTHENTICATION_ENABLE = 85, READ_CLASS_OF_DEVICE = 90, WRITE_CLASS_OF_DEVICE = 91, READ_VOICE_SETTING = 92, WRITE_VOICE_SETTING = 93, READ_AUTOMATIC_FLUSH_TIMEOUT = 94, WRITE_AUTOMATIC_FLUSH_TIMEOUT = 95, READ_NUM_BROADCAST_RETRANSMITS = 96, WRITE_NUM_BROADCAST_RETRANSMITS = 97, READ_HOLD_MODE_ACTIVITY = 100, WRITE_HOLD_MODE_ACTIVITY = 101, READ_TRANSMIT_POWER_LEVEL = 102, READ_SYNCHRONOUS_FLOW_CONTROL_ENABLE = 103, WRITE_SYNCHRONOUS_FLOW_CONTROL_ENABLE = 104, SET_CONTROLLER_TO_HOST_FLOW_CONTROL = 105, HOST_BUFFER_SIZE = 106, HOST_NUM_COMPLETED_PACKETS = 107, READ_LINK_SUPERVISION_TIMEOUT = 110, WRITE_LINK_SUPERVISION_TIMEOUT = 111, READ_NUMBER_OF_SUPPORTED_IAC = 112, READ_CURRENT_IAC_LAP = 113, WRITE_CURRENT_IAC_LAP = 114, SET_AFH_HOST_CHANNEL_CLASSIFICATION = 121, READ_INQUIRY_SCAN_TYPE = 124, WRITE_INQUIRY_SCAN_TYPE = 125, READ_INQUIRY_MODE = 126, WRITE_INQUIRY_MODE = 127, READ_PAGE_SCAN_TYPE = 130, WRITE_PAGE_SCAN_TYPE = 131, READ_AFH_CHANNEL_ASSESSMENT_MODE = 132, WRITE_AFH_CHANNEL_ASSESSMENT_MODE = 133, READ_LOCAL_VERSION_INFORMATION = 143, READ_LOCAL_SUPPORTED_FEATURES = 145, READ_LOCAL_EXTENDED_FEATURES = 146, READ_BUFFER_SIZE = 147, READ_BD_ADDR = 151, READ_FAILED_CONTACT_COUNTER = 152, RESET_FAILED_CONTACT_COUNTER = 153, READ_LINK_QUALITY = 154, READ_RSSI = 155, READ_AFH_CHANNEL_MAP = 156, READ_CLOCK = 157, READ_LOOPBACK_MODE = 160, WRITE_LOOPBACK_MODE = 161, ENABLE_DEVICE_UNDER_TEST_MODE = 162, SETUP_SYNCHRONOUS_CONNECTION = 163, ACCEPT_SYNCHRONOUS_CONNECTION = 164, REJECT_SYNCHRONOUS_CONNECTION = 165, READ_EXTENDED_INQUIRY_RESPONSE = 170, WRITE_EXTENDED_INQUIRY_RESPONSE = 171, REFRESH_ENCRYPTION_KEY = 172, SNIFF_SUBRATING = 174, READ_SIMPLE_PAIRING_MODE = 175, WRITE_SIMPLE_PAIRING_MODE = 176, READ_LOCAL_OOB_DATA = 177, READ_INQUIRY_RESPONSE_TRANSMIT_POWER_LEVEL = 180, WRITE_INQUIRY_TRANSMIT_POWER_LEVEL = 181, IO_CAPABILITY_REQUEST_REPLY = 187, USER_CONFIRMATION_REQUEST_REPLY = 190, USER_CONFIRMATION_REQUEST_NEGATIVE_REPLY = 191, USER_PASSKEY_REQUEST_REPLY = 192, USER_PASSKEY_REQUEST_NEGATIVE_REPLY = 193, REMOTE_OOB_DATA_REQUEST_REPLY = 194, WRITE_SIMPLE_PAIRING_DEBUG_MODE = 195, REMOTE_OOB_DATA_REQUEST_NEGATIVE_REPLY = 197, SEND_KEYPRESS_NOTIFICATION = 202, IO_CAPABILITY_REQUEST_NEGATIVE_REPLY = 203, READ_ENCRYPTION_KEY_SIZE = 204, READ_DATA_BLOCK_SIZE = 232, READ_LE_HOST_SUPPORT = 245, WRITE_LE_HOST_SUPPORT = 246, LE_SET_EVENT_MASK = 250, LE_READ_BUFFER_SIZE = 251, LE_READ_LOCAL_SUPPORTED_FEATURES = 252, LE_SET_RANDOM_ADDRESS = 254, LE_SET_ADVERTISING_PARAMETERS = 255, LE_READ_ADVERTISING_CHANNEL_TX_POWER = 256, LE_SET_ADVERTISING_DATA = 257, LE_SET_SCAN_RESPONSE_DATA = 260, LE_SET_ADVERTISING_ENABLE = 261, LE_SET_SCAN_PARAMETERS = 262, LE_SET_SCAN_ENABLE = 263, LE_CREATE_CONNECTION = 264, LE_CREATE_CONNECTION_CANCEL = 265, LE_READ_WHITE_LIST_SIZE = 266, LE_CLEAR_WHITE_LIST = 267, LE_ADD_DEVICE_TO_WHITE_LIST = 270, LE_REMOVE_DEVICE_FROM_WHITE_LIST = 271, LE_CONNECTION_UPDATE = 272, LE_SET_HOST_CHANNEL_CLASSIFICATION = 273, LE_READ_CHANNEL_MAP = 274, LE_READ_REMOTE_FEATURES = 275, LE_ENCRYPT = 276, LE_RAND = 277, LE_START_ENCRYPTION = 280, LE_LONG_TERM_KEY_REQUEST_REPLY = 281, LE_LONG_TERM_KEY_REQUEST_NEGATIVE_REPLY = 282, LE_READ_SUPPORTED_STATES = 283, LE_RECEIVER_TEST = 284, LE_TRANSMITTER_TEST = 285, LE_TEST_END = 286, ENHANCED_SETUP_SYNCHRONOUS_CONNECTION = 293, ENHANCED_ACCEPT_SYNCHRONOUS_CONNECTION = 294, READ_LOCAL_SUPPORTED_CODECS = 295, READ_SECURE_CONNECTIONS_HOST_SUPPORT = 322, WRITE_SECURE_CONNECTIONS_HOST_SUPPORT = 323, READ_LOCAL_OOB_EXTENDED_DATA = 326, WRITE_SECURE_CONNECTIONS_TEST_MODE = 327, LE_REMOTE_CONNECTION_PARAMETER_REQUEST_REPLY = 334, LE_REMOTE_CONNECTION_PARAMETER_REQUEST_NEGATIVE_REPLY = 335, LE_SET_DATA_LENGTH = 336, LE_READ_SUGGESTED_DEFAULT_DATA_LENGTH = 337, LE_WRITE_SUGGESTED_DEFAULT_DATA_LENGTH = 340, LE_READ_LOCAL_P_256_PUBLIC_KEY_COMMAND = 341, LE_GENERATE_DHKEY_COMMAND_V1 = 342, LE_ADD_DEVICE_TO_RESOLVING_LIST = 343, LE_REMOVE_DEVICE_FROM_RESOLVING_LIST = 344, LE_CLEAR_RESOLVING_LIST = 345, LE_READ_RESOLVING_LIST_SIZE = 346, LE_READ_PEER_RESOLVABLE_ADDRESS = 347, LE_READ_LOCAL_RESOLVABLE_ADDRESS = 350, LE_SET_ADDRESS_RESOLUTION_ENABLE = 351, LE_SET_RESOLVABLE_PRIVATE_ADDRESS_TIMEOUT = 352, LE_READ_MAXIMUM_DATA_LENGTH = 353, LE_READ_PHY = 354, LE_SET_DEFAULT_PHY = 355, LE_SET_PHY = 356, LE_ENHANCED_RECEIVER_TEST = 357, LE_ENHANCED_TRANSMITTER_TEST = 360, LE_SET_EXTENDED_ADVERTISING_RANDOM_ADDRESS = 361, LE_SET_EXTENDED_ADVERTISING_PARAMETERS = 362, LE_SET_EXTENDED_ADVERTISING_DATA = 363, LE_SET_EXTENDED_ADVERTISING_SCAN_RESPONSE = 364, LE_SET_EXTENDED_ADVERTISING_ENABLE = 365, LE_READ_MAXIMUM_ADVERTISING_DATA_LENGTH = 366, LE_READ_NUMBER_OF_SUPPORTED_ADVERTISING_SETS = 367, LE_REMOVE_ADVERTISING_SET = 370, LE_CLEAR_ADVERTISING_SETS = 371, LE_SET_PERIODIC_ADVERTISING_PARAM = 372, LE_SET_PERIODIC_ADVERTISING_DATA = 373, LE_SET_PERIODIC_ADVERTISING_ENABLE = 374, LE_SET_EXTENDED_SCAN_PARAMETERS = 375, LE_SET_EXTENDED_SCAN_ENABLE = 376, LE_EXTENDED_CREATE_CONNECTION = 377, LE_PERIODIC_ADVERTISING_CREATE_SYNC = 380, LE_PERIODIC_ADVERTISING_CREATE_SYNC_CANCEL = 381, LE_PERIODIC_ADVERTISING_TERMINATE_SYNC = 382, LE_ADD_DEVICE_TO_PERIODIC_ADVERTISING_LIST = 383, LE_REMOVE_DEVICE_FROM_PERIODIC_ADVERTISING_LIST = 384, LE_CLEAR_PERIODIC_ADVERTISING_LIST = 385, LE_READ_PERIODIC_ADVERTISING_LIST_SIZE = 386, LE_READ_TRANSMIT_POWER = 387, LE_READ_RF_PATH_COMPENSATION_POWER = 390, LE_WRITE_RF_PATH_COMPENSATION_POWER = 391, LE_SET_PRIVACY_MODE = 392, LE_GENERATE_DHKEY_COMMAND = 412, } packet CommandPacket { op_code : OpCode, _size_(_payload_) : 8, _payload_, } // Packets for interfaces packet DiscoveryCommand : CommandPacket { _payload_, } packet ConnectionManagementCommand : CommandPacket { _payload_, } packet SecurityCommand : CommandPacket { _payload_, } packet ScoConnectionCommand : CommandPacket { _payload_, } packet LeAdvertisingCommand : CommandPacket { _payload_, } packet LeScanningCommand : CommandPacket { _payload_, } packet LeConnectionManagementCommand : CommandPacket { _payload_, } packet LeSecurityCommand : CommandPacket { _payload_, } packet VendorCommand : CommandPacket { _payload_, } // HCI Event Packets enum EventCode : 8 { INQUIRY_COMPLETE = 0x01, INQUIRY_RESULT = 0x02, CONNECTION_COMPLETE = 0x03, CONNECTION_REQUEST = 0x04, DISCONNECTION_COMPLETE = 0x05, AUTHENTICATION_COMPLETE = 0x06, REMOTE_NAME_REQUEST_COMPLETE = 0x07, ENCRYPTION_CHANGE = 0x08, CHANGE_CONNECTION_LINK_KEY_COMPLETE = 0x09, MASTER_LINK_KEY_COMPLETE = 0x0A, READ_REMOTE_SUPPORTED_FEATURES_COMPLETE = 0x0B, READ_REMOTE_VERSION_INFORMATION_COMPLETE = 0x0C, QOS_SETUP_COMPLETE = 0x0D, COMMAND_COMPLETE = 0x0E, COMMAND_STATUS = 0x0F, HARDWARE_ERROR = 0x10, FLUSH_OCCURRED = 0x11, ROLE_CHANGE = 0x12, NUMBER_OF_COMPLETED_PACKETS = 0x13, MODE_CHANGE = 0x14, RETURN_LINK_KEYS = 0x15, PIN_CODE_REQUEST = 0x16, LINK_KEY_REQUEST = 0x17, LINK_KEY_NOTIFICATION = 0x18, LOOPBACK_COMMAND = 0x19, DATA_BUFFER_OVERFLOW = 0x1A, MAX_SLOTS_CHANGE = 0x1B, READ_CLOCK_OFFSET_COMPLETE = 0x1C, CONNECTION_PACKET_TYPE_CHANGED = 0x1D, QOS_VIOLATION = 0x1E, PAGE_SCAN_REPETITION_MODE_CHANGE = 0x20, FLOW_SPECIFICATION_COMPLETE = 0x21, INQUIRY_RESULT_WITH_RSSI = 0x22, READ_REMOTE_EXTENDED_FEATURES_COMPLETE = 0x23, SYNCHRONOUS_CONNECTION_COMPLETE = 0x2C, SYNCHRONOUS_CONNECTION_CHANGED = 0x2D, SNIFF_SUBRATING = 0x2E, EXTENDED_INQUIRY_RESULT = 0x2F, ENCRYPTION_KEY_REFRESH_COMPLETE = 0x30, IO_CAPABILITY_REQUEST = 0x31, IO_CAPABILITY_RESPONSE = 0x32, USER_CONFIRMATION_REQUEST = 0x33, USER_PASSKEY_REQUEST = 0x34, REMOTE_OOB_DATA_REQUEST = 0x35, SIMPLE_PAIRING_COMPLETE = 0x36, LINK_SUPERVISION_TIMEOUT_CHANGED = 0x38, ENHANCED_FLUSH_COMPLETE = 0x39, USER_PASSKEY_NOTIFICATION = 0x3B, KEYPRESS_NOTIFICATION = 0x3C, REMOTE_HOST_SUPPORTED_FEATURES_NOTIFICATION = 0x3D, LE_META_EVENT = 0x3e, NUMBER_OF_COMPLETED_DATA_BLOCKS = 0x48, VENDOR_SPECIFIC = 0xFF, } packet EventPacket { event_code : EventCode, _size_(_payload_) : 8, _payload_, } // LE Events enum SubeventCode : 8 { CONNECTION_COMPLETE = 0x01, ADVERTISING_REPORT = 0x02, CONNECTION_UPDATE_COMPLETE = 0x03, READ_REMOTE_FEATURES_COMPLETE = 0x04, LONG_TERM_KEY_REQUEST = 0x05, REMOTE_CONNECTION_PARAMETER_REQUEST = 0x06, DATA_LENGTH_CHANGE = 0x07, READ_LOCAL_P256_PUBLIC_KEY_COMPLETE = 0x08, GENERATE_DHKEY_COMPLETE = 0x09, ENHANCED_CONNECTION_COMPLETE = 0x0a, DIRECTED_ADVERTISING_REPORT = 0x0b, PHY_UPDATE_COMPLETE = 0x0c, EXTENDED_ADVERTISING_REPORT = 0x0D, PERIODIC_ADVERTISING_SYNC_ESTABLISHED = 0x0E, PERIODIC_ADVERTISING_REPORT = 0x0F, PERIODIC_ADVERTISING_SYNC_LOST = 0x10, SCAN_TIMEOUT = 0x11, ADVERTISING_SET_TERMINATED = 0x12, SCAN_REQUEST_RECEIVED = 0x13, } // Vendor specific events enum VseSubeventCode : 8 { BLE_THRESHOLD = 0x54, BLE_TRACKING = 0x56, DEBUG_INFO = 0x57, BQR_EVENT = 0x58, } // Common definitions for commands and events enum FeatureFlag : 1 { UNSUPPORTED = 0, SUPPORTED = 1, } enum ErrorCode: 8 { SUCCESS = 0x00, UNKNOWN_HCI_COMMAND = 0x01, UNKNOWN_CONNECTION = 0x02, HARDWARE_FAILURE = 0x03, PAGE_TIMEOUT = 0x04, AUTHENTICATION_FAILURE = 0x05, PIN_OR_KEY_MISSING = 0x06, MEMORY_CAPACITY_EXCEEDED = 0x07, CONNECTION_TIMEOUT = 0x08, CONNECTION_LIMIT_EXCEEDED = 0x09, SYNCHRONOUS_CONNECTION_LIMIT_EXCEEDED = 0x0A, CONNECTION_ALREADY_EXISTS = 0x0B, COMMAND_DISALLOWED = 0x0C, CONNECTION_REJECTED_LIMITED_RESOURCES = 0x0D, CONNECTION_REJECTED_SECURITY_REASONS = 0x0E, CONNECTION_REJECTED_UNACCEPTABLE_BD_ADDR = 0x0F, CONNECTION_ACCEPT_TIMEOUT = 0x10, UNSUPORTED_FEATURE_OR_PARAMETER_VALUE = 0x11, INVALID_HCI_COMMAND_PARAMETERS = 0x12, REMOTE_USER_TERMINATED_CONNECTION = 0x13, REMOTE_DEVICE_TERMINATED_CONNECTION_LOW_RESOURCES = 0x14, REMOTE_DEVICE_TERMINATED_CONNECTION_POWER_OFF = 0x15, CONNECTION_TERMINATED_BY_LOCAL_HOST = 0x16, REPEATED_ATTEMPTS = 0x17, PAIRING_NOT_ALLOWED = 0x18, UNKNOWN_LMP_PDU = 0x19, UNSUPPORTED_REMOTE_OR_LMP_FEATURE = 0x1A, SCO_OFFSET_REJECTED = 0x1B, SCO_INTERVAL_REJECTED = 0x1C, SCO_AIR_MODE_REJECTED = 0x1D, INVALID_LMP_OR_LL_PARAMETERS = 0x1E, UNSPECIFIED_ERROR = 0x1F, UNSUPPORTED_LMP_OR_LL_PARAMETER = 0x20, ROLE_CHANGE_NOT_ALLOWED = 0x21, LINK_LAYER_COLLISION = 0x23, ENCRYPTION_MODE_NOT_ACCEPTABLE = 0x25, CONTROLLER_BUSY = 0x3A, } // Events that are defined with their respective commands packet CommandComplete : EventPacket (event_code = COMMAND_COMPLETE){ num_hci_command_packets : 8, command_op_code : OpCode, _payload_, } packet CommandStatus : EventPacket (event_code = COMMAND_STATUS){ status : ErrorCode, // SUCCESS means PENDING num_hci_command_packets : 8, command_op_code : OpCode, _payload_, } // Credits packet NoCommandComplete : CommandComplete (command_op_code = NONE){ } struct Lap { // Lower Address Part lap : 6, _reserved_ : 2, _fixed_ = 0x9e8b : 16, } // LINK_CONTROL packet Inquiry : DiscoveryCommand (op_code = INQUIRY) { lap : Lap, inquiry_length : 8, // 0x1 - 0x30 (times 1.28s) num_responses : 8, // 0x00 unlimited } packet InquiryStatus : CommandStatus (command_op_code = INQUIRY) { } packet InquiryCancel : DiscoveryCommand (op_code = INQUIRY_CANCEL) { } packet InquiryCancelComplete : CommandComplete (command_op_code = INQUIRY_CANCEL) { status : ErrorCode, } packet PeriodicInquiryMode : DiscoveryCommand (op_code = PERIODIC_INQUIRY_MODE) { max_period_length : 16, // Range 0x0003 to 0xffff (times 1.28s) min_period_length : 16, // Range 0x0002 to 0xfffe (times 1.28s) lap : Lap, inquiry_length : 8, // 0x1 - 0x30 (times 1.28s) num_responses : 8, // 0x00 unlimited } packet PeriodicInquiryModeComplete : CommandComplete (command_op_code = PERIODIC_INQUIRY_MODE) { status : ErrorCode, } packet ExitPeriodicInquiryMode : DiscoveryCommand (op_code = EXIT_PERIODIC_INQUIRY_MODE) { } packet ExitPeriodicInquiryModeComplete : CommandComplete (command_op_code = EXIT_PERIODIC_INQUIRY_MODE) { status : ErrorCode, } enum PageScanRepetitionMode : 8 { R0 = 0x00, R1 = 0x01, R2 = 0x02, } enum ClockOffsetValid : 1 { INVALID = 0, VALID = 1, } enum CreateConnectionRoleSwitch : 8 { REMAIN_MASTER = 0x00, ALLOW_ROLE_SWITCH = 0x01, } packet CreateConnection : ConnectionManagementCommand (op_code = CREATE_CONNECTION) { bd_addr : Address, packet_type : 16, page_scan_repetition_mode : PageScanRepetitionMode, _reserved_ : 8, clock_offset : 15, clock_offset_valid : ClockOffsetValid, allow_role_switch : CreateConnectionRoleSwitch, } packet CreateConnectionStatus : CommandStatus (command_op_code = CREATE_CONNECTION) { } enum DisconnectReason : 8 { AUTHENTICATION_FAILURE = 0x05, REMOTE_USER_TERMINATED_CONNECTION = 0x13, REMOTE_DEVICE_TERMINATED_CONNECTION_LOW_RESOURCES = 0x14, REMOTE_DEVICE_TERMINATED_CONNECTION_POWER_OFF = 0x15, UNSUPPORTED_REMOTE_FEATURE = 0x1A, PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED = 0x29, UNACCEPTABLE_CONNECTION_PARAMETERS = 0x3B, } packet Disconnect : ConnectionManagementCommand (op_code = DISCONNECT) { connection_handle : 12, _reserved_ : 4, reason : DisconnectReason, } packet DisconnectStatus : CommandStatus (command_op_code = DISCONNECT) { } packet CreateConnectionCancel : ConnectionManagementCommand (op_code = CREATE_CONNECTION_CANCEL) { bd_addr : Address, } packet CreateConnectionCancelComplete : CommandComplete (command_op_code = CREATE_CONNECTION_CANCEL) { status : ErrorCode, bd_addr : Address, } enum AcceptConnectionRequestRole : 8 { BECOME_MASTER = 0x00, REMAIN_SLAVE = 0x01, } packet AcceptConnectionRequest : ConnectionManagementCommand (op_code = ACCEPT_CONNECTION_REQUEST) { bd_addr : Address, role : AcceptConnectionRequestRole, } packet AcceptConnectionRequestStatus : CommandStatus (command_op_code = ACCEPT_CONNECTION_REQUEST) { } enum RejectConnectionReason : 8 { LIMITED_RESOURCES = 0x0D, SECURITY_REASONS = 0x0E, UNACCEPTABLE_BD_ADDR = 0x0F, } packet RejectConnectionRequest : ConnectionManagementCommand (op_code = REJECT_CONNECTION_REQUEST) { bd_addr : Address, reason : RejectConnectionReason, } packet RejectConnectionRequestStatus : CommandStatus (command_op_code = REJECT_CONNECTION_REQUEST) { } packet LinkKeyRequestReply : SecurityCommand (op_code = LINK_KEY_REQUEST_REPLY) { bd_addr : Address, link_key : 8[16], } packet LinkKeyRequestReplyComplete : CommandComplete (command_op_code = LINK_KEY_REQUEST_REPLY) { status : ErrorCode, } packet LinkKeyRequestNegativeReply : SecurityCommand (op_code = LINK_KEY_REQUEST_NEGATIVE_REPLY) { bd_addr : Address, } packet LinkKeyRequestNegativeReplyComplete : CommandComplete (command_op_code = LINK_KEY_REQUEST_NEGATIVE_REPLY) { status : ErrorCode, bd_addr : Address, } packet PinCodeRequestReply : SecurityCommand (op_code = PIN_CODE_REQUEST_REPLY) { bd_addr : Address, pin_code_length : 5, // 0x01 - 0x10 _reserved_ : 3, pin_code : 8[16], // string parameter, first octet first } packet PinCodeRequestReplyComplete : CommandComplete (command_op_code = PIN_CODE_REQUEST_REPLY) { status : ErrorCode, bd_addr : Address, } packet PinCodeRequestNegativeReply : SecurityCommand (op_code = PIN_CODE_REQUEST_NEGATIVE_REPLY) { bd_addr : Address, } packet PinCodeRequestNegativeReplyComplete : CommandComplete (command_op_code = PIN_CODE_REQUEST_NEGATIVE_REPLY) { status : ErrorCode, bd_addr : Address, } packet ChangeConnectionPacketType : ConnectionManagementCommand (op_code = CHANGE_CONNECTION_PACKET_TYPE) { connection_handle : 12, _reserved_ : 4, packet_type : 16, } packet ChangeConnectionPacketTypeStatus : CommandStatus (command_op_code = CHANGE_CONNECTION_PACKET_TYPE) { } packet AuthenticationRequested : ConnectionManagementCommand (op_code = AUTHENTICATION_REQUESTED) { connection_handle : 12, _reserved_ : 4, } packet AuthenticationRequestedStatus : CommandStatus (command_op_code = AUTHENTICATION_REQUESTED) { } packet SetConnectionEncryption : ConnectionManagementCommand (op_code = SET_CONNECTION_ENCRYPTION) { connection_handle : 12, _reserved_ : 4, encryption_enable : Enable, } packet SetConnectionEncryptionStatus : CommandStatus (command_op_code = SET_CONNECTION_ENCRYPTION) { } packet ChangeConnectionLinkKey : ConnectionManagementCommand (op_code = CHANGE_CONNECTION_LINK_KEY) { connection_handle : 12, _reserved_ : 4, } packet ChangeConnectionLinkKeyStatus : CommandStatus (command_op_code = CHANGE_CONNECTION_LINK_KEY) { } enum KeyFlag : 8 { SEMI_PERMANENT = 0x00, TEMPORARY = 0x01, } packet MasterLinkKey : ConnectionManagementCommand (op_code = MASTER_LINK_KEY) { key_flag : KeyFlag, } packet MasterLinkKeyStatus : CommandStatus (command_op_code = MASTER_LINK_KEY) { } packet RemoteNameRequest : DiscoveryCommand (op_code = REMOTE_NAME_REQUEST) { bd_addr : Address, page_scan_repetition_mode : PageScanRepetitionMode, _reserved_ : 8, clock_offset : 15, clock_offset_valid : ClockOffsetValid, } packet RemoteNameRequestStatus : CommandStatus (command_op_code = REMOTE_NAME_REQUEST) { } packet RemoteNameRequestCancel : DiscoveryCommand (op_code = REMOTE_NAME_REQUEST_CANCEL) { bd_addr : Address, } packet RemoteNameRequestCancelComplete : CommandComplete (command_op_code = REMOTE_NAME_REQUEST_CANCEL) { status : ErrorCode, bd_addr : Address, } packet ReadRemoteSupportedFeatures : DiscoveryCommand (op_code = READ_REMOTE_SUPPORTED_FEATURES) { connection_handle : 12, _reserved_ : 4, } packet ReadRemoteSupportedFeaturesStatus : CommandStatus (command_op_code = READ_REMOTE_SUPPORTED_FEATURES) { } packet ReadRemoteExtendedFeatures : DiscoveryCommand (op_code = READ_REMOTE_EXTENDED_FEATURES) { connection_handle : 12, _reserved_ : 4, page_number : 8, } packet ReadRemoteExtendedFeaturesStatus : CommandStatus (command_op_code = READ_REMOTE_EXTENDED_FEATURES) { } packet ReadRemoteVersionInformation : DiscoveryCommand (op_code = READ_REMOTE_VERSION_INFORMATION) { connection_handle : 12, _reserved_ : 4, } packet ReadRemoteVersionInformationStatus : CommandStatus (command_op_code = READ_REMOTE_VERSION_INFORMATION) { } packet ReadClockOffset : ConnectionManagementCommand (op_code = READ_CLOCK_OFFSET) { connection_handle : 12, _reserved_ : 4, } packet ReadClockOffsetStatus : CommandStatus (command_op_code = READ_CLOCK_OFFSET) { } packet ReadLmpHandle : ConnectionManagementCommand (op_code = READ_LMP_HANDLE) { connection_handle : 12, _reserved_ : 4, } packet ReadLmpHandleComplete : CommandComplete (command_op_code = READ_LMP_HANDLE) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, lmp_handle : 8, _reserved_ : 32, } packet SetupSynchronousConnection : ScoConnectionCommand (op_code = SETUP_SYNCHRONOUS_CONNECTION) { _payload_, // placeholder (unimplemented) } packet AcceptSynchronousConnection : ScoConnectionCommand (op_code = ACCEPT_SYNCHRONOUS_CONNECTION) { _payload_, // placeholder (unimplemented) } packet RejectSynchronousConnection : ScoConnectionCommand (op_code = REJECT_SYNCHRONOUS_CONNECTION) { _payload_, // placeholder (unimplemented) } enum IoCapability : 8 { DISPLAY_ONLY = 0x00, DISPLAY_YES_NO = 0x01, KEYBOARD_ONLY = 0x02, NO_INPUT_NO_OUTPUT = 0x03, } enum OobDataPresent : 8 { NOT_PRESENT = 0x00, P_192_PRESENT = 0x01, P_256_PRESENT = 0x02, P_192_AND_256_PRESENT = 0x03, } enum AuthenticationRequirements : 8 { NO_BONDING = 0x00, NO_BONDING_MITM_PROTECTION = 0x01, DEDICATED_BONDING = 0x02, DEDICATED_BONDING_MITM_PROTECTION = 0x03, GENERAL_BONDING = 0x04, GENERAL_BONDING_MITM_PROTECTION = 0x05, } packet IoCapabilityRequestReply : SecurityCommand (op_code = IO_CAPABILITY_REQUEST_REPLY) { bd_addr : Address, io_capability : IoCapability, oob_present : OobDataPresent, authentication_requirements : AuthenticationRequirements, } packet IoCapabilityRequestReplyComplete : CommandComplete (command_op_code = IO_CAPABILITY_REQUEST_REPLY) { status : ErrorCode, bd_addr : Address, } packet UserConfirmationRequestReply : SecurityCommand (op_code = USER_CONFIRMATION_REQUEST_REPLY) { bd_addr : Address, } packet UserConfirmationRequestReplyComplete : CommandComplete (command_op_code = USER_CONFIRMATION_REQUEST_REPLY) { status : ErrorCode, bd_addr : Address, } packet UserConfirmationRequestNegativeReply : SecurityCommand (op_code = USER_CONFIRMATION_REQUEST_NEGATIVE_REPLY) { bd_addr : Address, } packet UserConfirmationRequestNegativeReplyComplete : CommandComplete (command_op_code = USER_CONFIRMATION_REQUEST_NEGATIVE_REPLY) { status : ErrorCode, bd_addr : Address, } packet UserPasskeyRequestReply : SecurityCommand (op_code = USER_PASSKEY_REQUEST_REPLY) { bd_addr : Address, numeric_value : 32, // 000000-999999 decimal or 0x0-0xF423F } packet UserPasskeyRequestReplyComplete : CommandComplete (command_op_code = USER_PASSKEY_REQUEST_REPLY) { status : ErrorCode, bd_addr : Address, } packet UserPasskeyRequestNegativeReply : SecurityCommand (op_code = USER_PASSKEY_REQUEST_NEGATIVE_REPLY) { bd_addr : Address, } packet UserPasskeyRequestNegativeReplyComplete : CommandComplete (command_op_code = USER_PASSKEY_REQUEST_NEGATIVE_REPLY) { status : ErrorCode, bd_addr : Address, } packet RemoteOobDataRequestReply : SecurityCommand (op_code = REMOTE_OOB_DATA_REQUEST_REPLY) { bd_addr : Address, c : 8[16], r : 8[16], } packet RemoteOobDataRequestReplyComplete : CommandComplete (command_op_code = REMOTE_OOB_DATA_REQUEST_REPLY) { status : ErrorCode, bd_addr : Address, } packet RemoteOobDataRequestNegativeReply : SecurityCommand (op_code = REMOTE_OOB_DATA_REQUEST_NEGATIVE_REPLY) { bd_addr : Address, } packet RemoteOobDataRequestNegativeReplyComplete : CommandComplete (command_op_code = REMOTE_OOB_DATA_REQUEST_NEGATIVE_REPLY) { status : ErrorCode, bd_addr : Address, } packet IoCapabilityRequestNegativeReply : SecurityCommand (op_code = IO_CAPABILITY_REQUEST_NEGATIVE_REPLY) { bd_addr : Address, reason : ErrorCode, } packet IoCapabilityRequestNegativeReplyComplete : CommandComplete (command_op_code = IO_CAPABILITY_REQUEST_NEGATIVE_REPLY) { status : ErrorCode, bd_addr : Address, } packet EnhancedSetupSynchronousConnection : ScoConnectionCommand (op_code = ENHANCED_SETUP_SYNCHRONOUS_CONNECTION) { _payload_, // placeholder (unimplemented) } packet EnhancedAcceptSynchronousConnection : ScoConnectionCommand (op_code = ENHANCED_ACCEPT_SYNCHRONOUS_CONNECTION) { _payload_, // placeholder (unimplemented) } // LINK_POLICY packet HoldMode : ConnectionManagementCommand (op_code = HOLD_MODE) { connection_handle : 12, _reserved_ : 4, hold_mode_max_interval: 16, // 0x0002-0xFFFE (1.25ms-40.9s) hold_mode_min_interval: 16, // 0x0002-0xFFFE (1.25ms-40.9s) } packet HoldModeStatus : CommandStatus (command_op_code = HOLD_MODE) { } packet SniffMode : ConnectionManagementCommand (op_code = SNIFF_MODE) { connection_handle : 12, _reserved_ : 4, sniff_max_interval: 16, // 0x0002-0xFFFE (1.25ms-40.9s) sniff_min_interval: 16, // 0x0002-0xFFFE (1.25ms-40.9s) sniff_attempt: 16, // 0x0001-0x7FFF (1.25ms-40.9s) sniff_timeout: 16, // 0x0000-0x7FFF (0ms-40.9s) } packet SniffModeStatus : CommandStatus (command_op_code = SNIFF_MODE) { } packet ExitSniffMode : ConnectionManagementCommand (op_code = EXIT_SNIFF_MODE) { connection_handle : 12, _reserved_ : 4, } packet ExitSniffModeStatus : CommandStatus (command_op_code = EXIT_SNIFF_MODE) { } enum ServiceType : 8 { NO_TRAFFIC = 0x00, BEST_EFFORT = 0x01, GUARANTEED = 0x02, } packet QosSetup : ConnectionManagementCommand (op_code = QOS_SETUP) { connection_handle : 12, _reserved_ : 4, _reserved_ : 8, service_type : ServiceType, token_rate : 32, // Octets/s peak_bandwidth : 32, // Octets/s latency : 32, // Octets/s delay_variation : 32, // microseconds } packet QosSetupStatus : CommandStatus (command_op_code = QOS_SETUP) { } packet RoleDiscovery : ConnectionManagementCommand (op_code = ROLE_DISCOVERY) { connection_handle : 12, _reserved_ : 4, } enum Role : 8 { MASTER = 0x00, SLAVE = 0x01, } packet RoleDiscoveryComplete : CommandComplete (command_op_code = ROLE_DISCOVERY) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, current_role : Role, } packet SwitchRole : ConnectionManagementCommand (op_code = SWITCH_ROLE) { bd_addr : Address, role : Role, } packet SwitchRoleStatus : CommandStatus (command_op_code = SWITCH_ROLE) { } packet ReadLinkPolicySettings : ConnectionManagementCommand (op_code = READ_LINK_POLICY_SETTINGS) { connection_handle : 12, _reserved_ : 4, } enum LinkPolicy : 16 { ENABLE_ROLE_SWITCH = 0x01, ENABLE_HOLD_MODE = 0x02, ENABLE_SNIFF_MODE = 0x04, ENABLE_PARK_MODE = 0x08, // deprecated after 5.0 } packet ReadLinkPolicySettingsComplete : CommandComplete (command_op_code = READ_LINK_POLICY_SETTINGS) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, link_policy_settings : 16, } packet WriteLinkPolicySettings : ConnectionManagementCommand (op_code = WRITE_LINK_POLICY_SETTINGS) { connection_handle : 12, _reserved_ : 4, link_policy_settings : 16, } packet WriteLinkPolicySettingsComplete : CommandComplete (command_op_code = WRITE_LINK_POLICY_SETTINGS) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, } packet ReadDefaultLinkPolicySettings : ConnectionManagementCommand (op_code = READ_DEFAULT_LINK_POLICY_SETTINGS) { } packet ReadDefaultLinkPolicySettingsComplete : CommandComplete (command_op_code = READ_DEFAULT_LINK_POLICY_SETTINGS) { status : ErrorCode, default_link_policy_settings : 16, } packet WriteDefaultLinkPolicySettings : ConnectionManagementCommand (op_code = WRITE_DEFAULT_LINK_POLICY_SETTINGS) { default_link_policy_settings : 16, } packet WriteDefaultLinkPolicySettingsComplete : CommandComplete (command_op_code = WRITE_DEFAULT_LINK_POLICY_SETTINGS) { status : ErrorCode, } enum FlowDirection : 8 { OUTGOING_FLOW = 0x00, INCOMING_FLOW = 0x01, } packet FlowSpecification : ConnectionManagementCommand (op_code = FLOW_SPECIFICATION) { connection_handle : 12, _reserved_ : 4, _reserved_ : 8, flow_direction : FlowDirection, service_type : ServiceType, token_rate : 32, // Octets/s token_bucket_size : 32, peak_bandwidth : 32, // Octets/s access_latency : 32, // Octets/s } packet FlowSpecificationStatus : CommandStatus (command_op_code = FLOW_SPECIFICATION) { } packet SniffSubrating : ConnectionManagementCommand (op_code = SNIFF_SUBRATING) { connection_handle : 12, _reserved_ : 4, maximum_latency : 16, // 0x0002-0xFFFE (1.25ms-40.9s) minimum_remote_timeout : 16, // 0x0000-0xFFFE (0-40.9s) minimum_local_timeout: 16, // 0x0000-0xFFFE (0-40.9s) } packet SniffSubratingComplete : CommandComplete (command_op_code = SNIFF_SUBRATING) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, } // CONTROLLER_AND_BASEBAND packet SetEventMask : CommandPacket (op_code = SET_EVENT_MASK) { event_mask : 64, } packet SetEventMaskComplete : CommandComplete (command_op_code = SET_EVENT_MASK) { status : ErrorCode, } packet Reset : CommandPacket (op_code = RESET) { } packet ResetComplete : CommandComplete (command_op_code = RESET) { status : ErrorCode, } enum FilterType : 8 { CLEAR_ALL_FILTERS = 0x00, INQUIRY_RESULT = 0x01, CONNECTION_SETUP = 0x02, } packet SetEventFilter : CommandPacket (op_code = SET_EVENT_FILTER) { filter_type : FilterType, _body_, } packet SetEventFilterComplete : CommandComplete (command_op_code = SET_EVENT_FILTER) { status : ErrorCode, } packet SetEventFilterClearAll : SetEventFilter (filter_type = CLEAR_ALL_FILTERS) { } enum FilterConditionType : 8 { ALL_DEVICES = 0x00, CLASS_OF_DEVICE = 0x01, ADDRESS = 0x02, } packet SetEventFilterInquiryResult : SetEventFilter (filter_type = INQUIRY_RESULT) { filter_condition_type : FilterConditionType, _body_, } packet SetEventFilterInquiryResultAllDevices : SetEventFilterInquiryResult (filter_condition_type = ALL_DEVICES) { } packet SetEventFilterInquiryResultClassOfDevice : SetEventFilterInquiryResult (filter_condition_type = CLASS_OF_DEVICE) { class_of_device : ClassOfDevice, class_of_device_mask : ClassOfDevice, } packet SetEventFilterInquiryResultAddress : SetEventFilterInquiryResult (filter_condition_type = ADDRESS) { address : Address, } packet SetEventFilterConnectionSetup : SetEventFilter (filter_type = CONNECTION_SETUP) { filter_condition_type : FilterConditionType, _body_, } enum AutoAcceptFlag : 8 { AUTO_ACCEPT_OFF = 0x01, AUTO_ACCEPT_ON_ROLE_SWITCH_DISABLED = 0x02, AUTO_ACCEPT_ON_ROLE_SWITCH_ENABLED = 0x03, } packet SetEventFilterConnectionSetupAllDevices : SetEventFilterConnectionSetup (filter_condition_type = ALL_DEVICES) { auto_accept_flag : AutoAcceptFlag, } packet SetEventFilterConnectionSetupClassOfDevice : SetEventFilterConnectionSetup (filter_condition_type = CLASS_OF_DEVICE) { class_of_device : ClassOfDevice, class_of_device_mask : ClassOfDevice, auto_accept_flag : AutoAcceptFlag, } packet SetEventFilterConnectionSetupAddress : SetEventFilterConnectionSetup (filter_condition_type = ADDRESS) { address : Address, auto_accept_flag : AutoAcceptFlag, } packet Flush : ConnectionManagementCommand (op_code = FLUSH) { connection_handle : 12, _reserved_ : 4, } packet FlushComplete : CommandComplete (command_op_code = FLUSH) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, } enum PinType : 8 { VARIABLE = 0, FIXED = 1, } packet ReadPinType : CommandPacket (op_code = READ_PIN_TYPE) { } packet ReadPinTypeComplete : CommandComplete (command_op_code = READ_PIN_TYPE) { status : ErrorCode, pin_type : PinType, } packet WritePinType : CommandPacket (op_code = WRITE_PIN_TYPE) { pin_type : PinType, } packet WritePinTypeComplete : CommandComplete (command_op_code = WRITE_PIN_TYPE) { status : ErrorCode, } packet CreateNewUnitKey : CommandPacket (op_code = CREATE_NEW_UNIT_KEY) { _payload_, // placeholder (unimplemented) } enum ReadStoredLinkKeyReadAllFlag : 8 { SPECIFIED_BD_ADDR = 0x00, ALL = 0x01, } packet ReadStoredLinkKey : SecurityCommand (op_code = READ_STORED_LINK_KEY) { bd_addr : Address, read_all_flag : ReadStoredLinkKeyReadAllFlag, } packet ReadStoredLinkKeyComplete : CommandComplete (command_op_code = READ_STORED_LINK_KEY) { status : ErrorCode, max_num_keys : 16, num_keys_read : 16, } struct KeyAndAddress { address : Address, link_key : 8[16], } packet WriteStoredLinkKey : SecurityCommand (op_code = WRITE_STORED_LINK_KEY) { _count_(keys_to_write) : 8, // 0x01-0x0B keys_to_write : KeyAndAddress[], } packet WriteStoredLinkKeyComplete : CommandComplete (command_op_code = WRITE_STORED_LINK_KEY) { status : ErrorCode, num_keys_written : 8, } enum DeleteStoredLinkKeyDeleteAllFlag : 8 { SPECIFIED_BD_ADDR = 0x00, ALL = 0x01, } packet DeleteStoredLinkKey : SecurityCommand (op_code = DELETE_STORED_LINK_KEY) { bd_addr : Address, delete_all_flag : DeleteStoredLinkKeyDeleteAllFlag, } packet DeleteStoredLinkKeyComplete : CommandComplete (command_op_code = DELETE_STORED_LINK_KEY) { status : ErrorCode, num_keys_deleted : 16, } packet WriteLocalName : CommandPacket (op_code = WRITE_LOCAL_NAME) { local_name : 8[248], // Null-terminated UTF-8 encoded name } packet WriteLocalNameComplete : CommandComplete (command_op_code = WRITE_LOCAL_NAME) { status : ErrorCode, } packet ReadLocalName : CommandPacket (op_code = READ_LOCAL_NAME) { } packet ReadLocalNameComplete : CommandComplete (command_op_code = READ_LOCAL_NAME) { status : ErrorCode, local_name : 8[248], // Null-terminated UTF-8 encoded name } packet ReadConnectionAcceptTimeout : ConnectionManagementCommand (op_code = READ_CONNECTION_ACCEPT_TIMEOUT) { } packet ReadConnectionAcceptTimeoutComplete : CommandComplete (command_op_code = READ_CONNECTION_ACCEPT_TIMEOUT) { status : ErrorCode, conn_accept_timeout : 16, // 0x0001 to 0xB540 (N * 0.625 ms) 0.625 ms to 29 s } packet WriteConnectionAcceptTimeout : ConnectionManagementCommand (op_code = WRITE_CONNECTION_ACCEPT_TIMEOUT) { conn_accept_timeout : 16, // 0x0001 to 0xB540 (N * 0.625 ms) 0.625 ms to 29 s, Default 0x1FA0, 5.06s } packet WriteConnectionAcceptTimeoutComplete : CommandComplete (command_op_code = WRITE_CONNECTION_ACCEPT_TIMEOUT) { status : ErrorCode, } packet ReadPageTimeout : DiscoveryCommand (op_code = READ_PAGE_TIMEOUT) { } packet ReadPageTimeoutComplete : CommandComplete (command_op_code = READ_PAGE_TIMEOUT) { status : ErrorCode, page_timeout : 16, } packet WritePageTimeout : DiscoveryCommand (op_code = WRITE_PAGE_TIMEOUT) { page_timeout : 16, } packet WritePageTimeoutComplete : CommandComplete (command_op_code = WRITE_PAGE_TIMEOUT) { status : ErrorCode, } enum ScanEnable : 8 { NO_SCANS = 0x00, INQUIRY_SCAN_ONLY = 0x01, PAGE_SCAN_ONLY = 0x02, INQUIRY_AND_PAGE_SCAN = 0x03, } packet ReadScanEnable : DiscoveryCommand (op_code = READ_SCAN_ENABLE) { } packet ReadScanEnableComplete : CommandComplete (command_op_code = READ_SCAN_ENABLE) { status : ErrorCode, scan_enable : ScanEnable, } packet WriteScanEnable : DiscoveryCommand (op_code = WRITE_SCAN_ENABLE) { scan_enable : ScanEnable, } packet WriteScanEnableComplete : CommandComplete (command_op_code = WRITE_SCAN_ENABLE) { status : ErrorCode, } packet ReadPageScanActivity : DiscoveryCommand (op_code = READ_PAGE_SCAN_ACTIVITY) { } packet ReadPageScanActivityComplete : CommandComplete (command_op_code = READ_PAGE_SCAN_ACTIVITY) { status : ErrorCode, page_scan_interval : 16, // Range: 0x0012 to 0x1000; only even values are valid * 0x625 ms page_scan_window : 16, // 0x0011 to PageScanInterval } packet WritePageScanActivity : DiscoveryCommand (op_code = WRITE_PAGE_SCAN_ACTIVITY) { page_scan_interval : 16, // Range: 0x0012 to 0x1000; only even values are valid * 0x625 ms page_scan_window : 16, // 0x0011 to PageScanInterval } packet WritePageScanActivityComplete : CommandComplete (command_op_code = WRITE_PAGE_SCAN_ACTIVITY) { status : ErrorCode, } packet ReadInquiryScanActivity : DiscoveryCommand (op_code = READ_INQUIRY_SCAN_ACTIVITY) { } packet ReadInquiryScanActivityComplete : CommandComplete (command_op_code = READ_INQUIRY_SCAN_ACTIVITY) { status : ErrorCode, inquiry_scan_interval : 16, // Range: 0x0012 to 0x1000; only even values are valid * 0x625 ms inquiry_scan_window : 16, // Range: 0x0011 to 0x1000 } packet WriteInquiryScanActivity : DiscoveryCommand (op_code = WRITE_INQUIRY_SCAN_ACTIVITY) { inquiry_scan_interval : 16, // Range: 0x0012 to 0x1000; only even values are valid * 0x625 ms inquiry_scan_window : 16, // Range: 0x0011 to 0x1000 } packet WriteInquiryScanActivityComplete : CommandComplete (command_op_code = WRITE_INQUIRY_SCAN_ACTIVITY) { status : ErrorCode, } enum AuthenticationEnable : 8 { NOT_REQUIRED = 0x00, REQUIRED = 0x01, } packet ReadAuthenticationEnable : CommandPacket (op_code = READ_AUTHENTICATION_ENABLE) { } packet ReadAuthenticationEnableComplete : CommandComplete (command_op_code = READ_AUTHENTICATION_ENABLE) { status : ErrorCode, authentication_enable : AuthenticationEnable, } packet WriteAuthenticationEnable : SecurityCommand (op_code = WRITE_AUTHENTICATION_ENABLE) { authentication_enable : AuthenticationEnable, } packet WriteAuthenticationEnableComplete : CommandComplete (command_op_code = WRITE_AUTHENTICATION_ENABLE) { status : ErrorCode, } packet ReadClassOfDevice : DiscoveryCommand (op_code = READ_CLASS_OF_DEVICE) { } packet ReadClassOfDeviceComplete : CommandComplete (command_op_code = READ_CLASS_OF_DEVICE) { status : ErrorCode, class_of_device : ClassOfDevice, } packet WriteClassOfDevice : DiscoveryCommand (op_code = WRITE_CLASS_OF_DEVICE) { class_of_device : ClassOfDevice, } packet WriteClassOfDeviceComplete : CommandComplete (command_op_code = WRITE_CLASS_OF_DEVICE) { status : ErrorCode, } packet ReadVoiceSetting : CommandPacket (op_code = READ_VOICE_SETTING) { _payload_, // placeholder (unimplemented) } packet WriteVoiceSetting : CommandPacket (op_code = WRITE_VOICE_SETTING) { _payload_, // placeholder (unimplemented) } packet WriteVoiceSettingComplete : CommandComplete (command_op_code = WRITE_VOICE_SETTING) { status : ErrorCode, } packet ReadAutomaticFlushTimeout : ConnectionManagementCommand (op_code = READ_AUTOMATIC_FLUSH_TIMEOUT) { connection_handle : 12, _reserved_ : 4, } packet ReadAutomaticFlushTimeoutComplete : CommandComplete (command_op_code = READ_AUTOMATIC_FLUSH_TIMEOUT) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, flush_timeout : 16, } packet WriteAutomaticFlushTimeout : ConnectionManagementCommand (op_code = WRITE_AUTOMATIC_FLUSH_TIMEOUT) { connection_handle : 12, _reserved_ : 4, flush_timeout : 16, // 0x0000-0x07FF Default 0x0000 (No Automatic Flush) } packet WriteAutomaticFlushTimeoutComplete : CommandComplete (command_op_code = WRITE_AUTOMATIC_FLUSH_TIMEOUT) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, } packet ReadNumBroadcastRetransmits : CommandPacket (op_code = READ_NUM_BROADCAST_RETRANSMITS) { _payload_, // placeholder (unimplemented) } packet WriteNumBroadcastRetransmits : CommandPacket (op_code = WRITE_NUM_BROADCAST_RETRANSMITS) { _payload_, // placeholder (unimplemented) } packet ReadHoldModeActivity : CommandPacket (op_code = READ_HOLD_MODE_ACTIVITY) { _payload_, // placeholder (unimplemented) } packet WriteHoldModeActivity : CommandPacket (op_code = WRITE_HOLD_MODE_ACTIVITY) { _payload_, // placeholder (unimplemented) } enum TransmitPowerLevelType : 8 { CURRENT = 0x00, MAXIMUM = 0x01, } packet ReadTransmitPowerLevel : ConnectionManagementCommand (op_code = READ_TRANSMIT_POWER_LEVEL) { connection_handle : 12, _reserved_ : 4, type : TransmitPowerLevelType, } packet ReadTransmitPowerLevelComplete : CommandComplete (command_op_code = READ_TRANSMIT_POWER_LEVEL) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, transmit_power_level : 8, } packet ReadSynchronousFlowControlEnable : CommandPacket (op_code = READ_SYNCHRONOUS_FLOW_CONTROL_ENABLE) { _payload_, // placeholder (unimplemented) } packet WriteSynchronousFlowControlEnable : CommandPacket (op_code = WRITE_SYNCHRONOUS_FLOW_CONTROL_ENABLE) { _payload_, // placeholder (unimplemented) } packet SetControllerToHostFlowControl : CommandPacket (op_code = SET_CONTROLLER_TO_HOST_FLOW_CONTROL) { _payload_, // placeholder (unimplemented) } packet HostBufferSize : CommandPacket (op_code = HOST_BUFFER_SIZE) { host_acl_data_packet_length : 16, host_synchronous_data_packet_length : 8, host_total_num_acl_data_packets : 16, host_total_num_synchronous_data_packets : 16, } packet HostBufferSizeComplete : CommandComplete (command_op_code = HOST_BUFFER_SIZE) { status : ErrorCode, } struct CompletedPackets { connection_handle : 12, _reserved_ : 4, host_num_of_completed_packets : 16, } packet HostNumCompletedPackets : CommandPacket (op_code = HOST_NUM_COMPLETED_PACKETS) { _count_(completed_packets) : 8, completed_packets : CompletedPackets[], } packet HostNumCompletedPacketsError : CommandComplete (command_op_code = HOST_NUM_COMPLETED_PACKETS) { error_code : ErrorCode, } packet ReadLinkSupervisionTimeout : ConnectionManagementCommand (op_code = READ_LINK_SUPERVISION_TIMEOUT) { connection_handle : 12, _reserved_ : 4, } packet ReadLinkSupervisionTimeoutComplete : CommandComplete (command_op_code = READ_LINK_SUPERVISION_TIMEOUT) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, link_supervision_timeout : 16, // 0x001-0xFFFF (0.625ms-40.9s) } packet WriteLinkSupervisionTimeout : ConnectionManagementCommand (op_code = WRITE_LINK_SUPERVISION_TIMEOUT) { handle : 12, _reserved_ : 4, link_supervision_timeout : 16, // 0x001-0xFFFF (0.625ms-40.9s) } packet WriteLinkSupervisionTimeoutComplete : CommandComplete (command_op_code = WRITE_LINK_SUPERVISION_TIMEOUT) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, } packet ReadNumberOfSupportedIac : DiscoveryCommand (op_code = READ_NUMBER_OF_SUPPORTED_IAC) { } packet ReadNumberOfSupportedIacComplete : CommandComplete (command_op_code = READ_NUMBER_OF_SUPPORTED_IAC) { status : ErrorCode, num_support_iac : 8, } packet ReadCurrentIacLap : DiscoveryCommand (op_code = READ_CURRENT_IAC_LAP) { } packet ReadCurrentIacLapComplete : CommandComplete (command_op_code = READ_CURRENT_IAC_LAP) { status : ErrorCode, _count_(laps_to_read) : 8, laps_to_read : Lap[], } packet WriteCurrentIacLap : DiscoveryCommand (op_code = WRITE_CURRENT_IAC_LAP) { _count_(laps_to_write) : 8, laps_to_write : Lap[], } packet WriteCurrentIacLapComplete : CommandComplete (command_op_code = WRITE_CURRENT_IAC_LAP) { status : ErrorCode, } packet SetAfhHostChannelClassification : CommandPacket (op_code = SET_AFH_HOST_CHANNEL_CLASSIFICATION) { afh_host_channel_classification : 8[10], } packet SetAfhHostChannelClassificationComplete : CommandComplete (command_op_code = SET_AFH_HOST_CHANNEL_CLASSIFICATION) { status : ErrorCode, } enum InquiryScanType : 8 { STANDARD = 0x00, INTERLACED = 0x01, } packet ReadInquiryScanType : DiscoveryCommand (op_code = READ_INQUIRY_SCAN_TYPE) { } packet ReadInquiryScanTypeComplete : CommandComplete (command_op_code = READ_INQUIRY_SCAN_TYPE) { status : ErrorCode, inquiry_scan_type : InquiryScanType, } packet WriteInquiryScanType : DiscoveryCommand (op_code = WRITE_INQUIRY_SCAN_TYPE) { inquiry_scan_type : InquiryScanType, } packet WriteInquiryScanTypeComplete : CommandComplete (command_op_code = WRITE_INQUIRY_SCAN_TYPE) { status : ErrorCode, } enum InquiryMode : 8 { STANDARD = 0x00, RSSI = 0x01, RSSI_OR_EXTENDED = 0x02, } packet ReadInquiryMode : DiscoveryCommand (op_code = READ_INQUIRY_MODE) { } packet ReadInquiryModeComplete : CommandComplete (command_op_code = READ_INQUIRY_MODE) { status : ErrorCode, inquiry_mode : InquiryMode, } packet WriteInquiryMode : DiscoveryCommand (op_code = WRITE_INQUIRY_MODE) { inquiry_mode : InquiryMode, } packet WriteInquiryModeComplete : CommandComplete (command_op_code = WRITE_INQUIRY_MODE) { status : ErrorCode, } enum PageScanType : 8 { STANDARD = 0x00, INTERLACED = 0x01, } packet ReadPageScanType : DiscoveryCommand (op_code = READ_PAGE_SCAN_TYPE) { } packet ReadPageScanTypeComplete : CommandComplete (command_op_code = READ_PAGE_SCAN_TYPE) { status : ErrorCode, page_scan_type : PageScanType, } packet WritePageScanType : DiscoveryCommand (op_code = WRITE_PAGE_SCAN_TYPE) { page_scan_type : PageScanType, } packet WritePageScanTypeComplete : CommandComplete (command_op_code = WRITE_PAGE_SCAN_TYPE) { status : ErrorCode, } packet ReadAfhChannelAssessmentMode : CommandPacket (op_code = READ_AFH_CHANNEL_ASSESSMENT_MODE) { _payload_, // placeholder (unimplemented) } packet WriteAfhChannelAssessmentMode : CommandPacket (op_code = WRITE_AFH_CHANNEL_ASSESSMENT_MODE) { _payload_, // placeholder (unimplemented) } enum FecRequired : 8 { NOT_REQUIRED = 0x00, REQUIRED = 0x01, } packet ReadExtendedInquiryResponse : CommandPacket (op_code = READ_EXTENDED_INQUIRY_RESPONSE) { } packet ReadExtendedInquiryResponseComplete : CommandComplete (command_op_code = READ_EXTENDED_INQUIRY_RESPONSE) { status : ErrorCode, fec_required : FecRequired, extended_inquiry_response : GapData[], } packet WriteExtendedInquiryResponse : CommandPacket (op_code = WRITE_EXTENDED_INQUIRY_RESPONSE) { fec_required : FecRequired, extended_inquiry_response : GapData[], _padding_[244], // Zero padding to be 240 octets (GapData[]) + 2 (opcode) + 1 (size) + 1 (FecRequired) } packet WriteExtendedInquiryResponseComplete : CommandComplete (command_op_code = WRITE_EXTENDED_INQUIRY_RESPONSE) { status : ErrorCode, } packet RefreshEncryptionKey : SecurityCommand (op_code = REFRESH_ENCRYPTION_KEY) { connection_handle : 12, _reserved_ : 4, } packet RefreshEncryptionKeyStatus : CommandStatus (command_op_code = REFRESH_ENCRYPTION_KEY) { } packet ReadSimplePairingMode : SecurityCommand (op_code = READ_SIMPLE_PAIRING_MODE) { } packet ReadSimplePairingModeComplete : CommandComplete (command_op_code = READ_SIMPLE_PAIRING_MODE) { status : ErrorCode, simple_pairing_mode : Enable, } packet WriteSimplePairingMode : SecurityCommand (op_code = WRITE_SIMPLE_PAIRING_MODE) { simple_pairing_mode : Enable, } packet WriteSimplePairingModeComplete : CommandComplete (command_op_code = WRITE_SIMPLE_PAIRING_MODE) { status : ErrorCode, } packet ReadLocalOobData : SecurityCommand (op_code = READ_LOCAL_OOB_DATA) { } packet ReadLocalOobDataComplete : CommandComplete (command_op_code = READ_LOCAL_OOB_DATA) { status : ErrorCode, c : 8[16], r : 8[16], } packet ReadInquiryResponseTransmitPowerLevel : DiscoveryCommand (op_code = READ_INQUIRY_RESPONSE_TRANSMIT_POWER_LEVEL) { } packet ReadInquiryResponseTransmitPowerLevelComplete : CommandComplete (command_op_code = READ_INQUIRY_RESPONSE_TRANSMIT_POWER_LEVEL) { status : ErrorCode, tx_power : 8, // (-70dBm to 20dBm) } packet WriteInquiryTransmitPowerLevel : DiscoveryCommand (op_code = WRITE_INQUIRY_TRANSMIT_POWER_LEVEL) { tx_power : 8, } packet WriteInquiryResponseTransmitPowerLevelComplete : CommandComplete (command_op_code = WRITE_INQUIRY_TRANSMIT_POWER_LEVEL) { status : ErrorCode, } enum KeypressNotificationType : 8 { ENTRY_STARTED = 0, DIGIT_ENTERED = 1, DIGIT_ERASED = 2, CLEARED = 3, ENTRY_COMPLETED = 4, } packet SendKeypressNotification : SecurityCommand (op_code = SEND_KEYPRESS_NOTIFICATION) { bd_addr : Address, notification_type : KeypressNotificationType, } packet SendKeypressNotificationComplete : CommandComplete (command_op_code = SEND_KEYPRESS_NOTIFICATION) { status : ErrorCode, bd_addr : Address, } enum SimultaneousLeHost : 8 { DISABLED = 0x00, } packet ReadLeHostSupport : CommandPacket (op_code = READ_LE_HOST_SUPPORT) { } packet ReadLeHostSupportComplete : CommandComplete (command_op_code = READ_LE_HOST_SUPPORT) { status : ErrorCode, le_supported_host : Enable, simultaneous_le_host : SimultaneousLeHost, } packet WriteLeHostSupport : CommandPacket (op_code = WRITE_LE_HOST_SUPPORT) { le_supported_host : Enable, simultaneous_le_host : SimultaneousLeHost, } packet WriteLeHostSupportComplete : CommandComplete (command_op_code = WRITE_LE_HOST_SUPPORT) { status : ErrorCode, } packet ReadSecureConnectionsHostSupport : CommandPacket (op_code = READ_SECURE_CONNECTIONS_HOST_SUPPORT) { } packet ReadSecureConnectionsHostSupportComplete : CommandComplete (command_op_code = READ_SECURE_CONNECTIONS_HOST_SUPPORT) { status : ErrorCode, secure_connections_host_support : Enable, } packet WriteSecureConnectionsHostSupport : SecurityCommand (op_code = WRITE_SECURE_CONNECTIONS_HOST_SUPPORT) { secure_connections_host_support : Enable, } packet WriteSecureConnectionsHostSupportComplete : CommandComplete (command_op_code = WRITE_SECURE_CONNECTIONS_HOST_SUPPORT) { status : ErrorCode, } packet ReadLocalOobExtendedData : SecurityCommand (op_code = READ_LOCAL_OOB_EXTENDED_DATA) { } packet ReadLocalOobExtendedDataComplete : CommandComplete (command_op_code = READ_LOCAL_OOB_EXTENDED_DATA) { status : ErrorCode, c_192 : 8[16], r_192 : 8[16], c_256 : 8[16], r_256 : 8[16], } // INFORMATIONAL_PARAMETERS packet ReadLocalVersionInformation : CommandPacket (op_code = READ_LOCAL_VERSION_INFORMATION) { } enum HciVersion : 8 { V_1_0B = 0x00, V_1_1 = 0x01, V_1_2 = 0x02, V_2_0 = 0x03, // + EDR V_2_1 = 0x04, // + EDR V_3_0 = 0x05, // + HS V_4_0 = 0x06, V_4_1 = 0x07, V_4_2 = 0x08, V_5_0 = 0x09, V_5_1 = 0x0a, } enum LmpVersion : 8 { V_1_0B = 0x00, // withdrawn V_1_1 = 0x01, // withdrawn V_1_2 = 0x02, // withdrawn V_2_0 = 0x03, // + EDR V_2_1 = 0x04, // + EDR V_3_0 = 0x05, // + HS V_4_0 = 0x06, V_4_1 = 0x07, V_4_2 = 0x08, V_5_0 = 0x09, V_5_1 = 0x0a, } struct LocalVersionInformation { hci_version : HciVersion, hci_revision : 16, lmp_version : LmpVersion, manufacturer_name : 16, lmp_subversion : 16, } packet ReadLocalVersionInformationComplete : CommandComplete (command_op_code = READ_LOCAL_VERSION_INFORMATION) { status : ErrorCode, local_version_information : LocalVersionInformation, } packet ReadLocalSupportedCommands : CommandPacket (op_code = READ_LOCAL_SUPPORTED_COMMANDS) { } packet ReadLocalSupportedCommandsComplete : CommandComplete (command_op_code = READ_LOCAL_SUPPORTED_COMMANDS) { status : ErrorCode, supported_commands : 8[64], } packet ReadLocalSupportedFeatures : CommandPacket (op_code = READ_LOCAL_SUPPORTED_FEATURES) { } packet ReadLocalSupportedFeaturesComplete : CommandComplete (command_op_code = READ_LOCAL_SUPPORTED_FEATURES) { status : ErrorCode, lmp_features : 64, } packet ReadLocalExtendedFeatures : CommandPacket (op_code = READ_LOCAL_EXTENDED_FEATURES) { page_number : 8, } packet ReadLocalExtendedFeaturesComplete : CommandComplete (command_op_code = READ_LOCAL_EXTENDED_FEATURES) { status : ErrorCode, page_number : 8, maximum_page_number : 8, extended_lmp_features : 64, } packet ReadBufferSize : CommandPacket (op_code = READ_BUFFER_SIZE) { } packet ReadBufferSizeComplete : CommandComplete (command_op_code = READ_BUFFER_SIZE) { status : ErrorCode, acl_data_packet_length : 16, synchronous_data_packet_length : 8, total_num_acl_data_packets : 16, total_num_synchronous_data_packets : 16, } packet ReadBdAddr : CommandPacket (op_code = READ_BD_ADDR) { } packet ReadBdAddrComplete : CommandComplete (command_op_code = READ_BD_ADDR) { status : ErrorCode, bd_addr : Address, } packet ReadDataBlockSize : CommandPacket (op_code = READ_DATA_BLOCK_SIZE) { } packet ReadLocalSupportedCodecs : CommandPacket (op_code = READ_LOCAL_SUPPORTED_CODECS) { } packet ReadLocalSupportedCodecsComplete : CommandComplete (command_op_code = READ_LOCAL_SUPPORTED_CODECS) { status : ErrorCode, _size_(supported_codecs) : 8, supported_codecs : 8[], _size_(vendor_specific_codecs) : 8, vendor_specific_codecs : 32[], } // STATUS_PARAMETERS packet ReadFailedContactCounter : ConnectionManagementCommand (op_code = READ_FAILED_CONTACT_COUNTER) { connection_handle : 12, _reserved_ : 4, } packet ReadFailedContactCounterComplete : CommandComplete (command_op_code = READ_FAILED_CONTACT_COUNTER) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, failed_contact_counter : 16, } packet ResetFailedContactCounter : ConnectionManagementCommand (op_code = RESET_FAILED_CONTACT_COUNTER) { connection_handle : 12, _reserved_ : 4, } packet ResetFailedContactCounterComplete : CommandComplete (command_op_code = RESET_FAILED_CONTACT_COUNTER) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, } packet ReadLinkQuality : ConnectionManagementCommand (op_code = READ_LINK_QUALITY) { connection_handle : 12, _reserved_ : 4, } packet ReadLinkQualityComplete : CommandComplete (command_op_code = READ_LINK_QUALITY) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, link_quality : 8, } packet ReadRssi : ConnectionManagementCommand (op_code = READ_RSSI) { connection_handle : 12, _reserved_ : 4, } packet ReadRssiComplete : CommandComplete (command_op_code = READ_RSSI) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, rssi : 8, } packet ReadAfhChannelMap : ConnectionManagementCommand (op_code = READ_AFH_CHANNEL_MAP) { connection_handle : 12, _reserved_ : 4, } enum AfhMode : 8 { AFH_DISABLED = 0x00, AFH_ENABLED = 0x01, } packet ReadAfhChannelMapComplete : CommandComplete (command_op_code = READ_AFH_CHANNEL_MAP) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, afh_mode : AfhMode, afh_channel_map : 8[10], } enum WhichClock : 8 { LOCAL = 0x00, PICONET = 0x01, } packet ReadClock : ConnectionManagementCommand (op_code = READ_CLOCK) { connection_handle : 12, _reserved_ : 4, which_clock : WhichClock, } packet ReadClockComplete : CommandComplete (command_op_code = READ_CLOCK) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, clock : 28, _reserved_ : 4, accuracy : 16, } packet ReadEncryptionKeySize : SecurityCommand (op_code = READ_ENCRYPTION_KEY_SIZE) { connection_handle : 12, _reserved_ : 4, } packet ReadEncryptionKeySizeComplete : CommandComplete (command_op_code = READ_ENCRYPTION_KEY_SIZE) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, key_size : 8, } // TESTING enum LoopbackMode : 8 { NO_LOOPBACK = 0x00, ENABLE_LOCAL = 0x01, ENABLE_REMOTE = 0x02, } packet ReadLoopbackMode : CommandPacket (op_code = READ_LOOPBACK_MODE) { } packet ReadLoopbackModeComplete : CommandComplete (command_op_code = READ_LOOPBACK_MODE) { status : ErrorCode, loopback_mode : LoopbackMode, } packet WriteLoopbackMode : CommandPacket (op_code = WRITE_LOOPBACK_MODE) { loopback_mode : LoopbackMode, } packet WriteLoopbackModeComplete : CommandComplete (command_op_code = WRITE_LOOPBACK_MODE) { status : ErrorCode, } packet EnableDeviceUnderTestMode : CommandPacket (op_code = ENABLE_DEVICE_UNDER_TEST_MODE) { } packet EnableDeviceUnderTestModeComplete : CommandComplete (command_op_code = ENABLE_DEVICE_UNDER_TEST_MODE) { status : ErrorCode, } packet WriteSimplePairingDebugMode : SecurityCommand (op_code = WRITE_SIMPLE_PAIRING_DEBUG_MODE) { simple_pairing_debug_mode : Enable, } packet WriteSimplePairingDebugModeComplete : CommandComplete (command_op_code = WRITE_SIMPLE_PAIRING_DEBUG_MODE) { status : ErrorCode, } packet WriteSecureConnectionsTestMode : CommandPacket (op_code = WRITE_SECURE_CONNECTIONS_TEST_MODE) { connection_handle : 12, _reserved_ : 4, dm1_aclu_mode : Enable, esco_loopback_mode : Enable, } packet WriteSecureConnectionsTestModeComplete : CommandComplete (command_op_code = WRITE_SECURE_CONNECTIONS_TEST_MODE) { status : ErrorCode, } // LE_CONTROLLER packet LeSetEventMask : CommandPacket (op_code = LE_SET_EVENT_MASK) { le_event_mask : 64, } packet LeSetEventMaskComplete : CommandComplete (command_op_code = LE_SET_EVENT_MASK) { status : ErrorCode, } packet LeReadBufferSize : CommandPacket (op_code = LE_READ_BUFFER_SIZE) { } struct LeBufferSize { le_data_packet_length : 16, total_num_le_packets : 8, } packet LeReadBufferSizeComplete : CommandComplete (command_op_code = LE_READ_BUFFER_SIZE) { status : ErrorCode, le_buffer_size : LeBufferSize, } packet LeReadLocalSupportedFeatures : CommandPacket (op_code = LE_READ_LOCAL_SUPPORTED_FEATURES) { } packet LeReadLocalSupportedFeaturesComplete : CommandComplete (command_op_code = LE_READ_LOCAL_SUPPORTED_FEATURES) { status : ErrorCode, le_features : 64, } packet LeSetRandomAddress : LeAdvertisingCommand (op_code = LE_SET_RANDOM_ADDRESS) { random_address : Address, } packet LeSetRandomAddressComplete : CommandComplete (command_op_code = LE_SET_RANDOM_ADDRESS) { status : ErrorCode, } enum AdvertisingFilterPolicy : 2 { ALL_DEVICES = 0, // Default WHITELISTED_SCAN = 1, WHITELISTED_CONNECT = 2, WHITELISTED_SCAN_AND_CONNECT = 3, } enum PeerAddressType : 8 { PUBLIC_DEVICE_OR_IDENTITY_ADDRESS = 0x00, RANDOM_DEVICE_OR_IDENTITY_ADDRESS = 0x01, } enum AdvertisingEventType : 8 { ADV_IND = 0x00, ADV_DIRECT_IND = 0x01, ADV_SCAN_IND = 0x02, ADV_NONCONN_IND = 0x03, ADV_DIRECT_IND_LOW = 0x04, } enum AddressType : 8 { PUBLIC_DEVICE_ADDRESS = 0x00, RANDOM_DEVICE_ADDRESS = 0x01, PUBLIC_IDENTITY_ADDRESS = 0x02, RANDOM_IDENTITY_ADDRESS = 0x03, } packet LeSetAdvertisingParameters : LeAdvertisingCommand (op_code = LE_SET_ADVERTISING_PARAMETERS) { interval_min : 16, interval_max : 16, type : AdvertisingEventType, own_address_type : AddressType, peer_address_type : PeerAddressType, peer_address : Address, channel_map : 8, filter_policy : AdvertisingFilterPolicy, _reserved_ : 6, } packet LeSetAdvertisingParametersComplete : CommandComplete (command_op_code = LE_SET_ADVERTISING_PARAMETERS) { status : ErrorCode, } packet LeReadAdvertisingChannelTxPower : LeAdvertisingCommand (op_code = LE_READ_ADVERTISING_CHANNEL_TX_POWER) { } packet LeReadAdvertisingChannelTxPowerComplete : CommandComplete (command_op_code = LE_READ_ADVERTISING_CHANNEL_TX_POWER) { status : ErrorCode, transmit_power_level : 8, // (-20dBm to 10dBm) Accuracy: +/-4dB } packet LeSetAdvertisingData : LeAdvertisingCommand (op_code = LE_SET_ADVERTISING_DATA) { _size_(advertising_data) : 8, advertising_data : GapData[], _padding_[35], // Zero padding to 31 bytes of advertising_data + 1 size + 2 opcode + 1 total_size } packet LeSetAdvertisingDataComplete : CommandComplete (command_op_code = LE_SET_ADVERTISING_DATA) { status : ErrorCode, } packet LeSetScanResponseData : LeAdvertisingCommand (op_code = LE_SET_SCAN_RESPONSE_DATA) { _size_(advertising_data) : 8, advertising_data : GapData[], _padding_[35], // Zero padding to 31 bytes of advertising_data + 1 size + 2 opcode + 1 total_size } packet LeSetScanResponseDataComplete : CommandComplete (command_op_code = LE_SET_SCAN_RESPONSE_DATA) { status : ErrorCode, } packet LeSetAdvertisingEnable : LeAdvertisingCommand (op_code = LE_SET_ADVERTISING_ENABLE) { advertising_enable : Enable, // Default DISABLED } packet LeSetAdvertisingEnableComplete : CommandComplete (command_op_code = LE_SET_ADVERTISING_ENABLE) { status : ErrorCode, } enum LeScanType : 8 { PASSIVE = 0x00, // Default ACTIVE = 0x01, } enum LeSetScanningFilterPolicy : 8 { ACCEPT_ALL = 0x00, // Default WHITE_LIST_ONLY = 0x01, CHECK_INITIATORS_IDENTITY = 0x02, WHITE_LIST_AND_INITIATORS_IDENTITY = 0x03, } packet LeSetScanParameters : LeScanningCommand (op_code = LE_SET_SCAN_PARAMETERS) { le_scan_type : LeScanType, le_scan_interval : 16, // 0x0004-0x4000 Default 0x10 (10ms) le_scan_window : 16, // Default 0x10 (10ms) own_address_type : AddressType, scanning_filter_policy : LeSetScanningFilterPolicy, } packet LeSetScanParametersComplete : CommandComplete (command_op_code = LE_SET_SCAN_PARAMETERS) { status : ErrorCode, } packet LeSetScanEnable : LeScanningCommand (op_code = LE_SET_SCAN_ENABLE) { le_scan_enable : Enable, filter_duplicates : Enable, } packet LeSetScanEnableComplete : CommandComplete (command_op_code = LE_SET_SCAN_ENABLE) { status : ErrorCode, } enum InitiatorFilterPolicy : 8 { USE_PEER_ADDRESS = 0x00, USE_WHITE_LIST = 0x01, } enum OwnAddressType : 8 { PUBLIC_DEVICE_ADDRESS = 0x00, RANDOM_DEVICE_ADDRESS = 0x01, RESOLVABLE_OR_PUBLIC_ADDRESS = 0x02, RESOLVABLE_OR_RANDOM_ADDRESS = 0x03, } packet LeCreateConnection : LeConnectionManagementCommand (op_code = LE_CREATE_CONNECTION) { le_scan_interval : 16, // 0x0004-0x4000 le_scan_window : 16, // < = LeScanInterval initiator_filter_policy : InitiatorFilterPolicy, peer_address_type : AddressType, peer_address : Address, own_address_type : OwnAddressType, conn_interval_min : 16, // 0x0006-0x0C80 (7.5ms to 4s) conn_interval_max : 16, // 0x0006-0x0C80 (7.5ms to 4s) conn_latency : 16, // 0x0006-0x01F3 supervision_timeout : 16, // 0x00A to 0x0C80 (100ms to 32s) minimum_ce_length : 16, // 0.625ms maximum_ce_length : 16, // 0.625ms } packet LeCreateConnectionStatus : CommandStatus (command_op_code = LE_CREATE_CONNECTION) { } packet LeCreateConnectionCancel : LeConnectionManagementCommand (op_code = LE_CREATE_CONNECTION_CANCEL) { } packet LeCreateConnectionCancelStatus : CommandStatus (command_op_code = LE_CREATE_CONNECTION_CANCEL) { } packet LeCreateConnectionCancelComplete : CommandComplete (command_op_code = LE_CREATE_CONNECTION_CANCEL) { status : ErrorCode, } packet LeReadWhiteListSize : LeConnectionManagementCommand (op_code = LE_READ_WHITE_LIST_SIZE) { } packet LeReadWhiteListSizeComplete : CommandComplete (command_op_code = LE_READ_WHITE_LIST_SIZE) { status : ErrorCode, white_list_size : 8, } packet LeClearWhiteList : LeConnectionManagementCommand (op_code = LE_CLEAR_WHITE_LIST) { } packet LeClearWhiteListComplete : CommandComplete (command_op_code = LE_CLEAR_WHITE_LIST) { status : ErrorCode, } enum WhiteListAddressType : 8 { PUBLIC = 0x00, RANDOM = 0x01, ANONYMOUS_ADVERTISERS = 0xFF, } packet LeAddDeviceToWhiteList : LeConnectionManagementCommand (op_code = LE_ADD_DEVICE_TO_WHITE_LIST) { address_type : WhiteListAddressType, address : Address, } packet LeAddDeviceToWhiteListComplete : CommandComplete (command_op_code = LE_ADD_DEVICE_TO_WHITE_LIST) { status : ErrorCode, } packet LeRemoveDeviceFromWhiteList : LeConnectionManagementCommand (op_code = LE_REMOVE_DEVICE_FROM_WHITE_LIST) { address_type : WhiteListAddressType, address : Address, } packet LeRemoveDeviceFromWhiteListComplete : CommandComplete (command_op_code = LE_REMOVE_DEVICE_FROM_WHITE_LIST) { status : ErrorCode, } packet LeConnectionUpdate : LeConnectionManagementCommand (op_code = LE_CONNECTION_UPDATE) { connection_handle : 12, _reserved_ : 4, conn_interval_min : 16, // 0x0006-0x0C80 (7.5ms to 4s) conn_interval_max : 16, // 0x0006-0x0C80 (7.5ms to 4s) conn_latency : 16, // 0x0006-0x01F3 supervision_timeout : 16, // 0x00A to 0x0C80 (100ms to 32s) minimum_ce_length : 16, // 0.625ms maximum_ce_length : 16, // 0.625ms } packet LeConnectionUpdateStatus : CommandStatus (command_op_code = LE_CONNECTION_UPDATE) { } packet LeSetHostChannelClassification : LeConnectionManagementCommand (op_code = LE_SET_HOST_CHANNEL_CLASSIFICATION) { channel_map : 8[5], } packet LeSetHostChannelClassificationComplete : CommandComplete (command_op_code = LE_SET_HOST_CHANNEL_CLASSIFICATION) { status : ErrorCode, } packet LeReadChannelMap : LeConnectionManagementCommand (op_code = LE_READ_CHANNEL_MAP) { } packet LeReadChannelMapComplete : CommandComplete (command_op_code = LE_SET_HOST_CHANNEL_CLASSIFICATION) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, channel_map : 8[5], } packet LeReadRemoteFeatures : LeConnectionManagementCommand (op_code = LE_READ_REMOTE_FEATURES) { connection_handle : 12, _reserved_ : 4, } packet LeEncrypt : LeSecurityCommand (op_code = LE_ENCRYPT) { key : 8[16], plaintext_data : 8[16], } packet LeEncryptComplete : CommandComplete (command_op_code = LE_ENCRYPT) { status : ErrorCode, encrypted_data : 8[16], } packet LeRand : LeSecurityCommand (op_code = LE_RAND) { } packet LeRandComplete : CommandComplete (command_op_code = LE_RAND) { status : ErrorCode, random_number : 64, } packet LeStartEncryption : LeSecurityCommand (op_code = LE_START_ENCRYPTION) { connection_handle: 16, rand: 8[8], ediv: 16, ltk: 8[16], } packet LeStartEncryptionStatus : CommandStatus (command_op_code = LE_START_ENCRYPTION) { } packet LeLongTermKeyRequestReply : LeSecurityCommand (op_code = LE_LONG_TERM_KEY_REQUEST_REPLY) { connection_handle: 16, long_term_key: 8[16], } packet LeLongTermKeyRequestReplyComplete : CommandComplete (command_op_code = LE_LONG_TERM_KEY_REQUEST_REPLY) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, } packet LeLongTermKeyRequestNegativeReply : LeSecurityCommand (op_code = LE_LONG_TERM_KEY_REQUEST_NEGATIVE_REPLY) { connection_handle : 12, _reserved_ : 4, } packet LeLongTermKeyRequestNegativeReplyComplete : CommandComplete (command_op_code = LE_LONG_TERM_KEY_REQUEST_NEGATIVE_REPLY) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, } packet LeReadSupportedStates : CommandPacket (op_code = LE_READ_SUPPORTED_STATES) { } packet LeReadSupportedStatesComplete : CommandComplete (command_op_code = LE_READ_SUPPORTED_STATES) { status : ErrorCode, le_states : 64, } packet LeReceiverTest : CommandPacket (op_code = LE_RECEIVER_TEST) { _payload_, // placeholder (unimplemented) } packet LeTransmitterTest : CommandPacket (op_code = LE_TRANSMITTER_TEST) { _payload_, // placeholder (unimplemented) } packet LeTestEnd : CommandPacket (op_code = LE_TEST_END) { _payload_, // placeholder (unimplemented) } packet LeRemoteConnectionParameterRequestReply : LeConnectionManagementCommand (op_code = LE_REMOTE_CONNECTION_PARAMETER_REQUEST_REPLY) { connection_handle : 12, _reserved_ : 4, interval_min : 16, // 0x0006-0x0C80 (7.5ms to 4s) interval_max : 16, // 0x0006-0x0C80 (7.5ms to 4s) latency : 16, // 0x0006-0x01F3 timeout : 16, // 0x00A to 0x0C80 (100ms to 32s) minimum_ce_length : 16, // 0.625ms maximum_ce_length : 16, // 0.625ms } packet LeRemoteConnectionParameterRequestReplyComplete : CommandComplete (command_op_code = LE_REMOTE_CONNECTION_PARAMETER_REQUEST_REPLY) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, } packet LeRemoteConnectionParameterRequestNegativeReply : LeConnectionManagementCommand (op_code = LE_REMOTE_CONNECTION_PARAMETER_REQUEST_NEGATIVE_REPLY) { connection_handle : 12, _reserved_ : 4, reason : ErrorCode, } packet LeRemoteConnectionParameterRequestNegativeReplyComplete : CommandComplete (command_op_code = LE_REMOTE_CONNECTION_PARAMETER_REQUEST_NEGATIVE_REPLY) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, } packet LeSetDataLength : LeConnectionManagementCommand (op_code = LE_SET_DATA_LENGTH) { connection_handle : 12, _reserved_ : 4, tx_octets : 16, // payload octets per single PDU 0x1B to 0x00FB tx_time : 16, // microseconds used to transmit a single PDU 0x0148 to 0x4290 } packet LeSetDataLengthComplete : CommandComplete (command_op_code = LE_SET_DATA_LENGTH) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, } packet LeReadSuggestedDefaultDataLength : LeConnectionManagementCommand (op_code = LE_READ_SUGGESTED_DEFAULT_DATA_LENGTH) { } packet LeReadSuggestedDefaultDataLengthComplete : CommandComplete (command_op_code = LE_READ_SUGGESTED_DEFAULT_DATA_LENGTH) { status : ErrorCode, tx_octets : 16, // payload octets per single PDU 0x1B to 0x00FB tx_time : 16, // microseconds used to transmit a single PDU 0x0148 to 0x4290 } packet LeWriteSuggestedDefaultDataLength : LeConnectionManagementCommand (op_code = LE_WRITE_SUGGESTED_DEFAULT_DATA_LENGTH) { tx_octets : 16, // payload octets per single PDU 0x1B to 0x00FB tx_time : 16, // microseconds used to transmit a single PDU 0x0148 to 0x4290 } packet LeWriteSuggestedDefaultDataLengthComplete : CommandComplete (command_op_code = LE_WRITE_SUGGESTED_DEFAULT_DATA_LENGTH) { status : ErrorCode, } packet LeReadLocalP256PublicKeyCommand : LeSecurityCommand (op_code = LE_READ_LOCAL_P_256_PUBLIC_KEY_COMMAND) { } packet LeGenerateDhkeyV1Command : LeSecurityCommand (op_code = LE_GENERATE_DHKEY_COMMAND_V1) { remote_p_256_public_key : 8[64], } packet LeGenerateDhkeyV1CommandStatus : CommandStatus (command_op_code = LE_GENERATE_DHKEY_COMMAND_V1) { } packet LeAddDeviceToResolvingList : LeSecurityCommand (op_code = LE_ADD_DEVICE_TO_RESOLVING_LIST) { peer_identity_address_type : PeerAddressType, peer_identity_address : Address, peer_irk : 8[16], local_irk : 8[16], } packet LeAddDeviceToResolvingListComplete : CommandComplete (command_op_code = LE_ADD_DEVICE_TO_RESOLVING_LIST) { status : ErrorCode, } packet LeRemoveDeviceFromResolvingList : LeSecurityCommand (op_code = LE_REMOVE_DEVICE_FROM_RESOLVING_LIST) { peer_identity_address_type : PeerAddressType, peer_identity_address : Address, } packet LeRemoveDeviceFromResolvingListComplete : CommandComplete (command_op_code = LE_REMOVE_DEVICE_FROM_RESOLVING_LIST) { status : ErrorCode, } packet LeClearResolvingList : LeSecurityCommand (op_code = LE_CLEAR_RESOLVING_LIST) { } packet LeClearResolvingListComplete : CommandComplete (command_op_code = LE_CLEAR_RESOLVING_LIST) { status : ErrorCode, } packet LeReadResolvingListSize : LeSecurityCommand (op_code = LE_READ_RESOLVING_LIST_SIZE) { } packet LeReadResolvingListSizeComplete : CommandComplete (command_op_code = LE_READ_RESOLVING_LIST_SIZE) { status : ErrorCode, } packet LeReadPeerResolvableAddress : LeSecurityCommand (op_code = LE_READ_PEER_RESOLVABLE_ADDRESS) { peer_identity_address_type : PeerAddressType, peer_identity_address : Address, } packet LeReadPeerResolvableAddressComplete : CommandComplete (command_op_code = LE_READ_PEER_RESOLVABLE_ADDRESS) { status : ErrorCode, peer_resolvable_address : Address, } packet LeReadLocalResolvableAddress : LeSecurityCommand (op_code = LE_READ_LOCAL_RESOLVABLE_ADDRESS) { peer_identity_address_type : PeerAddressType, peer_identity_address : Address, } packet LeReadLocalResolvableAddressComplete : CommandComplete (command_op_code = LE_READ_LOCAL_RESOLVABLE_ADDRESS) { status : ErrorCode, local_resolvable_address : Address, } packet LeSetAddressResolutionEnable : LeSecurityCommand (op_code = LE_SET_ADDRESS_RESOLUTION_ENABLE) { address_resolution_enable : Enable, } packet LeSetAddressResolutionEnableComplete : CommandComplete (command_op_code = LE_SET_ADDRESS_RESOLUTION_ENABLE) { status : ErrorCode, } packet LeSetResolvablePrivateAddressTimeout : LeSecurityCommand (op_code = LE_SET_RESOLVABLE_PRIVATE_ADDRESS_TIMEOUT) { rpa_timeout : 16, // RPA_Timeout measured in seconds 0x0001 to 0xA1B8 1s to 11.5 hours } packet LeSetResolvablePrivateAddressTimeoutComplete : CommandComplete (command_op_code = LE_SET_RESOLVABLE_PRIVATE_ADDRESS_TIMEOUT) { status : ErrorCode, } packet LeReadMaximumDataLength : CommandPacket (op_code = LE_READ_MAXIMUM_DATA_LENGTH) { } struct LeMaximumDataLength { supported_max_tx_octets : 16, supported_max_tx_time: 16, supported_max_rx_octets : 16, supported_max_rx_time: 16, } packet LeReadMaximumDataLengthComplete : CommandComplete (command_op_code = LE_READ_MAXIMUM_DATA_LENGTH) { status : ErrorCode, le_maximum_data_length : LeMaximumDataLength, } packet LeReadPhy : LeConnectionManagementCommand (op_code = LE_READ_PHY) { _payload_, // placeholder (unimplemented) } packet LeSetDefaultPhy : LeConnectionManagementCommand (op_code = LE_SET_DEFAULT_PHY) { _payload_, // placeholder (unimplemented) } packet LeSetPhy : LeConnectionManagementCommand (op_code = LE_SET_PHY) { _payload_, // placeholder (unimplemented) } packet LeEnhancedReceiverTest : CommandPacket (op_code = LE_ENHANCED_RECEIVER_TEST) { _payload_, // placeholder (unimplemented) } packet LeEnhancedTransmitterTest : CommandPacket (op_code = LE_ENHANCED_TRANSMITTER_TEST) { _payload_, // placeholder (unimplemented) } packet LeSetExtendedAdvertisingRandomAddress : LeAdvertisingCommand (op_code = LE_SET_EXTENDED_ADVERTISING_RANDOM_ADDRESS) { advertising_handle : 8, advertising_random_address : Address, } packet LeSetExtendedAdvertisingRandomAddressComplete : CommandComplete (command_op_code = LE_SET_EXTENDED_ADVERTISING_RANDOM_ADDRESS) { status : ErrorCode, } // The lower 4 bits of the advertising event properties enum LegacyAdvertisingProperties : 4 { ADV_IND = 0x3, ADV_DIRECT_IND_LOW = 0x5, ADV_DIRECT_IND_HIGH = 0xD, ADV_SCAN_IND = 0x2, ADV_NONCONN_IND = 0, } enum PrimaryPhyType : 8 { LE_1M = 0x01, LE_CODED = 0x03, } enum SecondaryPhyType : 8 { NO_PACKETS = 0x00, LE_1M = 0x01, LE_2M = 0x02, LE_CODED = 0x03, } packet LeSetExtendedAdvertisingLegacyParameters : LeAdvertisingCommand (op_code = LE_SET_EXTENDED_ADVERTISING_PARAMETERS) { advertising_handle : 8, advertising_event_legacy_properties : LegacyAdvertisingProperties, _fixed_ = 0x1 : 1, // legacy bit set _reserved_ : 11, // advertising_event_properties primary_advertising_interval_min : 24, // 0x20 - 0xFFFFFF N * 0.625 ms primary_advertising_interval_max : 24, // 0x20 - 0xFFFFFF N * 0.625 ms primary_advertising_channel_map : 3, // bit 0 - Channel 37, bit 1 - 38, bit 2 - 39 _reserved_ : 5, own_address_type : OwnAddressType, peer_address_type : PeerAddressType, peer_address : Address, advertising_filter_policy : AdvertisingFilterPolicy, _reserved_ : 6, advertising_tx_power : 8, // -127 to +20, 0x7F - no preference _fixed_ = 0x1 : 8, // PrimaryPhyType LE_1M _reserved_ : 8, // secondary_advertising_max_skip _fixed_ = 0x1 : 8, // secondary_advertising_phy LE_1M advertising_sid : 8, // SID subfield from the ADI field of the PDU scan_request_notification_enable : Enable, } packet LeSetExtendedAdvertisingParameters : LeAdvertisingCommand (op_code = LE_SET_EXTENDED_ADVERTISING_PARAMETERS) { advertising_handle : 8, advertising_event_legacy_properties : 4, _fixed_ = 0 : 1, // legacy bit cleared advertising_event_properties : 3, _reserved_ : 8, primary_advertising_interval_min : 24, // 0x20 - 0xFFFFFF N * 0.625 ms primary_advertising_interval_max : 24, // 0x20 - 0xFFFFFF N * 0.625 ms primary_advertising_channel_map : 3, // bit 0 - Channel 37, bit 1 - 38, bit 2 - 39 _reserved_ : 5, own_address_type : OwnAddressType, peer_address_type : PeerAddressType, peer_address : Address, advertising_filter_policy : AdvertisingFilterPolicy, _reserved_ : 6, advertising_tx_power : 8, // -127 to +20, 0x7F - no preference primary_advertising_phy : PrimaryPhyType, secondary_advertising_max_skip : 8, // 1 to 255, 0x00 - AUX_ADV_IND sent before next advertising event secondary_advertising_phy : SecondaryPhyType, advertising_sid : 8, // SID subfield from the ADI field of the PDU scan_request_notification_enable : Enable, } packet LeSetExtendedAdvertisingParametersComplete : CommandComplete (command_op_code = LE_SET_EXTENDED_ADVERTISING_PARAMETERS) { status : ErrorCode, selected_tx_power : 8, // -127 to +20 } enum Operation : 3 { INTERMEDIATE_FRAGMENT = 0, FIRST_FRAGMENT = 1, LAST_FRAGMENT = 2, COMPLETE_ADVERTISEMENT = 3, UNCHANGED_DATA = 4, } enum FragmentPreference : 1 { CONTROLLER_MAY_FRAGMENT = 0, CONTROLLER_SHOULD_NOT = 1, } packet LeSetExtendedAdvertisingData : LeAdvertisingCommand (op_code = LE_SET_EXTENDED_ADVERTISING_DATA) { advertising_handle : 8, operation : Operation, _reserved_ : 5, fragment_preference : FragmentPreference, _reserved_ : 7, _size_(advertising_data) : 8, advertising_data : GapData[], } packet LeSetExtendedAdvertisingDataRaw : LeAdvertisingCommand (op_code = LE_SET_EXTENDED_ADVERTISING_DATA) { advertising_handle : 8, operation : Operation, _reserved_ : 5, fragment_preference : FragmentPreference, _reserved_ : 7, _size_(advertising_data) : 8, advertising_data : 8[], } packet LeSetExtendedAdvertisingDataComplete : CommandComplete (command_op_code = LE_SET_EXTENDED_ADVERTISING_DATA) { status : ErrorCode, } packet LeSetExtendedAdvertisingScanResponse : LeAdvertisingCommand (op_code = LE_SET_EXTENDED_ADVERTISING_SCAN_RESPONSE) { advertising_handle : 8, operation : Operation, _reserved_ : 5, fragment_preference : FragmentPreference, _reserved_ : 7, _size_(scan_response_data) : 8, scan_response_data : GapData[], } packet LeSetExtendedAdvertisingScanResponseRaw : LeAdvertisingCommand (op_code = LE_SET_EXTENDED_ADVERTISING_SCAN_RESPONSE) { advertising_handle : 8, operation : Operation, _reserved_ : 5, fragment_preference : FragmentPreference, _reserved_ : 7, _size_(scan_response_data) : 8, scan_response_data : 8[], } packet LeSetExtendedAdvertisingScanResponseComplete : CommandComplete (command_op_code = LE_SET_EXTENDED_ADVERTISING_SCAN_RESPONSE) { status : ErrorCode, } packet LeSetExtendedAdvertisingEnableDisableAll : LeAdvertisingCommand (op_code = LE_SET_EXTENDED_ADVERTISING_ENABLE) { _fixed_ = 0x00 : 8, // Enable::DISABLED _fixed_ = 0x00 : 8, // Disable all sets } struct EnabledSet { advertising_handle : 8, duration : 16, max_extended_advertising_events : 8, } struct DisabledSet { advertising_handle : 8, _fixed_ = 0x00 : 16, // duration _fixed_ = 0x00 : 8, // max_extended_advertising_events } packet LeSetExtendedAdvertisingDisable : LeAdvertisingCommand (op_code = LE_SET_EXTENDED_ADVERTISING_ENABLE) { _fixed_ = 0x00 : 8, // Enable::DISABLED _count_(disabled_sets) : 8, disabled_sets : DisabledSet[], } packet LeSetExtendedAdvertisingEnable : LeAdvertisingCommand (op_code = LE_SET_EXTENDED_ADVERTISING_ENABLE) { enable : Enable, _count_(enabled_sets) : 8, enabled_sets : EnabledSet[], } packet LeSetExtendedAdvertisingEnableComplete : CommandComplete (command_op_code = LE_SET_EXTENDED_ADVERTISING_ENABLE) { status : ErrorCode, } packet LeReadMaximumAdvertisingDataLength : CommandPacket (op_code = LE_READ_MAXIMUM_ADVERTISING_DATA_LENGTH) { } packet LeReadMaximumAdvertisingDataLengthComplete : CommandComplete (command_op_code = LE_READ_MAXIMUM_ADVERTISING_DATA_LENGTH) { status : ErrorCode, maximum_advertising_data_length : 16, } packet LeReadNumberOfSupportedAdvertisingSets : CommandPacket (op_code = LE_READ_NUMBER_OF_SUPPORTED_ADVERTISING_SETS) { } packet LeReadNumberOfSupportedAdvertisingSetsComplete : CommandComplete (command_op_code = LE_READ_NUMBER_OF_SUPPORTED_ADVERTISING_SETS) { status : ErrorCode, number_supported_advertising_sets : 8, } packet LeRemoveAdvertisingSet : LeAdvertisingCommand (op_code = LE_REMOVE_ADVERTISING_SET) { advertising_handle : 8, } packet LeRemoveAdvertisingSetComplete : CommandComplete (command_op_code = LE_REMOVE_ADVERTISING_SET) { status : ErrorCode, } packet LeClearAdvertisingSets : LeAdvertisingCommand (op_code = LE_CLEAR_ADVERTISING_SETS) { } packet LeClearAdvertisingSetsComplete : CommandComplete (command_op_code = LE_CLEAR_ADVERTISING_SETS) { status : ErrorCode, } packet LeSetPeriodicAdvertisingParam : LeAdvertisingCommand (op_code = LE_SET_PERIODIC_ADVERTISING_PARAM) { advertising_handle : 8, periodic_advertising_interval_min : 16, // 0x006 to 0xFFFF (7.5 ms to 82s) periodic_advertising_interval_max : 16, // 0x006 to 0xFFFF (7.5 ms to 82s) _reserved_ : 6, include_tx_power : 1, _reserved_ : 9, } packet LeSetPeriodicAdvertisingParamComplete : CommandComplete (command_op_code = LE_SET_PERIODIC_ADVERTISING_PARAM) { status : ErrorCode, } packet LeSetPeriodicAdvertisingData : LeAdvertisingCommand (op_code = LE_SET_PERIODIC_ADVERTISING_DATA) { advertising_handle : 8, operation : Operation, _reserved_ : 5, _size_(scan_response_data) : 8, scan_response_data : 8[], } packet LeSetPeriodicAdvertisingDataComplete : CommandComplete (command_op_code = LE_SET_PERIODIC_ADVERTISING_DATA) { status : ErrorCode, } packet LeSetPeriodicAdvertisingEnable : LeAdvertisingCommand (op_code = LE_SET_PERIODIC_ADVERTISING_ENABLE) { advertising_handle : 8, enable : Enable, } packet LeSetPeriodicAdvertisingEnableComplete : CommandComplete (command_op_code = LE_SET_PERIODIC_ADVERTISING_ENABLE) { status : ErrorCode, } struct PhyScanParameters { le_scan_type : LeScanType, le_scan_interval : 16, // 0x0004-0xFFFF Default 0x10 (10ms) le_scan_window : 16, // 0x004-0xFFFF Default 0x10 (10ms) } packet LeSetExtendedScanParameters : LeScanningCommand (op_code = LE_SET_EXTENDED_SCAN_PARAMETERS) { own_address_type : AddressType, scanning_filter_policy : LeSetScanningFilterPolicy, scanning_phys : 8, parameters : PhyScanParameters[], } packet LeSetExtendedScanParametersComplete : CommandComplete (command_op_code = LE_SET_EXTENDED_SCAN_PARAMETERS) { status : ErrorCode, } enum FilterDuplicates : 8 { DISABLED = 0, ENABLED = 1, RESET_EACH_PERIOD = 2, } packet LeSetExtendedScanEnable : LeScanningCommand (op_code = LE_SET_EXTENDED_SCAN_ENABLE) { enable : Enable, filter_duplicates : FilterDuplicates, duration : 16, // 0 - Scan continuously, N * 10 ms period : 16, // 0 - Scan continuously, N * 1.28 sec } packet LeSetExtendedScanEnableComplete : CommandComplete (command_op_code = LE_SET_EXTENDED_SCAN_ENABLE) { status : ErrorCode, } struct LeCreateConnPhyScanParameters { scan_interval : 16, // 0x0004-0xFFFF scan_window : 16, // < = LeScanInterval conn_interval_min : 16, // 0x0006-0x0C80 (7.5ms to 4s) conn_interval_max : 16, // 0x0006-0x0C80 (7.5ms to 4s) conn_latency : 16, // 0x0006-0x01F3 supervision_timeout : 16, // 0x00A to 0x0C80 (100ms to 32s) min_ce_length : 16, // 0.625ms max_ce_length : 16, // 0.625ms } packet LeExtendedCreateConnection : LeConnectionManagementCommand (op_code = LE_EXTENDED_CREATE_CONNECTION) { initiator_filter_policy : InitiatorFilterPolicy, own_address_type : OwnAddressType, peer_address_type : AddressType, peer_address : Address, initiating_phys : 8, phy_scan_parameters : LeCreateConnPhyScanParameters[], } packet LeExtendedCreateConnectionStatus : CommandStatus (command_op_code = LE_EXTENDED_CREATE_CONNECTION) { } packet LePeriodicAdvertisingCreateSync : LeAdvertisingCommand (op_code = LE_PERIODIC_ADVERTISING_CREATE_SYNC) { _payload_, // placeholder (unimplemented) } packet LePeriodicAdvertisingCreateSyncCancel : LeAdvertisingCommand (op_code = LE_PERIODIC_ADVERTISING_CREATE_SYNC_CANCEL) { _payload_, // placeholder (unimplemented) } packet LePeriodicAdvertisingTerminateSync : LeAdvertisingCommand (op_code = LE_PERIODIC_ADVERTISING_TERMINATE_SYNC) { _payload_, // placeholder (unimplemented) } packet LeAddDeviceToPeriodicAdvertisingList : LeAdvertisingCommand (op_code = LE_ADD_DEVICE_TO_PERIODIC_ADVERTISING_LIST) { _payload_, // placeholder (unimplemented) } packet LeRemoveDeviceFromPeriodicAdvertisingList : LeAdvertisingCommand (op_code = LE_REMOVE_DEVICE_FROM_PERIODIC_ADVERTISING_LIST) { _payload_, // placeholder (unimplemented) } packet LeClearPeriodicAdvertisingList : LeAdvertisingCommand (op_code = LE_CLEAR_PERIODIC_ADVERTISING_LIST) { _payload_, // placeholder (unimplemented) } packet LeReadPeriodicAdvertisingListSize : LeAdvertisingCommand (op_code = LE_READ_PERIODIC_ADVERTISING_LIST_SIZE) { _payload_, // placeholder (unimplemented) } packet LeReadTransmitPower : LeAdvertisingCommand (op_code = LE_READ_TRANSMIT_POWER) { _payload_, // placeholder (unimplemented) } packet LeReadRfPathCompensationPower : LeAdvertisingCommand (op_code = LE_READ_RF_PATH_COMPENSATION_POWER) { _payload_, // placeholder (unimplemented) } packet LeWriteRfPathCompensationPower : LeAdvertisingCommand (op_code = LE_WRITE_RF_PATH_COMPENSATION_POWER) { _payload_, // placeholder (unimplemented) } enum PrivacyMode : 8 { NETWORK = 0, DEVICE = 1, } packet LeSetPrivacyMode : LeSecurityCommand (op_code = LE_SET_PRIVACY_MODE) { peer_identity_address_type : PeerAddressType, peer_identity_address : Address, privacy_mode : PrivacyMode, } packet LeSetPrivacyModeComplete : CommandComplete (command_op_code = LE_SET_PRIVACY_MODE) { status : ErrorCode, } enum UseDebugKey : 8 { USE_GENERATED_KEY = 0, USE_DEBUG_KEY = 1, } packet LeGenerateDhkeyCommand : LeSecurityCommand (op_code = LE_GENERATE_DHKEY_COMMAND) { remote_p_256_public_key : 8[64], key_type : UseDebugKey, } packet LeGenerateDhkeyCommandStatus : CommandStatus (command_op_code = LE_GENERATE_DHKEY_COMMAND) { } // VENDOR_SPECIFIC packet LeGetVendorCapabilities : VendorCommand (op_code = LE_GET_VENDOR_CAPABILITIES) { } struct VendorCapabilities { is_supported : 8, max_advt_instances: 8, offloaded_resolution_of_private_address : 8, total_scan_results_storage: 16, max_irk_list_sz: 8, filtering_support: 8, max_filter: 8, activity_energy_info_support: 8, version_supported: 16, total_num_of_advt_tracked: 16, extended_scan_support: 8, debug_logging_supported: 8, le_address_generation_offloading_support: 8, a2dp_source_offload_capability_mask: 32, bluetooth_quality_report_support: 8 } struct BaseVendorCapabilities { max_advt_instances: 8, offloaded_resolution_of_private_address : 8, total_scan_results_storage: 16, max_irk_list_sz: 8, filtering_support: 8, max_filter: 8, activity_energy_info_support: 8, } packet LeGetVendorCapabilitiesComplete : CommandComplete (command_op_code = LE_GET_VENDOR_CAPABILITIES) { status : ErrorCode, base_vendor_capabilities : BaseVendorCapabilities, _payload_, } packet LeGetVendorCapabilitiesComplete095 : LeGetVendorCapabilitiesComplete { version_supported: 16, total_num_of_advt_tracked: 16, extended_scan_support: 8, debug_logging_supported: 8, _payload_, } packet LeGetVendorCapabilitiesComplete096 : LeGetVendorCapabilitiesComplete095 { le_address_generation_offloading_support: 8, _payload_, } packet LeGetVendorCapabilitiesComplete098 : LeGetVendorCapabilitiesComplete096 { a2dp_source_offload_capability_mask: 32, bluetooth_quality_report_support: 8 } enum SubOcf : 8 { SET_PARAM = 0x01, SET_DATA = 0x02, SET_SCAN_RESP = 0x03, SET_RANDOM_ADDR = 0x04, SET_ENABLE = 0x05, } packet LeMultiAdvt : LeAdvertisingCommand (op_code = LE_MULTI_ADVT) { sub_cmd : SubOcf, _body_, } packet LeMultiAdvtComplete : CommandComplete (command_op_code = LE_MULTI_ADVT) { status : ErrorCode, sub_cmd : SubOcf, } packet LeMultiAdvtParam : LeMultiAdvt (sub_cmd = SET_PARAM) { interval_min : 16, interval_max : 16, type : AdvertisingEventType, own_address_type : AddressType, peer_address_type : PeerAddressType, peer_address : Address, channel_map : 8, filter_policy : AdvertisingFilterPolicy, _reserved_ : 6, instance : 8, tx_power : 8, } packet LeMultiAdvtParamComplete : LeMultiAdvtComplete (sub_cmd = SET_PARAM) { } packet LeMultiAdvtSetData : LeMultiAdvt (sub_cmd = SET_DATA) { _size_(advertising_data) : 8, advertising_data : GapData[], _padding_[36], // Zero padding to 31 bytes of advertising_data + 1 size + 2 opcode + 1 total_size + 1 set advertising_instance : 8, } packet LeMultiAdvtSetDataComplete : LeMultiAdvtComplete (sub_cmd = SET_DATA) { } packet LeMultiAdvtSetScanResp : LeMultiAdvt (sub_cmd = SET_SCAN_RESP) { _size_(advertising_data) : 8, advertising_data : GapData[], _padding_[36], // Zero padding to 31 bytes of advertising_data + 1 size + 2 opcode + 1 total_size + 1 set advertising_instance : 8, } packet LeMultiAdvtSetScanRespComplete : LeMultiAdvtComplete (sub_cmd = SET_SCAN_RESP) { } packet LeMultiAdvtSetRandomAddr : LeMultiAdvt (sub_cmd = SET_RANDOM_ADDR) { random_address : Address, advertising_instance : 8, } packet LeMultiAdvtSetRandomAddrComplete : LeMultiAdvtComplete (sub_cmd = SET_RANDOM_ADDR) { } packet LeMultiAdvtSetEnable : LeMultiAdvt (sub_cmd = SET_ENABLE) { advertising_enable : Enable, // Default DISABLED advertising_instance : 8, } packet LeMultiAdvtSetEnableComplete : LeMultiAdvtComplete (sub_cmd = SET_ENABLE) { } packet LeBatchScan : VendorCommand (op_code = LE_BATCH_SCAN) { _payload_, // placeholder (unimplemented) } enum ApcfOpcode : 8 { ENABLE = 0x00, SET_FILTERING_PARAMETERS = 0x01, BROADCASTER_ADDRESS = 0x02, SERVICE_UUID = 0x03, SERVICE_SOLICITATION_UUID = 0x04, LOCAL_NAME = 0x05, MANUFACTURER_DATA = 0x06, SERVICE_DATA = 0x07, } packet LeAdvFilter : LeScanningCommand (op_code = LE_ADV_FILTER) { apcf_opcode : ApcfOpcode, _body_, } packet LeAdvFilterComplete : CommandComplete (command_op_code = LE_ADV_FILTER) { status : ErrorCode, apcf_opcode : ApcfOpcode, } packet LeTrackAdv : VendorCommand (op_code = LE_TRACK_ADV) { _payload_, // placeholder (unimplemented) } packet LeEnergyInfo : VendorCommand (op_code = LE_ENERGY_INFO) { _payload_, // placeholder (unimplemented) } packet LeExtendedScanParams : LeScanningCommand (op_code = LE_EXTENDED_SCAN_PARAMS) { le_scan_type : LeScanType, le_scan_interval : 32, // 0x0004-0x4000 Default 0x10 (10ms) le_scan_window : 32, // Default 0x10 (10ms) own_address_type : AddressType, scanning_filter_policy : LeSetScanningFilterPolicy, } packet LeExtendedScanParamsComplete : CommandComplete (command_op_code = LE_EXTENDED_SCAN_PARAMS) { status : ErrorCode, } packet ControllerDebugInfo : VendorCommand (op_code = CONTROLLER_DEBUG_INFO) { _payload_, // placeholder (unimplemented) } packet ControllerA2DPOpcode : VendorCommand (op_code = CONTROLLER_A2DP_OPCODE) { _payload_, // placeholder (unimplemented) } enum BqrReportAction : 8 { ADD = 0x00, DELETE = 0x01, CLEAR = 0x02, } packet ControllerBqr : VendorCommand(op_code = CONTROLLER_BQR) { bqr_report_action : BqrReportAction, bqr_quality_event_mask : 32, bqr_minimum_report_interval : 16, } packet ControllerBqrComplete : CommandComplete (command_op_code = CONTROLLER_BQR) { status : ErrorCode, current_quality_event_mask : 32 } // HCI Event Packets packet InquiryComplete : EventPacket (event_code = INQUIRY_COMPLETE){ status : ErrorCode, } struct InquiryResult { bd_addr : Address, page_scan_repetition_mode : PageScanRepetitionMode, _reserved_ : 8, _reserved_ : 8, class_of_device : ClassOfDevice, clock_offset : 15, _reserved_ : 1, } packet InquiryResult : EventPacket (event_code = INQUIRY_RESULT){ _count_(inquiry_results) : 8, inquiry_results : InquiryResult[], } enum LinkType : 8 { SCO = 0x00, ACL = 0x01, } packet ConnectionComplete : EventPacket (event_code = CONNECTION_COMPLETE){ status : ErrorCode, connection_handle : 12, _reserved_ : 4, bd_addr : Address, link_type : LinkType, encryption_enabled : Enable, } enum ConnectionRequestLinkType : 8 { SCO = 0x00, ACL = 0x01, ESCO = 0x02, } packet ConnectionRequest : EventPacket (event_code = CONNECTION_REQUEST){ bd_addr : Address, class_of_device : ClassOfDevice, link_type : ConnectionRequestLinkType, } packet DisconnectionComplete : EventPacket (event_code = DISCONNECTION_COMPLETE){ status : ErrorCode, connection_handle : 12, _reserved_ : 4, reason : ErrorCode, } packet AuthenticationComplete : EventPacket (event_code = AUTHENTICATION_COMPLETE){ status : ErrorCode, connection_handle : 12, _reserved_ : 4, } packet RemoteNameRequestComplete : EventPacket (event_code = REMOTE_NAME_REQUEST_COMPLETE){ status : ErrorCode, bd_addr : Address, remote_name : 8[248], // UTF-8 encoded user-friendly descriptive name } enum EncryptionEnabled : 8 { OFF = 0x00, ON = 0x01, // E0 for BR/EDR and AES-CCM for LE BR_EDR_AES_CCM = 0x02, } packet EncryptionChange : EventPacket (event_code = ENCRYPTION_CHANGE){ status : ErrorCode, connection_handle : 12, _reserved_ : 4, encryption_enabled : EncryptionEnabled, } packet ChangeConnectionLinkKeyComplete : EventPacket (event_code = CHANGE_CONNECTION_LINK_KEY_COMPLETE){ status : ErrorCode, connection_handle : 12, _reserved_ : 4, } packet MasterLinkKeyComplete : EventPacket (event_code = MASTER_LINK_KEY_COMPLETE){ status : ErrorCode, connection_handle : 12, _reserved_ : 4, key_flag : KeyFlag, } packet ReadRemoteSupportedFeaturesComplete : EventPacket (event_code = READ_REMOTE_SUPPORTED_FEATURES_COMPLETE){ status : ErrorCode, connection_handle : 12, _reserved_ : 4, lmp_features : 64, } packet ReadRemoteVersionInformationComplete : EventPacket (event_code = READ_REMOTE_VERSION_INFORMATION_COMPLETE){ status : ErrorCode, connection_handle : 12, _reserved_ : 4, version : 8, manufacturer_name : 16, sub_version : 16, } packet QosSetupComplete : EventPacket (event_code = QOS_SETUP_COMPLETE){ status : ErrorCode, connection_handle : 12, _reserved_ : 4, _reserved_ : 8, service_type : ServiceType, token_rate : 32, // Octets/s peak_bandwidth : 32, // Octets/s latency : 32, // Octets/s delay_variation : 32, // microseconds } // Command Complete and Command Status Events are implemented above Commands. packet HardwareError : EventPacket (event_code = HARDWARE_ERROR){ hardware_code : 8, } packet FlushOccurred : EventPacket (event_code = FLUSH_OCCURRED){ connection_handle : 12, _reserved_ : 4, } packet RoleChange : EventPacket (event_code = ROLE_CHANGE){ status : ErrorCode, bd_addr : Address, new_role : Role, } packet NumberOfCompletedPackets : EventPacket (event_code = NUMBER_OF_COMPLETED_PACKETS){ _count_(completed_packets) : 8, completed_packets : CompletedPackets[], } enum Mode : 8 { ACTIVE = 0x00, HOLD = 0x01, SNIFF = 0x02, } packet ModeChange : EventPacket (event_code = MODE_CHANGE){ status : ErrorCode, connection_handle : 12, _reserved_ : 4, current_mode : Mode, interval : 16, // 0x002 - 0xFFFE (1.25ms - 40.9s) } struct ZeroKeyAndAddress { address : Address, _fixed_ = 0 : 64, _fixed_ = 0 : 64, } packet ReturnLinkKeys : EventPacket (event_code = RETURN_LINK_KEYS){ _count_(keys) : 8, keys : ZeroKeyAndAddress[], } packet PinCodeRequest : EventPacket (event_code = PIN_CODE_REQUEST){ bd_addr : Address, } packet LinkKeyRequest : EventPacket (event_code = LINK_KEY_REQUEST){ bd_addr : Address, } enum KeyType : 8 { COMBINATION = 0x00, DEBUG_COMBINATION = 0x03, UNAUTHENTICATED_P192 = 0x04, AUTHENTICATED_P192 = 0x05, CHANGED = 0x06, UNAUTHENTICATED_P256 = 0x07, AUTHENTICATED_P256 = 0x08, } packet LinkKeyNotification : EventPacket (event_code = LINK_KEY_NOTIFICATION){ bd_addr : Address, link_key : 8[16], key_type : KeyType, } packet LoopbackCommand : EventPacket (event_code = LOOPBACK_COMMAND){ _payload_, // Command packet, truncated if it was longer than 252 bytes } packet DataBufferOverflow : EventPacket (event_code = DATA_BUFFER_OVERFLOW){ link_type : LinkType, } packet MaxSlotsChange : EventPacket (event_code = MAX_SLOTS_CHANGE){ connection_handle : 12, _reserved_ : 4, lmp_max_slots : 8, } packet ReadClockOffsetComplete : EventPacket (event_code = READ_CLOCK_OFFSET_COMPLETE){ status : ErrorCode, connection_handle : 12, _reserved_ : 4, clock_offset : 15, _reserved_ : 1, } packet ConnectionPacketTypeChanged : EventPacket (event_code = CONNECTION_PACKET_TYPE_CHANGED){ status : ErrorCode, connection_handle : 12, _reserved_ : 4, packet_type : 16, } packet QosViolation : EventPacket (event_code = QOS_VIOLATION){ _payload_, // placeholder (unimplemented) } packet PageScanRepetitionModeChange : EventPacket (event_code = PAGE_SCAN_REPETITION_MODE_CHANGE){ _payload_, // placeholder (unimplemented) } packet FlowSpecificationComplete : EventPacket (event_code = FLOW_SPECIFICATION_COMPLETE){ status : ErrorCode, connection_handle : 12, _reserved_ : 4, _reserved_ : 8, flow_direction : FlowDirection, service_type : ServiceType, token_rate : 32, // Octets/s token_bucket_size : 32, peak_bandwidth : 32, // Octets/s access_latency : 32, // Octets/s } struct InquiryResultWithRssi { address : Address, page_scan_repetition_mode : PageScanRepetitionMode, _reserved_ : 8, class_of_device : ClassOfDevice, clock_offset : 15, _reserved_ : 1, rssi : 8, } packet InquiryResultWithRssi : EventPacket (event_code = INQUIRY_RESULT_WITH_RSSI){ _count_(inquiry_results) : 8, inquiry_results : InquiryResultWithRssi[], } packet ReadRemoteExtendedFeaturesComplete : EventPacket (event_code = READ_REMOTE_EXTENDED_FEATURES_COMPLETE){ status : ErrorCode, connection_handle : 12, _reserved_ : 4, page_number : 8, maximum_page_number : 8, extended_lmp_features : 64, } packet SynchronousConnectionComplete : EventPacket (event_code = SYNCHRONOUS_CONNECTION_COMPLETE){ _payload_, // placeholder (unimplemented) } packet SynchronousConnectionChanged : EventPacket (event_code = SYNCHRONOUS_CONNECTION_CHANGED){ _payload_, // placeholder (unimplemented) } packet SniffSubratingEvent : EventPacket (event_code = SNIFF_SUBRATING){ status : ErrorCode, connection_handle : 12, _reserved_ : 4, maximum_transmit_latency : 16, // 0x000 - 0xFFFE (0s - 40.9s) maximum_receive_latency : 16, // 0x000 - 0xFFFE (0s - 40.9s) minimum_remote_timeout : 16, // 0x000 - 0xFFFE (0s - 40.9s) minimum_local_timeout : 16, // 0x000 - 0xFFFE (0s - 40.9s) } packet ExtendedInquiryResult : EventPacket (event_code = EXTENDED_INQUIRY_RESULT) { _fixed_ = 0x01 : 8, address : Address, page_scan_repetition_mode : PageScanRepetitionMode, _reserved_ : 8, class_of_device : ClassOfDevice, clock_offset : 15, _reserved_ : 1, rssi : 8, extended_inquiry_response : GapData[], } packet EncryptionKeyRefreshComplete : EventPacket (event_code = ENCRYPTION_KEY_REFRESH_COMPLETE){ status : ErrorCode, connection_handle : 12, _reserved_ : 4, } packet IoCapabilityRequest : EventPacket (event_code = IO_CAPABILITY_REQUEST){ bd_addr : Address, } packet IoCapabilityResponse : EventPacket (event_code = IO_CAPABILITY_RESPONSE){ bd_addr : Address, io_capability : IoCapability, oob_data_present : OobDataPresent, authentication_requirements : AuthenticationRequirements, } packet UserConfirmationRequest : EventPacket (event_code = USER_CONFIRMATION_REQUEST){ bd_addr : Address, numeric_value : 20, // 0x00000-0xF423F (000000 - 999999) _reserved_ : 12, } packet UserPasskeyRequest : EventPacket (event_code = USER_PASSKEY_REQUEST){ bd_addr : Address, } packet RemoteOobDataRequest : EventPacket (event_code = REMOTE_OOB_DATA_REQUEST){ bd_addr : Address, } packet SimplePairingComplete : EventPacket (event_code = SIMPLE_PAIRING_COMPLETE){ status : ErrorCode, bd_addr : Address, } packet LinkSupervisionTimeoutChanged : EventPacket (event_code = LINK_SUPERVISION_TIMEOUT_CHANGED){ connection_handle : 12, _reserved_ : 4, link_supervision_timeout : 16, // 0x001-0xFFFF (0.625ms-40.9s) } packet EnhancedFlushComplete : EventPacket (event_code = ENHANCED_FLUSH_COMPLETE){ connection_handle : 12, _reserved_ : 4, } packet UserPasskeyNotification : EventPacket (event_code = USER_PASSKEY_NOTIFICATION){ bd_addr : Address, passkey : 20, // 0x00000-0xF423F (000000 - 999999) _reserved_ : 12, } packet KeypressNotification : EventPacket (event_code = KEYPRESS_NOTIFICATION){ bd_addr : Address, notification_type : KeypressNotificationType, } packet RemoteHostSupportedFeaturesNotification : EventPacket (event_code = REMOTE_HOST_SUPPORTED_FEATURES_NOTIFICATION){ bd_addr : Address, host_supported_features : 64, } packet LeMetaEvent : EventPacket (event_code = LE_META_EVENT) { subevent_code : SubeventCode, _payload_, } packet NumberOfCompletedDataBlocks : EventPacket (event_code = NUMBER_OF_COMPLETED_DATA_BLOCKS){ _payload_, // placeholder (unimplemented) } // LE Events enum MasterClockAccuracy : 8 { PPM_500 = 0x00, PPM_250 = 0x01, PPM_150 = 0x02, PPM_100 = 0x03, PPM_75 = 0x04, PPM_50 = 0x05, PPM_30 = 0x06, PPM_20 = 0x07, } packet LeConnectionComplete : LeMetaEvent (subevent_code = CONNECTION_COMPLETE) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, role : Role, peer_address_type : AddressType, peer_address : Address, conn_interval : 16, // 0x006 - 0x0C80 (7.5ms - 4000ms) conn_latency : 16, // Number of connection events supervision_timeout : 16, // 0x000A to 0x0C80 (100ms to 32s) master_clock_accuracy : MasterClockAccuracy, } struct LeAdvertisingReport { event_type : AdvertisingEventType, address_type : AddressType, address : Address, _size_(advertising_data) : 8, advertising_data : GapData[], rssi : 8, } packet LeAdvertisingReport : LeMetaEvent (subevent_code = ADVERTISING_REPORT) { _count_(advertising_reports) : 8, advertising_reports : LeAdvertisingReport[], } packet LeConnectionUpdateComplete : LeMetaEvent (subevent_code = CONNECTION_UPDATE_COMPLETE) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, conn_interval : 16, // 0x006 - 0x0C80 (7.5ms - 4000ms) conn_latency : 16, // Number of connection events supervision_timeout : 16, // 0x000A to 0x0C80 (100ms to 32s) } packet LeReadRemoteFeaturesComplete : LeMetaEvent (subevent_code = READ_REMOTE_FEATURES_COMPLETE) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, le_features : 64, } packet LeLongTermKeyRequest : LeMetaEvent (subevent_code = LONG_TERM_KEY_REQUEST) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, random_number : 64, encrypted_diversifier : 16, } packet LeRemoteConnectionParameterRequest : LeMetaEvent (subevent_code = REMOTE_CONNECTION_PARAMETER_REQUEST) { connection_handle : 12, _reserved_ : 4, interval_min : 16, // 0x006 - 0x0C80 (7.5ms - 4s) interval_max : 16, // 0x006 - 0x0C80 (7.5ms - 4s) latency : 16, // Number of connection events (0x0000 to 0x01f3 (499) timeout : 16, // 0x000A to 0x0C80 (100ms to 32s) } packet LeDataLengthChange : LeMetaEvent (subevent_code = DATA_LENGTH_CHANGE) { connection_handle : 12, _reserved_ : 4, max_tx_octets : 16, // 0x001B - 0x00FB max_tx_time : 16, // 0x0148 - 0x4290 max_rx_octets : 16, // 0x001B - 0x00FB max_rx_time : 16, // 0x0148 - 0x4290 } packet ReadLocalP256PublicKeyComplete : LeMetaEvent (subevent_code = READ_LOCAL_P256_PUBLIC_KEY_COMPLETE) { status : ErrorCode, local_p_256_public_key : 8[64], } packet GenerateDhKeyComplete : LeMetaEvent (subevent_code = GENERATE_DHKEY_COMPLETE) { status : ErrorCode, dh_key : 8[32], } packet LeEnhancedConnectionComplete : LeMetaEvent (subevent_code = ENHANCED_CONNECTION_COMPLETE) { status : ErrorCode, connection_handle : 12, _reserved_ : 4, role : Role, peer_address_type : AddressType, peer_address : Address, local_resolvable_private_address : Address, peer_resolvable_private_address : Address, conn_interval : 16, // 0x006 - 0x0C80 (7.5ms - 4000ms) conn_latency : 16, // Number of connection events supervision_timeout : 16, // 0x000A to 0x0C80 (100ms to 32s) master_clock_accuracy : MasterClockAccuracy, } enum DirectAdvertisingAddressType : 8 { PUBLIC_DEVICE_ADDRESS = 0x00, RANDOM_DEVICE_ADDRESS = 0x01, PUBLIC_IDENTITY_ADDRESS = 0x02, RANDOM_IDENTITY_ADDRESS = 0x03, CONTROLLER_UNABLE_TO_RESOLVE = 0xFE, NO_ADDRESS = 0xFF, } enum DirectAdvertisingEventType : 8 { ADV_DIRECT_IND = 0x01, } enum DirectAddressType : 8 { RANDOM_DEVICE_ADDRESS = 0x01, } struct LeDirectedAdvertisingReport { event_type : DirectAdvertisingEventType, address_type : DirectAdvertisingAddressType, address : Address, direct_address_type : DirectAddressType, direct_address : Address, rssi : 8, } packet LeDirectedAdvertisingReport : LeMetaEvent (subevent_code = DIRECTED_ADVERTISING_REPORT) { _count_(advertising_reports) : 8, advertising_reports : LeDirectedAdvertisingReport[], } packet LePhyUpdateComplete : LeMetaEvent (subevent_code = PHY_UPDATE_COMPLETE) { _payload_, // placeholder (unimplemented) } enum DataStatus : 2 { COMPLETE = 0x0, CONTINUING = 0x1, TRUNCATED = 0x2, RESERVED = 0x3, } struct LeExtendedAdvertisingReport { connectable : 1, scannable : 1, directed : 1, scan_response : 1, data_status : DataStatus, _reserved_ : 10, address_type : DirectAdvertisingAddressType, address : Address, primary_phy : PrimaryPhyType, secondary_phy : SecondaryPhyType, advertising_sid : 4, // SID subfield in the ADI field _reserved_ : 4, tx_power : 8, rssi : 8, // -127 to +20 (0x7F means not available) periodic_advertising_interval : 16, // 0x006 to 0xFFFF (7.5 ms to 82s) direct_address_type : DirectAdvertisingAddressType, direct_address : Address, _size_(advertising_data) : 8, advertising_data : GapData[], } packet LeExtendedAdvertisingReport : LeMetaEvent (subevent_code = EXTENDED_ADVERTISING_REPORT) { _count_(advertising_reports) : 8, advertising_reports : LeExtendedAdvertisingReport[], } packet LePeriodicAdvertisingSyncEstablished : LeMetaEvent (subevent_code = PERIODIC_ADVERTISING_SYNC_ESTABLISHED) { _payload_, // placeholder (unimplemented) } packet LePeriodicAdvertisingReport : LeMetaEvent (subevent_code = PERIODIC_ADVERTISING_REPORT) { _payload_, // placeholder (unimplemented) } packet LePeriodicAdvertisingSyncLost : LeMetaEvent (subevent_code = PERIODIC_ADVERTISING_SYNC_LOST) { _payload_, // placeholder (unimplemented) } packet LeScanTimeout : LeMetaEvent (subevent_code = SCAN_TIMEOUT) { } packet LeAdvertisingSetTerminated : LeMetaEvent (subevent_code = ADVERTISING_SET_TERMINATED) { status : ErrorCode, advertising_handle : 8, connection_handle : 12, _reserved_ : 4, num_completed_extended_advertising_events : 8, } packet LeScanRequestReceived : LeMetaEvent (subevent_code = SCAN_REQUEST_RECEIVED) { advertising_handle : 8, scanner_address_type : AddressType, scanner_address : Address, } // Vendor specific events packet VendorSpecificEvent : EventPacket (event_code = VENDOR_SPECIFIC) { subevent_code : VseSubeventCode, _payload_, } enum qualityReportId : 8 { MONITOR_MODE = 0x01, APPROACH_LSTO = 0x02, A2DP_AUDIO_CHOPPY = 0x03, SCO_VOICE_CHOPPY = 0x04, ROOT_INFLAMMATION = 0x05, LMP_LL_MESSAGE_TRACE = 0x11, BT_SCHEDULING_TRACE = 0x12, CONTROLLER_DBG_INFO = 0x13, } packet BqrEvent : VendorSpecificEvent (subevent_code = BQR_EVENT) { quality_report_id : qualityReportId, _payload_, } enum BqrPacketType : 8 { TYPE_ID = 0x01, TYPE_NULL = 0x02, TYPE_POLL = 0x03, TYPE_FHS = 0x04, TYPE_HV1 = 0x05, TYPE_HV2 = 0x06, TYPE_HV3 = 0x07, TYPE_DV = 0x08, TYPE_EV3 = 0x09, TYPE_EV4 = 0x0A, TYPE_EV5 = 0x0B, TYPE_2EV3 = 0x0C, TYPE_2EV5 = 0x0D, TYPE_3EV3 = 0x0E, TYPE_3EV5 = 0x0F, TYPE_DM1 = 0x10, TYPE_DH1 = 0x11, TYPE_DM3 = 0x12, TYPE_DH3 = 0x13, TYPE_DM5 = 0x14, TYPE_DH5 = 0x15, TYPE_AUX1 = 0x16, TYPE_2DH1 = 0x17, TYPE_2DH3 = 0x18, TYPE_2DH5 = 0x19, TYPE_3DH1 = 0x1A, TYPE_3DH3 = 0x1B, TYPE_3DH5 = 0x1C, } packet BqrLinkQualityEvent : BqrEvent { packet_type : BqrPacketType, connection_handle : 12, _reserved_ : 4, connection_role : Role, tx_power_level : 8, rssi : 8, snr : 8, unused_afh_channel_count : 8, afh_select_unideal_channel_count : 8, lsto : 16, connection_piconet_clock : 32, retransmission_count : 32, no_rx_count : 32, nak_count : 32, last_tx_ack_timestamp : 32, flow_off_count : 32, last_flow_on_timestamp : 32, buffer_overflow_bytes : 32, buffer_underflow_bytes : 32, _payload_, } packet BqrMonitorModeEvent : BqrLinkQualityEvent (quality_report_id = MONITOR_MODE) { _payload_, // vendor specific parameter } packet BqrApproachLstoEvent : BqrLinkQualityEvent (quality_report_id = APPROACH_LSTO) { _payload_, // vendor specific parameter } packet BqrA2dpAudioChoppyEvent : BqrLinkQualityEvent (quality_report_id = A2DP_AUDIO_CHOPPY) { _payload_, // vendor specific parameter } packet BqrScoVoiceChoppyEvent : BqrLinkQualityEvent (quality_report_id = SCO_VOICE_CHOPPY) { _payload_, // vendor specific parameter } packet BqrRootInflammationEvent : BqrEvent (quality_report_id = ROOT_INFLAMMATION) { error_code : 8, vendor_specific_error_code : 8, _payload_, // vendor specific parameter } packet BqrLogDumpEvent : BqrEvent { connection_handle : 12, _reserved_ : 4, _payload_, } packet BqrLmpLlMessageTraceEvent : BqrLogDumpEvent (quality_report_id = LMP_LL_MESSAGE_TRACE) { _payload_, // vendor specific parameter } packet BqrBtSchedulingTraceEvent : BqrLogDumpEvent (quality_report_id = BT_SCHEDULING_TRACE) { _payload_, // vendor specific parameter } packet BqrControllerDbgInfoEvent : BqrLogDumpEvent (quality_report_id = CONTROLLER_DBG_INFO) { _payload_, // vendor specific parameter }