Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ca23462 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge changes Ia06fbdda,I08306608,I8e43aee4 am: 033df4fd am: e821d7ab

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1633701

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2f93b3cb780ca3cec21765e2bc03068e79cce40b
parents 694fa051 e821d7ab
Loading
Loading
Loading
Loading
+315 −50
Original line number Diff line number Diff line
@@ -246,7 +246,7 @@ enum OpCode : 16 {
  READ_LOCAL_SUPPORTED_CODECS_V1 = 0x100B,
  READ_LOCAL_SUPPORTED_CODECS_V2 = 0x100D,
  READ_LOCAL_SUPPORTED_CODEC_CAPABILITIES = 0x100E,
  READ_LOCAL_SUPPORTED_CONTROLLER_DELAY = 0X100F,
  READ_LOCAL_SUPPORTED_CONTROLLER_DELAY = 0x100F,

  // STATUS_PARAMETERS
  READ_FAILED_CONTACT_COUNTER = 0x1401,
@@ -343,35 +343,35 @@ enum OpCode : 16 {
  LE_READ_RF_PATH_COMPENSATION_POWER = 0x204C,
  LE_WRITE_RF_PATH_COMPENSATION_POWER = 0x204D,
  LE_SET_PRIVACY_MODE = 0x204E,
  LE_SET_PERIODIC_ADVERTISING_RECEIVE_ENABLE = 0X2059,
  LE_PERIODIC_ADVERTISING_SYNC_TRANSFER = 0X205A,
  LE_PERIODIC_ADVERTISING_SET_INFO_TRANSFER = 0X205B,
  LE_SET_PERIODIC_ADVERTISING_SYNC_TRANSFER_PARAMETERS = 0X205C,
  LE_SET_DEFAULT_PERIODIC_ADVERTISING_SYNC_TRANSFER_PARAMETERS = 0X205D,
  LE_SET_PERIODIC_ADVERTISING_RECEIVE_ENABLE = 0x2059,
  LE_PERIODIC_ADVERTISING_SYNC_TRANSFER = 0x205A,
  LE_PERIODIC_ADVERTISING_SET_INFO_TRANSFER = 0x205B,
  LE_SET_PERIODIC_ADVERTISING_SYNC_TRANSFER_PARAMETERS = 0x205C,
  LE_SET_DEFAULT_PERIODIC_ADVERTISING_SYNC_TRANSFER_PARAMETERS = 0x205D,
  LE_GENERATE_DHKEY_COMMAND = 0x205E,
  LE_MODIFY_SLEEP_CLOCK_ACCURACY = 0X205F,
  LE_MODIFY_SLEEP_CLOCK_ACCURACY = 0x205F,
  LE_READ_BUFFER_SIZE_V2 = 0x2060,
  LE_READ_ISO_TX_SYNC = 0X2061,
  LE_SET_CIG_PARAMETERS = 0X2062,
  LE_READ_ISO_TX_SYNC = 0x2061,
  LE_SET_CIG_PARAMETERS = 0x2062,
  LE_SET_CIG_PARAMETERS_TEST = 0x2063,
  LE_CREATE_CIS = 0X2064,
  LE_REMOVE_CIG = 0X2065,
  LE_ACCEPT_CIS_REQUEST = 0X2066,
  LE_REJECT_CIS_REQUEST = 0X2067,
  LE_CREATE_BIG = 0X2068,
  LE_TERMINATE_BIG = 0X206A,
  LE_BIG_CREATE_SYNC = 0X206B,
  LE_BIG_TERMINATE_SYNC = 0X206C,
  LE_REQUEST_PEER_SCA = 0X206D,
  LE_SETUP_ISO_DATA_PATH = 0X206E,
  LE_REMOVE_ISO_DATA_PATH = 0X206F,
  LE_SET_HOST_FEATURE = 0X2074,
  LE_READ_ISO_LINK_QUALITY = 0X2075,
  LE_ENHANCED_READ_TRANSMIT_POWER_LEVEL = 0X2076,
  LE_READ_REMOTE_TRANSMIT_POWER_LEVEL = 0X2077,
  LE_SET_PATH_LOSS_REPORTING_PARAMETERS = 0X2078,
  LE_SET_PATH_LOSS_REPORTING_ENABLE = 0X2079,
  LE_SET_TRANSMIT_POWER_REPORTING_ENABLE = 0X207A,
  LE_CREATE_CIS = 0x2064,
  LE_REMOVE_CIG = 0x2065,
  LE_ACCEPT_CIS_REQUEST = 0x2066,
  LE_REJECT_CIS_REQUEST = 0x2067,
  LE_CREATE_BIG = 0x2068,
  LE_TERMINATE_BIG = 0x206A,
  LE_BIG_CREATE_SYNC = 0x206B,
  LE_BIG_TERMINATE_SYNC = 0x206C,
  LE_REQUEST_PEER_SCA = 0x206D,
  LE_SETUP_ISO_DATA_PATH = 0x206E,
  LE_REMOVE_ISO_DATA_PATH = 0x206F,
  LE_SET_HOST_FEATURE = 0x2074,
  LE_READ_ISO_LINK_QUALITY = 0x2075,
  LE_ENHANCED_READ_TRANSMIT_POWER_LEVEL = 0x2076,
  LE_READ_REMOTE_TRANSMIT_POWER_LEVEL = 0x2077,
  LE_SET_PATH_LOSS_REPORTING_PARAMETERS = 0x2078,
  LE_SET_PATH_LOSS_REPORTING_ENABLE = 0x2079,
  LE_SET_TRANSMIT_POWER_REPORTING_ENABLE = 0x207A,

  // VENDOR_SPECIFIC
  LE_GET_VENDOR_CAPABILITIES = 0xFD53,
@@ -746,21 +746,21 @@ enum SubeventCode : 8 {
  SCAN_TIMEOUT = 0x11,
  ADVERTISING_SET_TERMINATED = 0x12,
  SCAN_REQUEST_RECEIVED = 0x13,
  CHANNEL_SELECTION_ALGORITHM = 0X14,
  CONNECTIONLESS_IQ_REPORT = 0X15,
  CONNECTION_IQ_REPORT = 0X16,
  CTE_REQUEST_FAILED = 0X17,
  PERIODIC_ADVERTISING_SYNC_TRANSFER_RECEIVED = 0X18,
  CIS_ESTABLISHED = 0X19,
  CIS_REQUEST = 0X1A,
  CREATE_BIG_COMPLETE = 0X1B,
  TERMINATE_BIG_COMPLETE = 0X1C,
  BIG_SYNC_ESTABLISHED = 0X1D,
  BIG_SYNC_LOST = 0X1E,
  REQUEST_PEER_SCA_COMPLETE = 0X1F,
  PATH_LOSS_THRESHOLD = 0X20,
  TRANSMIT_POWER_REPORTING = 0X21,
  BIG_INFO_ADVERTISING_REPORT = 0X22,
  CHANNEL_SELECTION_ALGORITHM = 0x14,
  CONNECTIONLESS_IQ_REPORT = 0x15,
  CONNECTION_IQ_REPORT = 0x16,
  CTE_REQUEST_FAILED = 0x17,
  PERIODIC_ADVERTISING_SYNC_TRANSFER_RECEIVED = 0x18,
  CIS_ESTABLISHED = 0x19,
  CIS_REQUEST = 0x1A,
  CREATE_BIG_COMPLETE = 0x1B,
  TERMINATE_BIG_COMPLETE = 0x1C,
  BIG_SYNC_ESTABLISHED = 0x1D,
  BIG_SYNC_LOST = 0x1E,
  REQUEST_PEER_SCA_COMPLETE = 0x1F,
  PATH_LOSS_THRESHOLD = 0x20,
  TRANSMIT_POWER_REPORTING = 0x21,
  BIG_INFO_ADVERTISING_REPORT = 0x22,
}

// Vendor specific events
@@ -852,16 +852,32 @@ packet Inquiry : DiscoveryCommand (op_code = INQUIRY) {
  num_responses : 8, // 0x00 unlimited
}

test Inquiry {
  "\x01\x04\x05\x33\x8b\x9e\xaa\xbb",
}

packet InquiryStatus : CommandStatus (command_op_code = INQUIRY) {
}

test InquiryStatus {
  "\x0f\x04\x00\x01\x01\x04",
}

packet InquiryCancel : DiscoveryCommand (op_code = INQUIRY_CANCEL) {
}

test InquiryCancel {
  "\x02\x04\x00",
}

packet InquiryCancelComplete : CommandComplete (command_op_code = INQUIRY_CANCEL) {
  status : ErrorCode,
}

test InquiryCancelComplete {
  "\x0e\x04\x01\x02\x04\x00",
}

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)
@@ -870,17 +886,33 @@ packet PeriodicInquiryMode : DiscoveryCommand (op_code = PERIODIC_INQUIRY_MODE)
  num_responses : 8, // 0x00 unlimited
}

test PeriodicInquiryMode {
  "\x03\x04\x09\x12\x34\x56\x78\x11\x8b\x9e\x9a\xbc",
}

packet PeriodicInquiryModeComplete : CommandComplete (command_op_code = PERIODIC_INQUIRY_MODE) {
  status : ErrorCode,
}

test PeriodicInquiryModeComplete {
  "\x0e\x04\x01\x03\x04\x00",
}

packet ExitPeriodicInquiryMode : DiscoveryCommand (op_code = EXIT_PERIODIC_INQUIRY_MODE) {
}

test ExitPeriodicInquiryMode {
  "\x04\x04\x00",
}

packet ExitPeriodicInquiryModeComplete : CommandComplete (command_op_code = EXIT_PERIODIC_INQUIRY_MODE) {
  status : ErrorCode,
}

test ExitPeriodicInquiryModeComplete {
  "\x0e\x04\x01\x04\x04\x00",
}

enum PageScanRepetitionMode : 8 {
  R0 = 0x00,
  R1 = 0x01,
@@ -1274,7 +1306,7 @@ struct ScoCodingFormat {

enum ScoPcmDataFormat : 8 {
  NOT_USED = 0x00,
  ONES_COMPLEMENT = 0X01,
  ONES_COMPLEMENT = 0x01,
  TWOS_COMPLEMENT = 0x02,
  SIGN_MAGNITUDE = 0x03,
  UNSIGNED = 0x04,
@@ -1794,19 +1826,35 @@ packet WriteConnectionAcceptTimeoutComplete : CommandComplete (command_op_code =
packet ReadPageTimeout : DiscoveryCommand (op_code = READ_PAGE_TIMEOUT) {
}

test ReadPageTimeout {
  "\x17\x0c\x00",
}

packet ReadPageTimeoutComplete : CommandComplete (command_op_code = READ_PAGE_TIMEOUT) {
  status : ErrorCode,
  page_timeout : 16,
}

test ReadPageTimeoutComplete {
  "\x0e\x06\x01\x17\x0c\x00\x11\x22",
}

packet WritePageTimeout : DiscoveryCommand (op_code = WRITE_PAGE_TIMEOUT) {
  page_timeout : 16,
}

test WritePageTimeout {
  "\x18\x0c\x02\x00\x20",
}

packet WritePageTimeoutComplete : CommandComplete (command_op_code = WRITE_PAGE_TIMEOUT) {
  status : ErrorCode,
}

test WritePageTimeoutComplete {
  "\x0e\x04\x01\x18\x0c\x00",
}

enum ScanEnable : 8 {
  NO_SCANS = 0x00,
  INQUIRY_SCAN_ONLY = 0x01,
@@ -1851,21 +1899,37 @@ packet WritePageScanActivityComplete : CommandComplete (command_op_code = WRITE_
packet ReadInquiryScanActivity : DiscoveryCommand (op_code = READ_INQUIRY_SCAN_ACTIVITY) {
}

test ReadInquiryScanActivity {
  "\x1d\x0c\x00",
}

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
}

test ReadInquiryScanActivityComplete {
  "\x0e\x08\x01\x1d\x0c\x00\xaa\xbb\xcc\xdd",
}

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
}

test WriteInquiryScanActivity {
  "\x1e\x0c\x04\x00\x08\x12\x00",
}

packet WriteInquiryScanActivityComplete : CommandComplete (command_op_code = WRITE_INQUIRY_SCAN_ACTIVITY) {
  status : ErrorCode,
}

test WriteInquiryScanActivityComplete {
  "\x0e\x04\x01\x1e\x0c\x00",
}

enum AuthenticationEnable : 8 {
  NOT_REQUIRED = 0x00,
  REQUIRED = 0x01,
@@ -2036,10 +2100,18 @@ packet HostBufferSize : Command (op_code = HOST_BUFFER_SIZE) {
  host_total_num_synchronous_data_packets : 16,
}

test HostBufferSize {
  "\x33\x0c\x07\x9b\x06\xff\x14\x00\x0a\x00",
}

packet HostBufferSizeComplete : CommandComplete (command_op_code = HOST_BUFFER_SIZE) {
  status : ErrorCode,
}

test HostBufferSizeComplete {
  "\x0e\x04\x01\x33\x0c\x00",
}

struct CompletedPackets {
  connection_handle : 12,
  _reserved_ : 4,
@@ -2082,29 +2154,53 @@ packet WriteLinkSupervisionTimeoutComplete : CommandComplete (command_op_code =
packet ReadNumberOfSupportedIac : DiscoveryCommand (op_code = READ_NUMBER_OF_SUPPORTED_IAC) {
}

test ReadNumberOfSupportedIac {
  "\x38\x0c\x00",
}

packet ReadNumberOfSupportedIacComplete : CommandComplete (command_op_code = READ_NUMBER_OF_SUPPORTED_IAC) {
  status : ErrorCode,
  num_support_iac : 8,
}

test ReadNumberOfSupportedIacComplete {
  "\x0e\x05\x01\x38\x0c\x00\x99",
}

packet ReadCurrentIacLap : DiscoveryCommand (op_code = READ_CURRENT_IAC_LAP) {
}

test ReadCurrentIacLap {
  "\x39\x0c\x00",
}

packet ReadCurrentIacLapComplete : CommandComplete (command_op_code = READ_CURRENT_IAC_LAP) {
  status : ErrorCode,
  _count_(laps_to_read) : 8,
  laps_to_read : Lap[],
}

test ReadCurrentIacLapComplete {
  "\x0e\x0b\x01\x39\x0c\x00\x02\x11\x8b\x9e\x22\x8b\x9e",
}

packet WriteCurrentIacLap : DiscoveryCommand (op_code = WRITE_CURRENT_IAC_LAP) {
  _count_(laps_to_write) : 8,
  laps_to_write : Lap[],
}

test WriteCurrentIacLap {
  "\x3a\x0c\x07\x02\x11\x8b\x9e\x22\x8b\x9e",
}

packet WriteCurrentIacLapComplete : CommandComplete (command_op_code = WRITE_CURRENT_IAC_LAP) {
  status : ErrorCode,
}

test WriteCurrentIacLapComplete {
  "\x0e\x04\x01\x3a\x0c\x00",
}

packet SetAfhHostChannelClassification : Command (op_code = SET_AFH_HOST_CHANNEL_CLASSIFICATION) {
  afh_host_channel_classification : 8[10],
}
@@ -2210,7 +2306,11 @@ packet ReadExtendedInquiryResponseComplete : CommandComplete (command_op_code =
packet WriteExtendedInquiryResponse : Command (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)
  _padding_[240], // Zero padding GapData[] to be 240 octets
}

test WriteExtendedInquiryResponse {
  "\x52\x0c\xf1\x01\x0b\x09\x50\x69\x78\x65\x6c\x20\x33\x20\x58\x4c\x19\x03\x05\x11\x0a\x11\x0c\x11\x0e\x11\x12\x11\x15\x11\x16\x11\x1f\x11\x2d\x11\x2f\x11\x00\x12\x32\x11\x01\x05\x81\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
}

packet WriteExtendedInquiryResponseComplete : CommandComplete (command_op_code = WRITE_EXTENDED_INQUIRY_RESPONSE) {
@@ -2237,10 +2337,18 @@ packet WriteSimplePairingMode : SecurityCommand (op_code = WRITE_SIMPLE_PAIRING_
  simple_pairing_mode : Enable,
}

test WriteSimplePairingMode {
  "\x56\x0c\x01\x01",
}

packet WriteSimplePairingModeComplete : CommandComplete (command_op_code = WRITE_SIMPLE_PAIRING_MODE) {
  status : ErrorCode,
}

test WriteSimplePairingModeComplete {
  "\x0e\x04\x01\x56\x0c\x00",
}

packet ReadLocalOobData : SecurityCommand (op_code = READ_LOCAL_OOB_DATA) {
}

@@ -2298,10 +2406,18 @@ packet WriteLeHostSupport : Command (op_code = WRITE_LE_HOST_SUPPORT) {
  simultaneous_le_host : Enable,  // According to the spec, this should be 0x00 since 4.1
}

test WriteLeHostSupport {
  "\x6d\x0c\x02\x01\x01",
}

packet WriteLeHostSupportComplete : CommandComplete (command_op_code = WRITE_LE_HOST_SUPPORT) {
  status : ErrorCode,
}

test WriteLeHostSupportComplete {
  "\x0e\x04\x01\x6d\x0c\x00",
}

packet ReadSecureConnectionsHostSupport : Command (op_code = READ_SECURE_CONNECTIONS_HOST_SUPPORT) {
}

@@ -2314,10 +2430,18 @@ packet WriteSecureConnectionsHostSupport : SecurityCommand (op_code = WRITE_SECU
  secure_connections_host_support : Enable,
}

test WriteSecureConnectionsHostSupport {
  "\x7a\x0c\x01\x01",
}

packet WriteSecureConnectionsHostSupportComplete : CommandComplete (command_op_code = WRITE_SECURE_CONNECTIONS_HOST_SUPPORT) {
  status : ErrorCode,
}

test WriteSecureConnectionsHostSupportComplete {
  "\x0e\x04\x01\x7a\x0c\x00",
}

packet ReadLocalOobExtendedData : SecurityCommand (op_code = READ_LOCAL_OOB_EXTENDED_DATA) {
}

@@ -2358,6 +2482,10 @@ packet ConfigureDataPathComplete : CommandComplete (command_op_code = CONFIGURE_
packet ReadLocalVersionInformation : Command (op_code = READ_LOCAL_VERSION_INFORMATION) {
}

test ReadLocalVersionInformation {
  "\x01\x10\x00",
}

enum HciVersion : 8 {
  V_1_0B = 0x00,
  V_1_1 = 0x01,
@@ -2399,14 +2527,26 @@ packet ReadLocalVersionInformationComplete : CommandComplete (command_op_code =
  local_version_information : LocalVersionInformation,
}

test ReadLocalVersionInformationComplete {
  "\x0e\x0c\x01\x01\x10\x00\x09\x00\x00\x09\x1d\x00\xbe\x02",
}

packet ReadLocalSupportedCommands : Command (op_code = READ_LOCAL_SUPPORTED_COMMANDS) {
}

test ReadLocalSupportedCommands {
  "\x02\x10\x00",
}

packet ReadLocalSupportedCommandsComplete : CommandComplete (command_op_code = READ_LOCAL_SUPPORTED_COMMANDS) {
  status : ErrorCode,
  supported_commands : 8[64],
}

test ReadLocalSupportedCommandsComplete {
  "\x0e\x44\x01\x02\x10\x00\xff\xff\xff\x03\xce\xff\xef\xff\xff\xff\xff\x7f\xf2\x0f\xe8\xfe\x3f\xf7\x83\xff\x1c\x00\x00\x00\x61\xff\xff\xff\x7f\xbe\x20\xf5\xff\xf0\xff\xff\xff\xff\xff\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
}

packet ReadLocalSupportedFeatures : Command (op_code = READ_LOCAL_SUPPORTED_FEATURES) {
}

@@ -2419,6 +2559,12 @@ packet ReadLocalExtendedFeatures : Command (op_code = READ_LOCAL_EXTENDED_FEATUR
  page_number : 8,
}

test ReadLocalExtendedFeatures {
  "\x04\x10\x01\x00",
  "\x04\x10\x01\x01",
  "\x04\x10\x01\x02",
}

packet ReadLocalExtendedFeaturesComplete : CommandComplete (command_op_code = READ_LOCAL_EXTENDED_FEATURES) {
  status : ErrorCode,
  page_number : 8,
@@ -2426,9 +2572,19 @@ packet ReadLocalExtendedFeaturesComplete : CommandComplete (command_op_code = RE
  extended_lmp_features : 64,
}

test ReadLocalExtendedFeaturesComplete {
  "\x0e\x0e\x01\x04\x10\x00\x00\x02\xff\xfe\x8f\xfe\xd8\x3f\x5b\x87",
  "\x0e\x0e\x01\x04\x10\x00\x01\x02\x07\x00\x00\x00\x00\x00\x00\x00",
  "\x0e\x0e\x01\x04\x10\x00\x02\x02\x45\x03\x00\x00\x00\x00\x00\x00",
}

packet ReadBufferSize : Command (op_code = READ_BUFFER_SIZE) {
}

test ReadBufferSize {
  "\x05\x10\x00",
}

packet ReadBufferSizeComplete : CommandComplete (command_op_code = READ_BUFFER_SIZE) {
  status : ErrorCode,
  acl_data_packet_length : 16,
@@ -2437,14 +2593,26 @@ packet ReadBufferSizeComplete : CommandComplete (command_op_code = READ_BUFFER_S
  total_num_synchronous_data_packets : 16,
}

test ReadBufferSizeComplete {
  "\x0e\x0b\x01\x05\x10\x00\x00\x04\x3c\x07\x00\x08\x00",
}

packet ReadBdAddr : Command (op_code = READ_BD_ADDR) {
}

test ReadBdAddr {
  "\x09\x10\x00",
}

packet ReadBdAddrComplete : CommandComplete (command_op_code = READ_BD_ADDR) {
  status : ErrorCode,
  bd_addr : Address,
}

test ReadBdAddrComplete {
  "\x0e\x0a\x01\x09\x10\x00\x14\x8e\x61\x5f\x36\x88",
}

packet ReadDataBlockSize : Command (op_code = READ_DATA_BLOCK_SIZE) {
}

@@ -2697,11 +2865,19 @@ struct LeBufferSize {
  total_num_le_packets : 8,
}

test LeReadBufferSizeV1 {
  "\x02\x20\x00",
}

packet LeReadBufferSizeV1Complete : CommandComplete (command_op_code = LE_READ_BUFFER_SIZE_V1) {
  status : ErrorCode,
  le_buffer_size : LeBufferSize,
}

test LeReadBufferSizeV1Complete {
  "\x0e\x07\x01\x02\x20\x00\xfb\x00\x10",
}

packet LeReadLocalSupportedFeatures : Command (op_code = LE_READ_LOCAL_SUPPORTED_FEATURES) {
}

@@ -2779,7 +2955,7 @@ packet LeReadAdvertisingPhysicalChannelTxPowerComplete : CommandComplete (comman
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
  _padding_[31], // Zero padding to 31 bytes of advertising_data
}

packet LeSetAdvertisingDataComplete : CommandComplete (command_op_code = LE_SET_ADVERTISING_DATA) {
@@ -2789,7 +2965,7 @@ packet LeSetAdvertisingDataComplete : CommandComplete (command_op_code = LE_SET_
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
  _padding_[31], // Zero padding to 31 bytes of advertising_data
}

packet LeSetScanResponseDataComplete : CommandComplete (command_op_code = LE_SET_SCAN_RESPONSE_DATA) {
@@ -2824,6 +3000,10 @@ packet LeSetScanParameters : LeScanningCommand (op_code = LE_SET_SCAN_PARAMETERS
  scanning_filter_policy : LeScanningFilterPolicy,
}

test LeSetScanParameters {
  "\x0b\x20\x07\x01\x12\x00\x12\x00\x01\x00",
}

packet LeSetScanParametersComplete : CommandComplete (command_op_code = LE_SET_SCAN_PARAMETERS) {
  status : ErrorCode,
}
@@ -2833,6 +3013,10 @@ packet LeSetScanEnable : LeScanningCommand (op_code = LE_SET_SCAN_ENABLE) {
  filter_duplicates : Enable,
}

test LeSetScanEnable {
  "\x0c\x20\x02\x01\x00",
}

packet LeSetScanEnableComplete : CommandComplete (command_op_code = LE_SET_SCAN_ENABLE) {
  status : ErrorCode,
}
@@ -2870,11 +3054,19 @@ packet LeCreateConnectionCancelComplete : CommandComplete (command_op_code = LE_
packet LeReadConnectListSize : Command (op_code = LE_READ_CONNECT_LIST_SIZE) {
}

test LeReadConnectListSize {
  "\x0f\x20\x00",
}

packet LeReadConnectListSizeComplete : CommandComplete (command_op_code = LE_READ_CONNECT_LIST_SIZE) {
  status : ErrorCode,
  connect_list_size : 8,
}

test LeReadConnectListSizeComplete {
  "\x0e\x05\x01\x0f\x20\x00\x80",
}

packet LeClearConnectList : LeConnectionManagementCommand (op_code = LE_CLEAR_CONNECT_LIST) {
}

@@ -3285,10 +3477,18 @@ packet LeSetExtendedAdvertisingRandomAddress : LeAdvertisingCommand (op_code = L
  advertising_random_address : Address,
}

test LeSetExtendedAdvertisingRandomAddress {
  "\x35\x20\x07\x00\x77\x58\xeb\xd3\x1c\x6e",
}

packet LeSetExtendedAdvertisingRandomAddressComplete : CommandComplete (command_op_code = LE_SET_EXTENDED_ADVERTISING_RANDOM_ADDRESS) {
  status : ErrorCode,
}

test LeSetExtendedAdvertisingRandomAddressComplete {
  "\x0e\x04\x01\x35\x20\x00",
}

// The lower 4 bits of the advertising event properties
enum LegacyAdvertisingProperties : 4 {
  ADV_IND = 0x3,
@@ -3355,6 +3555,11 @@ packet LeSetExtendedAdvertisingParameters : LeAdvertisingCommand (op_code = LE_S
  scan_request_notification_enable : Enable,
}

test LeSetExtendedAdvertisingParameters {
  "\x36\x20\x19\x00\x13\x00\x90\x01\x00\xc2\x01\x00\x07\x01\x00\x00\x00\x00\x00\x00\x00\x00\xf9\x01\x00\x01\x01\x00",
  "\x36\x20\x19\x01\x13\x00\x90\x01\x00\xc2\x01\x00\x07\x01\x00\x00\x00\x00\x00\x00\x00\x00\xf9\x01\x00\x01\x01\x00",
}

packet LeSetExtendedAdvertisingParametersComplete : CommandComplete (command_op_code = LE_SET_EXTENDED_ADVERTISING_PARAMETERS) {
  status : ErrorCode,
  selected_tx_power : 8, // -127 to +20
@@ -3383,6 +3588,10 @@ packet LeSetExtendedAdvertisingData : LeAdvertisingCommand (op_code = LE_SET_EXT
  advertising_data : GapData[],
}

test LeSetExtendedAdvertisingData {
  "\x37\x20\x12\x00\x03\x01\x0e\x02\x01\x02\x0a\x09\x50\x69\x78\x65\x6c\x20\x33\x20\x58",
}

packet LeSetExtendedAdvertisingDataRaw : LeAdvertisingCommand (op_code = LE_SET_EXTENDED_ADVERTISING_DATA) {
  advertising_handle : 8,
  operation : Operation,
@@ -3397,6 +3606,10 @@ packet LeSetExtendedAdvertisingDataComplete : CommandComplete (command_op_code =
  status : ErrorCode,
}

test LeSetExtendedAdvertisingDataComplete {
  "\x0e\x04\x01\x37\x20\x00",
}

packet LeSetExtendedAdvertisingScanResponse : LeAdvertisingCommand (op_code = LE_SET_EXTENDED_ADVERTISING_SCAN_RESPONSE) {
  advertising_handle : 8,
  operation : Operation,
@@ -3450,10 +3663,18 @@ packet LeSetExtendedAdvertisingEnable : LeAdvertisingCommand (op_code = LE_SET_E
  enabled_sets : EnabledSet[],
}

test LeSetExtendedAdvertisingEnable {
  "\x39\x20\x06\x00\x01\x01\x00\x00\x00",
}

packet LeSetExtendedAdvertisingEnableComplete : CommandComplete (command_op_code = LE_SET_EXTENDED_ADVERTISING_ENABLE) {
  status : ErrorCode,
}

test LeSetExtendedAdvertisingEnableComplete {
  "\x0e\x04\x01\x39\x20\x00",
}

packet LeReadMaximumAdvertisingDataLength : Command (op_code = LE_READ_MAXIMUM_ADVERTISING_DATA_LENGTH) {
}

@@ -3474,10 +3695,18 @@ packet LeRemoveAdvertisingSet : LeAdvertisingCommand (op_code = LE_REMOVE_ADVERT
  advertising_handle : 8,
}

test LeRemoveAdvertisingSet {
  "\x3c\x20\x01\x01",
}

packet LeRemoveAdvertisingSetComplete : CommandComplete (command_op_code = LE_REMOVE_ADVERTISING_SET) {
  status : ErrorCode,
}

test LeRemoveAdvertisingSetComplete {
  "\x0e\x04\x01\x3c\x20\x00",
}

packet LeClearAdvertisingSets : LeAdvertisingCommand (op_code = LE_CLEAR_ADVERTISING_SETS) {
}

@@ -3532,10 +3761,19 @@ packet LeSetExtendedScanParameters : LeScanningCommand (op_code = LE_SET_EXTENDE
  parameters : PhyScanParameters[],
}

test LeSetExtendedScanParameters {
  "\x41\x20\x08\x01\x00\x01\x01\x12\x00\x12\x00",
  "\x41\x20\x08\x01\x00\x01\x01\x99\x19\x99\x19",
}

packet LeSetExtendedScanParametersComplete : CommandComplete (command_op_code = LE_SET_EXTENDED_SCAN_PARAMETERS) {
  status : ErrorCode,
}

test LeSetExtendedScanParametersComplete {
  "\x0e\x04\x01\x41\x20\x00",
}

enum FilterDuplicates : 8 {
  DISABLED = 0,
  ENABLED = 1,
@@ -3549,10 +3787,19 @@ packet LeSetExtendedScanEnable : LeScanningCommand (op_code = LE_SET_EXTENDED_SC
  period : 16, // 0 - Scan continuously,  N * 1.28 sec
}

test LeSetExtendedScanEnable {
  "\x42\x20\x06\x01\x00\x00\x00\x00\x00",
  "\x42\x20\x06\x00\x01\x00\x00\x00\x00",
}

packet LeSetExtendedScanEnableComplete : CommandComplete (command_op_code = LE_SET_EXTENDED_SCAN_ENABLE) {
  status : ErrorCode,
}

test LeSetExtendedScanEnableComplete {
  "\x0e\x04\x01\x42\x20\x00",
}

struct LeCreateConnPhyScanParameters {
  scan_interval : 16, // 0x0004-0xFFFF
  scan_window : 16, // < = LeScanInterval
@@ -3573,6 +3820,10 @@ packet LeExtendedCreateConnection : LeConnectionManagementCommand (op_code = LE_
  phy_scan_parameters : LeCreateConnPhyScanParameters[],
}

test LeExtendedCreateConnection {
  "\x43\x20\x2a\x01\x01\x00\x00\x00\x00\x00\x00\x00\x03\x00\x08\x30\x00\x18\x00\x28\x00\x00\x00\xf4\x01\x00\x00\x00\x00\x00\x08\x30\x00\x18\x00\x28\x00\x00\x00\xf4\x01\x00\x00\x00\x00",
}

packet LeExtendedCreateConnectionStatus : CommandStatus (command_op_code = LE_EXTENDED_CREATE_CONNECTION) {
}

@@ -4118,6 +4369,10 @@ packet LeSetTransmitPowerReportingEnableComplete : CommandComplete (command_op_c
packet LeGetVendorCapabilities : VendorCommand (op_code = LE_GET_VENDOR_CAPABILITIES) {
}

test LeGetVendorCapabilities {
  "\x53\xfd\x00",
}

struct VendorCapabilities {
  is_supported : 8,
  max_advt_instances: 8,
@@ -4151,6 +4406,7 @@ packet LeGetVendorCapabilitiesComplete : CommandComplete (command_op_code = LE_G
  base_vendor_capabilities : BaseVendorCapabilities,
  _payload_,
}

packet LeGetVendorCapabilitiesComplete095 : LeGetVendorCapabilitiesComplete {
  version_supported: 16,
  total_num_of_advt_tracked: 16,
@@ -4158,6 +4414,7 @@ packet LeGetVendorCapabilitiesComplete095 : LeGetVendorCapabilitiesComplete {
  debug_logging_supported: 8,
  _payload_,
}

packet LeGetVendorCapabilitiesComplete096 : LeGetVendorCapabilitiesComplete095 {
  le_address_generation_offloading_support: 8,
  _payload_,
@@ -4206,7 +4463,7 @@ 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
  _padding_[31], // Zero padding to 31 bytes of advertising_data
  advertising_instance : 8,
}

@@ -4216,7 +4473,7 @@ 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
  _padding_[31], // Zero padding to 31 bytes of advertising_data
  advertising_instance : 8,
}

@@ -4546,11 +4803,19 @@ packet ControllerBqr : VendorCommand(op_code = CONTROLLER_BQR) {
  bqr_minimum_report_interval : 16,
}

test ControllerBqr {
  "\x5e\xfd\x07\x00\x1f\x00\x07\x00\x88\x13",
}

packet ControllerBqrComplete : CommandComplete (command_op_code = CONTROLLER_BQR) {
  status : ErrorCode,
  current_quality_event_mask : 32
}

test ControllerBqrComplete {
  "\x0e\x08\x01\x5e\xfd\x00\x1f\x00\x07\x00",
}

// HCI Event Packets

packet InquiryComplete : Event (event_code = INQUIRY_COMPLETE) {
@@ -4887,9 +5152,9 @@ packet ExtendedInquiryResult : Event (event_code = EXTENDED_INQUIRY_RESULT) {
  rssi : 8,
  extended_inquiry_response : GapData[],
  // Extended inquiry Result is always 255 bytes long
  // padded with zeroes as necessary
  // padded GapData with zeroes as necessary
  // Refer to BLUETOOTH CORE SPECIFICATION Version 5.2 | Vol 3, Part C Section 8 on page 1340
  _padding_[255],
  _padding_[240],
}

packet EncryptionKeyRefreshComplete : Event (event_code = ENCRYPTION_KEY_REFRESH_COMPLETE) {
+9 −8
Original line number Diff line number Diff line
@@ -632,18 +632,19 @@ TEST(HciPacketsTest, testLeMultiAdvSetAdvertisingDataBuilderLength) {
  gap_data.data_ = std::vector<uint8_t>({'A', ' ', 'g', 'o', 'o', 'd', ' ', 'n', 'a', 'm', 'e'});
  uint8_t set = 3;
  auto builder = LeMultiAdvtSetDataBuilder::Create({gap_data}, set);
  ASSERT_EQ(2 /*opcode*/ + 1 /* parameter size */ + 1 /* data_length */ + 31 /* data */ + 1 /* set */, builder->size());

  auto packet_bytes = std::make_shared<std::vector<uint8_t>>();
  packet_bytes->reserve(builder->size());
  BitInserter bit_inserter(*packet_bytes);
  builder->Serialize(bit_inserter);
  auto command_view = LeMultiAdvtView::Create(
      LeAdvertisingCommandView::Create(CommandView::Create(PacketView<kLittleEndian>(packet_bytes))));
  auto command_view = LeMultiAdvtSetDataView::Create(LeMultiAdvtView::Create(
      LeAdvertisingCommandView::Create(CommandView::Create(PacketView<kLittleEndian>(packet_bytes)))));
  ASSERT_TRUE(command_view.IsValid());
  EXPECT_EQ(1 /* data_length */ + 31 /* data */ + 1 /* set */, command_view.GetPayload().size());
  auto view = LeMultiAdvtSetDataView::Create(command_view);
  ASSERT_TRUE(view.IsValid());
  ASSERT_TRUE(view.GetAdvertisingData().size() > 0);
  ASSERT_EQ(view.GetAdvertisingData()[0].data_, gap_data.data_);
  ASSERT_EQ(view.GetAdvertisingInstance(), 3);
}

TEST(HciPacketsTest, testLeMultiAdvSetScanResponseDataBuilderLength) {
@@ -652,18 +653,18 @@ TEST(HciPacketsTest, testLeMultiAdvSetScanResponseDataBuilderLength) {
  gap_data.data_ = std::vector<uint8_t>({'A', ' ', 'g', 'o', 'o', 'd', ' ', 'n', 'a', 'm', 'e'});
  uint8_t set = 3;
  auto builder = LeMultiAdvtSetScanRespBuilder::Create({gap_data}, set);
  EXPECT_EQ(2 /*opcode*/ + 1 /* parameter size */ + 1 /*data_length */ + 31 /* data */ + 1 /* set */, builder->size());

  auto packet_bytes = std::make_shared<std::vector<uint8_t>>();
  packet_bytes->reserve(builder->size());
  BitInserter bit_inserter(*packet_bytes);
  builder->Serialize(bit_inserter);
  auto command_view = LeMultiAdvtView::Create(
      LeAdvertisingCommandView::Create(CommandView::Create(PacketView<kLittleEndian>(packet_bytes))));
  auto command_view = LeMultiAdvtSetScanRespView::Create(LeMultiAdvtView::Create(
      LeAdvertisingCommandView::Create(CommandView::Create(PacketView<kLittleEndian>(packet_bytes)))));
  ASSERT_TRUE(command_view.IsValid());
  ASSERT_EQ(1 /* data_length */ + 31 /* data */ + 1 /* set */, command_view.GetPayload().size());
  auto view = LeMultiAdvtSetScanRespView::Create(command_view);
  ASSERT_TRUE(view.IsValid());
  ASSERT_EQ(view.GetAdvertisingData()[0].data_, gap_data.data_);
  ASSERT_EQ(view.GetAdvertisingInstance(), 3);
}

std::vector<uint8_t> controller_bqr = {0x5e, 0xfd, 0x07, 0x00, 0x1f, 0x00, 0x07, 0x00, 0x88, 0x13};
+80 −33

File changed.

Preview size limit exceeded, changes collapsed.

+25 −23

File changed.

Preview size limit exceeded, changes collapsed.

+3 −1
Original line number Diff line number Diff line
@@ -391,8 +391,10 @@ packet SizedParent {
}

packet OneLengthTypeValueStructPadded : SizedParent {
  valid_bytes : 8,
  one_array : LengthTypeValueStruct[],
  _padding_[40],
  _padding_[30],
  after_padding : 8,
}

packet ByteSizedFields {