@@ -384,12 +384,13 @@ enum OpCode : 16 {
384384  LE_CS_READ_REMOTE_FAE_TABLE = 0x208E,
385385  LE_CS_WRITE_CACHED_REMOTE_FAE_TABLE = 0x208F,
386386  LE_CS_CREATE_CONFIG = 0x2090,
387-   LE_CS_REMOVE_CONFIG = 0x0291 ,
387+   LE_CS_REMOVE_CONFIG = 0x2091 ,
388388  LE_CS_SET_CHANNEL_CLASSIFICATION = 0x2092,
389389  LE_CS_SET_PROCEDURE_PARAMETERS = 0x2093,
390390  LE_CS_PROCEDURE_ENABLE = 0x2094,
391391  LE_CS_TEST = 0x2095,
392392  LE_CS_TEST_END = 0x2096,
393+   LE_SET_HOST_FEATURE_V2 = 0x2097,
393394  LE_ADD_DEVICE_TO_MONITORED_ADVERTISERS_LIST = 0x2098,
394395  LE_REMOVE_DEVICE_FROM_MONITORED_ADVERTISERS_LIST = 0x2099,
395396  LE_CLEAR_MONITORED_ADVERTISERS_LIST = 0x209A,
@@ -4029,18 +4030,6 @@ struct EnabledSet {
40294030  max_extended_advertising_events : 8,
40304031}
40314032
4032- struct DisabledSet {
4033-   advertising_handle : 8,
4034-   _fixed_ = 0x00 : 16, // duration
4035-   _fixed_ = 0x00 : 8, // max_extended_advertising_events
4036- }
4037- 
4038- packet LeSetExtendedAdvertisingDisable : Command (op_code = LE_SET_EXTENDED_ADVERTISING_ENABLE) {
4039-   _fixed_ = 0x00 : 8, // Enable::DISABLED
4040-   _count_(disabled_sets) : 8,
4041-   disabled_sets : DisabledSet[],
4042- }
4043- 
40444033packet LeSetExtendedAdvertisingEnable : Command (op_code = LE_SET_EXTENDED_ADVERTISING_ENABLE) {
40454034  enable : Enable,
40464035  _count_(enabled_sets) : 8,
@@ -4051,7 +4040,7 @@ test LeSetExtendedAdvertisingEnable {
40514040  "\x39\x20\x06\x01\x01\x01\x00\x00\x00",
40524041}
40534042
4054- test LeSetExtendedAdvertisingDisable  {
4043+ test LeSetExtendedAdvertisingEnable  {
40554044  "\x39\x20\x06\x00\x01\x01\x00\x00\x00",
40564045}
40574046
@@ -6530,12 +6519,6 @@ packet LeBatchScanReadResultParameters : LeBatchScan (batch_scan_opcode = READ_R
65306519  batch_scan_data_read : BatchScanDataRead,
65316520}
65326521
6533- packet LeBatchScanReadResultParametersCompleteRaw : LeBatchScanComplete (batch_scan_opcode = READ_RESULT_PARAMETERS) {
6534-   batch_scan_data_read : BatchScanDataRead,
6535-   num_of_records : 8,
6536-   raw_data : 8[],
6537- }
6538- 
65396522packet LeBatchScanReadResultParametersComplete : LeBatchScanComplete (batch_scan_opcode = READ_RESULT_PARAMETERS) {
65406523  batch_scan_data_read : BatchScanDataRead,
65416524  _body_,
@@ -6888,186 +6871,3 @@ packet ControllerDebugInfoEvent : VendorSpecificEvent (subevent_code = CONTROLLE
68886871  _size_(debug_data) : 16,
68896872  debug_data : 8[],
68906873}
6891- 
6892- // -----------------------------------------------------------------------------
6893- //  Microsoft Commands
6894- //  https://learn.microsoft.com/en-us/windows-hardware/drivers/bluetooth/microsoft-defined-bluetooth-hci-commands-and-events
6895- // -----------------------------------------------------------------------------
6896- 
6897- enum MsftSubcommandOpcode : 8 {
6898-   MSFT_READ_SUPPORTED_FEATURES = 0x00,
6899-   MSFT_MONITOR_RSSI = 0x01,
6900-   MSFT_CANCEL_MONITOR_RSSI = 0x02,
6901-   MSFT_LE_MONITOR_ADV = 0x03,
6902-   MSFT_LE_CANCEL_MONITOR_ADV = 0x04,
6903-   MSFT_LE_SET_ADV_FILTER_ENABLE = 0x05,
6904-   MSFT_READ_ABSOLUTE_RSSI = 0x06,
6905- }
6906- 
6907- // MSFT Commands do not have a constant opcode, so leave `op_code` undefined.
6908- packet MsftCommand : Command {
6909-   subcommand_opcode: MsftSubcommandOpcode,
6910-   _payload_,
6911- }
6912- 
6913- packet MsftReadSupportedFeatures : MsftCommand (subcommand_opcode = MSFT_READ_SUPPORTED_FEATURES) {}
6914- 
6915- enum MsftLeMonitorAdvConditionType : 8 {
6916-   MSFT_CONDITION_TYPE_PATTERNS = 0x01,
6917-   MSFT_CONDITION_TYPE_UUID = 0x02,
6918-   MSFT_CONDITION_TYPE_IRK_RESOLUTION = 0x03,
6919-   MSFT_CONDITION_TYPE_ADDRESS = 0x04,
6920- }
6921- 
6922- enum MsftLeMonitorAdvConditionUuidType : 8 {
6923-   MSFT_CONDITION_UUID_TYPE_16_BIT = 0x01,
6924-   MSFT_CONDITION_UUID_TYPE_32_BIT = 0x02,
6925-   MSFT_CONDITION_UUID_TYPE_128_BIT = 0x03,
6926- }
6927- 
6928- packet MsftLeMonitorAdv : MsftCommand (subcommand_opcode = MSFT_LE_MONITOR_ADV) {
6929-   rssi_threshold_high : 8,
6930-   rssi_threshold_low : 8,
6931-   rssi_threshold_low_time_interval : 8,
6932-   rssi_sampling_period : 8,
6933-   condition_type: MsftLeMonitorAdvConditionType,
6934-   _payload_,
6935- }
6936- 
6937- struct MsftLeMonitorAdvConditionPattern {
6938-   _size_(pattern) : 8, // including one byte for ad_type and one byte for start_of_pattern
6939-   ad_type: 8,
6940-   start_of_pattern: 8,
6941-   pattern: 8[+2],
6942- }
6943- 
6944- packet MsftLeMonitorAdvConditionPatterns : MsftLeMonitorAdv (condition_type = MSFT_CONDITION_TYPE_PATTERNS) {
6945-   _count_(patterns): 8,
6946-   patterns: MsftLeMonitorAdvConditionPattern[],
6947- }
6948- 
6949- test MsftLeMonitorAdvConditionPatterns {
6950-   "\x1e\xfc\x0e\x03\x10\x05\x04\xaa\x01\x01\x06\x03\x00\x80\x81\x82\x83", // 1 pattern
6951-   "\x70\xfd\x13\x03\x15\x04\x02\xbb\x01\x02\x04\x03\x00\x80\x81\x06\x0f\x00\x90\x91\x92\x93", // 2 patterns
6952- }
6953- 
6954- packet MsftLeMonitorAdvConditionUuid : MsftLeMonitorAdv (condition_type = MSFT_CONDITION_TYPE_UUID) {
6955-   uuid_type: MsftLeMonitorAdvConditionUuidType,
6956-   _payload_,
6957- }
6958- 
6959- packet MsftLeMonitorAdvConditionUuid2 : MsftLeMonitorAdvConditionUuid (uuid_type = MSFT_CONDITION_UUID_TYPE_16_BIT) {
6960-   uuid2: 8[2],
6961- }
6962- 
6963- test MsftLeMonitorAdvConditionUuid2 {
6964-   "\x1e\xfc\x09\x03\x10\x11\x12\x13\x02\x01\x70\x71", // opcode = fc1e for Intel
6965-   "\x70\xfd\x09\x03\x10\x11\x12\x13\x02\x01\x70\x71", // opcode = fd70 for Qualcomm
6966- }
6967- 
6968- packet MsftLeMonitorAdvConditionUuid4 : MsftLeMonitorAdvConditionUuid (uuid_type = MSFT_CONDITION_UUID_TYPE_32_BIT) {
6969-   uuid4: 8[4],
6970- }
6971- 
6972- test MsftLeMonitorAdvConditionUuid4 {
6973-   "\x1e\xfc\x0b\x03\x10\x11\x12\x13\x02\x02\x70\x71\x72\x73",
6974-   "\x70\xfd\x0b\x03\x10\x11\x12\x13\x02\x02\x70\x71\x72\x73",
6975- }
6976- 
6977- packet MsftLeMonitorAdvConditionUuid16 : MsftLeMonitorAdvConditionUuid (uuid_type = MSFT_CONDITION_UUID_TYPE_128_BIT) {
6978-   uuid16: 8[16],
6979- }
6980- 
6981- test MsftLeMonitorAdvConditionUuid16 {
6982-   "\x1e\xfc\x17\x03\x10\x11\x12\x13\x02\x03\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f",
6983-   "\x70\xfd\x17\x03\x10\x11\x12\x13\x02\x03\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f",
6984- }
6985- 
6986- packet MsftLeCancelMonitorAdv: MsftCommand (subcommand_opcode = MSFT_LE_CANCEL_MONITOR_ADV) {
6987-   monitor_handle: 8,
6988- }
6989- 
6990- test MsftLeCancelMonitorAdv {
6991-   "\x1e\xfc\x02\x04\x01", // cancel handle 0x01
6992- }
6993- 
6994- packet MsftLeSetAdvFilterEnable : MsftCommand (subcommand_opcode = MSFT_LE_SET_ADV_FILTER_ENABLE) {
6995-   enable: 8,
6996- }
6997- 
6998- test MsftLeSetAdvFilterEnable {
6999-   "\x1e\xfc\x02\x05\x01", // disable
7000-   "\x70\xfd\x02\x05\x01", // enable
7001- }
7002- 
7003- packet MsftCommandComplete : CommandComplete {
7004-   status: ErrorCode,
7005-   subcommand_opcode: MsftSubcommandOpcode,
7006-   _payload_,
7007- }
7008- 
7009- packet MsftReadSupportedFeaturesCommandComplete : MsftCommandComplete (subcommand_opcode = MSFT_READ_SUPPORTED_FEATURES) {
7010-   supported_features: 64,
7011-   _size_(prefix) : 8,
7012-   prefix: 8[],
7013- }
7014- 
7015- test MsftReadSupportedFeaturesCommandComplete {
7016-   "\x0e\x10\x01\x1e\xfc\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x02\x87\x80", // Msft opcode by Intel
7017-   "\x0e\x12\x01\x70\xfd\x00\x00\x1f\x00\x00\x00\x00\x00\x00\x00\x04\x4d\x53\x46\x54", // Msft opcode by Qualcomm
7018- }
7019- 
7020- packet MsftLeMonitorAdvCommandComplete : MsftCommandComplete (subcommand_opcode = MSFT_LE_MONITOR_ADV) {
7021-   monitor_handle: 8,
7022- }
7023- 
7024- test MsftLeMonitorAdvCommandComplete {
7025-   "\x0e\x06\x01\x1e\xfc\x00\x03\x05", // succeeded
7026-   "\x0e\x06\x01\x70\xfd\x01\x03\x06", // failed
7027- }
7028- 
7029- packet MsftLeCancelMonitorAdvCommandComplete : MsftCommandComplete (subcommand_opcode = MSFT_LE_CANCEL_MONITOR_ADV) {}
7030- 
7031- packet MsftLeSetAdvFilterEnableCommandComplete : MsftCommandComplete (subcommand_opcode = MSFT_LE_SET_ADV_FILTER_ENABLE) {}
7032- 
7033- enum MsftEventCode : 8 {
7034-   MSFT_RSSI_EVENT = 0x01,
7035-   MSFT_LE_MONITOR_DEVICE_EVENT = 0x02,
7036- }
7037- 
7038- enum MsftEventStatus : 8 {
7039-   MSFT_EVENT_STATUS_SUCCESS = 0x00,
7040-   MSFT_EVENT_STATUS_FAILURE = 0x01,
7041- }
7042- 
7043- // It is not possible to define MSFT Event packet by deriving `Event` packet
7044- // because it starts with variable-length event prefix which can only be determined
7045- // at run-time (after receiving return of MSFT Read Supported Features).
7046- // Therefore we only define the payload which is located after the event prefix.
7047- packet MsftEventPayload {
7048-   msft_event_code : MsftEventCode,
7049-   _payload_,
7050- }
7051- 
7052- packet MsftRssiEventPayload : MsftEventPayload (msft_event_code = MSFT_RSSI_EVENT) {
7053-   status: MsftEventStatus,
7054-   connection_handle: 16,
7055-   rssi: 8,
7056- }
7057- 
7058- test MsftRssiEventPayload {
7059-   "\x01\x00\x01\x10\xf0", // MSFT_RSSI_EVENT succeeded
7060-   "\x01\x01\x02\x02\x08", // MSFT_RSSI_EVENT failed
7061- }
7062- 
7063- packet MsftLeMonitorDeviceEventPayload : MsftEventPayload (msft_event_code = MSFT_LE_MONITOR_DEVICE_EVENT) {
7064-   address_type: 8,
7065-   bd_addr: Address,
7066-   monitor_handle: 8,
7067-   monitor_state: 8,
7068- }
7069- 
7070- test MsftLeMonitorDeviceEventPayload {
7071-   "\x02\x01\x00\x01\x02\x03\x04\x05\x10\x00",
7072-   "\x02\x02\xf0\xf1\xf2\xf3\xf4\xf5\xaa\x02",
7073- }
0 commit comments