Bluetooth HCI: Core spec 5.1 support

Dissection added for HCI commands/events:
Read Local Simple Pairing Options
LE Receiver Test [v3]
LE Transmitter Test [v3]
LE Set Connectionless CTE Transmit Parameters
LE Set Connectionless CTE Transmit Enable
LE Set Connectionless IQ Sampling Enable
LE Set Connection CTE Receive Parameters
LE Set Connection CTE Transmit Parameters
LE Connection CTE Request Enable
LE Connection CTE Response Enable
LE Read Antenna Information
LE Set Periodic Advertising Receive Enable
LE Periodic Advertising Sync Transfer
LE Periodic Advertising Set Info Transfer
LE Set Periodic Advertising Sync Transfer Parameters
LE Set Default Periodic Advertising Sync Transfer Parameters
LE Generate DHKey [v2]
LE Modify Sleep Clock Accuracy
LE Connectionless IQ Report
LE Connection IQ Report
LE CTE Request Failed
LE Periodic Advertising Sync Transfer Received

The following HCI commands have been renamed:
LE Receiver Test -> LE Receiver Test [v1]
LE Transmitter Test -> LE Transmitter Test [v1]
LE Enhanced Receiver Test -> LE Receiver Test [v2]
LE Enhanced Transmitter Test -> LE Transmitter Test [v2]
LE Generate DHKey -> LE Generate DHKey [v1]

LE Periodic Advertising Create Sync command added CTE type field.

Version, feature bits and event mask fields updated.

Change-Id: I9ecf2749c718023e7f9a762ebfc0263da78e5c0d
Signed-off-by: Allan Møller Madsen <almomadk@gmail.com>
Reviewed-on: https://code.wireshark.org/review/32492
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Allan Møller Madsen 2019-03-20 19:09:27 +01:00 committed by Anders Broman
parent dc0a7edcb4
commit 5f4cb69598
3 changed files with 920 additions and 45 deletions

View File

@ -285,6 +285,10 @@ static int hf_bthci_cmd_amp_remaining_assoc_length = -1;
static int hf_bthci_cmd_amp_assoc_fragment = -1;
static int hf_bthci_cmd_le_event_mask = -1;
static int hf_bthci_cmd_le_event_mask_le_reserved = -1;
static int hf_bthci_cmd_le_event_mask_le_periodic_advertising_sync_transfer_received = -1;
static int hf_bthci_cmd_le_event_mask_le_cte_request_failed = -1;
static int hf_bthci_cmd_le_event_mask_le_connection_iq_report = -1;
static int hf_bthci_cmd_le_event_mask_le_connectionless_iq_report = -1;
static int hf_bthci_cmd_le_event_mask_le_channel_selection_algorithm = -1;
static int hf_bthci_cmd_le_event_mask_le_scan_request_received = -1;
static int hf_bthci_cmd_le_event_mask_le_extended_advertising_set_terminated = -1;
@ -415,6 +419,33 @@ static int hf_bthci_cmd_skip = -1;
static int hf_bthci_cmd_rf_tx_path_compensation_value = -1;
static int hf_bthci_cmd_rf_rx_path_compensation_value = -1;
static int hf_bthci_cmd_sync_handle = -1;
static int hf_bthci_cmd_cte_length = -1;
static int hf_bthci_cmd_cte_type = -1;
static int hf_bthci_cmd_slot_durations = -1;
static int hf_bthci_cmd_antenna_switching_pattern_length = -1;
static int hf_bthci_cmd_antenna_switching_pattern = -1;
static int hf_bthci_cmd_antenna_id = -1;
static int hf_bthci_cmd_cte_count = -1;
static int hf_bthci_cmd_cte_enable = -1;
static int hf_bthci_cmd_iq_sampling_enable = -1;
static int hf_bthci_cmd_max_sampled_ctes = -1;
static int hf_bthci_cmd_cte_request_interval = -1;
static int hf_bthci_cmd_reporting_enable = -1;
static int hf_bthci_cmd_service_data_past = -1;
static int hf_bthci_cmd_sync_mode = -1;
static int hf_bthci_cmd_key_type = -1;
static int hf_bthci_cmd_sca_action = -1;
static int hf_bthci_cmd_sync_cte_type = -1;
static int hf_bthci_cmd_sync_cte_type_no_sync_aoa = -1;
static int hf_bthci_cmd_sync_cte_type_no_sync_aod_1us = -1;
static int hf_bthci_cmd_sync_cte_type_no_sync_aod_2us = -1;
static int hf_bthci_cmd_sync_cte_type_sync_only_with_cte = -1;
static int hf_bthci_cmd_sync_cte_type_reserved = -1;
static int hf_bthci_cmd_cte_types = -1;
static int hf_bthci_cmd_cte_types_reserved = -1;
static int hf_bthci_cmd_cte_types_aod_2us = -1;
static int hf_bthci_cmd_cte_types_aod_1us = -1;
static int hf_bthci_cmd_cte_types_aoa = -1;
static int hf_bthci_cmd_triggered_clock_capture = -1;
static int hf_bthci_cmd_lpo_allowed = -1;
static int hf_bthci_cmd_number_of_clock_captures_to_filter = -1;
@ -513,6 +544,10 @@ static int hf_bthci_cmd_extended_inquiry_length = -1;
static const int *hfx_bthci_cmd_le_event_mask[] = {
&hf_bthci_cmd_le_event_mask_le_reserved,
&hf_bthci_cmd_le_event_mask_le_periodic_advertising_sync_transfer_received,
&hf_bthci_cmd_le_event_mask_le_cte_request_failed,
&hf_bthci_cmd_le_event_mask_le_connection_iq_report,
&hf_bthci_cmd_le_event_mask_le_connectionless_iq_report,
&hf_bthci_cmd_le_event_mask_le_channel_selection_algorithm,
&hf_bthci_cmd_le_event_mask_le_scan_request_received,
&hf_bthci_cmd_le_event_mask_le_extended_advertising_set_terminated,
@ -590,6 +625,23 @@ static const int *hfx_btcmd_le_phys[] = {
NULL
};
static const int *hfx_btcmd_sync_cte_type[] = {
&hf_bthci_cmd_sync_cte_type_reserved,
&hf_bthci_cmd_sync_cte_type_sync_only_with_cte,
&hf_bthci_cmd_sync_cte_type_no_sync_aod_2us,
&hf_bthci_cmd_sync_cte_type_no_sync_aod_1us,
&hf_bthci_cmd_sync_cte_type_no_sync_aoa,
NULL
};
static const int *hfx_btcmd_cte_types[] = {
&hf_bthci_cmd_cte_types_reserved,
&hf_bthci_cmd_cte_types_aod_2us,
&hf_bthci_cmd_cte_types_aod_1us,
&hf_bthci_cmd_cte_types_aoa,
NULL
};
static const int *hfx_bthci_cmd_sco_packet_type[] = {
&hf_bthci_cmd_sco_packet_type_reserved,
&hf_bthci_cmd_sco_packet_type_3ev5,
@ -641,6 +693,7 @@ static gint ett_adv_properties = -1;
static gint ett_adv_sets = -1;
static gint ett_phys_flags = -1;
static gint ett_scan_init_phy_param = -1;
static gint ett_sync_cte_type = -1;
static gint ett_coding_format = -1;
static gint ett_packet_type = -1;
static gint ett_sco_packet_type = -1;
@ -1171,7 +1224,9 @@ value_string_ext bthci_cmd_ocf_host_controller_and_baseband_vals_ext = VALUE_STR
{ (base) | 0x009, "Read BD ADDR" }, \
{ (base) | 0x00A, "Read Data Block Size" }, \
/* Bluetooth Core Specification Addendum 2 */ \
{ (base) | 0x00B, "Read Local Supported Codecs" }
{ (base) | 0x00B, "Read Local Supported Codecs" }, \
/* Bluetooth Core 5.1 */ \
{ (base) | 0x00C, "Read Local Simple Pairing Options" }
static const value_string bthci_cmd_ocf_informational_vals[] = {
INFORMATIONAL_VALS(0x0),
@ -1252,16 +1307,18 @@ value_string_ext bthci_cmd_ocf_testing_vals_ext = VALUE_STRING_EXT_INIT(bthci_cm
{ (base) | 0x01A, "LE Long Term Key Request Reply" }, \
{ (base) | 0x01B, "LE Long Term Key Request Negative Reply" }, \
{ (base) | 0x01C, "LE Read Supported States" }, \
{ (base) | 0x01D, "LE Receiver Test" }, \
{ (base) | 0x01E, "LE Transmitter Test" }, \
{ (base) | 0x01D, "LE Receiver Test [v1]" }, \
{ (base) | 0x01E, "LE Transmitter Test [v1]" }, \
{ (base) | 0x01F, "LE Test End" }, \
/* Bluetooth Core 4.1 */ \
{ (base) | 0x020, "LE Remote Connection Parameter Request Reply" }, \
{ (base) | 0x021, "LE Remote Connection Parameter Request Negative Reply" }, \
/* Bluetooth Core 4.2 */ \
{ (base) | 0x022, "LE Set Data Length" }, \
{ (base) | 0x023, "LE Read Suggested Default Data Length" }, \
{ (base) | 0x024, "LE Write Suggested Default Data Length" }, \
{ (base) | 0x025, "LE Read Local P-256 Public Key" }, \
{ (base) | 0x026, "LE Generate DHKey" }, \
{ (base) | 0x026, "LE Generate DHKey [v1]" }, \
{ (base) | 0x027, "LE Add Device to Resolving List" }, \
{ (base) | 0x028, "LE Remove Device From Resolving List" }, \
{ (base) | 0x029, "LE Clear Resolving List" }, \
@ -1271,11 +1328,12 @@ value_string_ext bthci_cmd_ocf_testing_vals_ext = VALUE_STRING_EXT_INIT(bthci_cm
{ (base) | 0x02D, "LE Set Address Resolution Enable" }, \
{ (base) | 0x02E, "LE Set Resolvable Private Address Timeout" }, \
{ (base) | 0x02F, "LE Read Maximum Data Length" }, \
/* Bluetooth Core 5.0 */ \
{ (base) | 0x030, "LE Read PHY" }, \
{ (base) | 0x031, "LE Set Default PHY" }, \
{ (base) | 0x032, "LE Set PHY" }, \
{ (base) | 0x033, "LE Enhanced Receiver Test" }, \
{ (base) | 0x034, "LE Enhanced Transmitter Test" }, \
{ (base) | 0x033, "LE Receiver Test [v2]" }, \
{ (base) | 0x034, "LE Transmitter Test [v2]" }, \
{ (base) | 0x035, "LE Set Advertising Set Random Address" }, \
{ (base) | 0x036, "LE Set Extended Advertising Parameters" }, \
{ (base) | 0x037, "LE Set Extended Advertising Data" }, \
@ -1301,8 +1359,25 @@ value_string_ext bthci_cmd_ocf_testing_vals_ext = VALUE_STRING_EXT_INIT(bthci_cm
{ (base) | 0x04B, "LE Read Transmit Power" }, \
{ (base) | 0x04C, "LE Read RF Path Compensation" }, \
{ (base) | 0x04D, "LE Write RF Path Compensation" }, \
{ (base) | 0x04E, "LE Set Privacy Mode" }
{ (base) | 0x04E, "LE Set Privacy Mode" }, \
/* Bluetooth Core 5.1 */ \
{ (base) | 0x04F, "LE Receiver Test [v3]" }, \
{ (base) | 0x050, "LE Transmitter Test [v3]" }, \
{ (base) | 0x051, "LE Set Connectionless CTE Transmit Parameters" }, \
{ (base) | 0x052, "LE Set Connectionless CTE Transmit Enable" }, \
{ (base) | 0x053, "LE Set Connectionless IQ Sampling Enable" }, \
{ (base) | 0x054, "LE Set Connection CTE Receive Parameters" }, \
{ (base) | 0x055, "LE Set Connection CTE Transmit Parameters" }, \
{ (base) | 0x056, "LE Connection CTE Request Enable" }, \
{ (base) | 0x057, "LE Connection CTE Response Enable" }, \
{ (base) | 0x058, "LE Read Antenna Information" }, \
{ (base) | 0x059, "LE Set Periodic Advertising Receive Enable" }, \
{ (base) | 0x05A, "LE Periodic Advertising Sync Transfer" }, \
{ (base) | 0x05B, "LE Periodic Advertising Set Info Transfer" }, \
{ (base) | 0x05C, "LE Set Periodic Advertising Sync Transfer Parameters" }, \
{ (base) | 0x05D, "LE Set Default Periodic Advertising Sync Transfer Parameters" }, \
{ (base) | 0x05E, "LE Generate DHKey [v2]" }, \
{ (base) | 0x05F, "LE Modify Sleep Clock Accuracy" }
static const value_string bthci_cmd_ocf_low_energy_vals[] = {
LOW_ENERGY_VALS(0x0),
{ 0, NULL }
@ -2178,6 +2253,40 @@ static const value_string cmd_le_modulation_index_vals[] = {
{ 0, NULL }
};
static const value_string cmd_cte_type_vals[] = {
{ 0x00, "AoA Constant Tone Extension" },
{ 0x01, "AoD Constant Tone Extension with 1 usec slots" },
{ 0x02, "AoD Constant Tone Extension with 2 usec slots" },
{ 0, NULL }
};
value_string_ext bthci_cmd_cte_type_vals_ext = VALUE_STRING_EXT_INIT(cmd_cte_type_vals);
static const value_string cmd_slot_durations_vals[] = {
{ 0x01, "Switching and sampling slots are 1 usec each" },
{ 0x02, "Switching and sampling slots are 2 usec each" },
{ 0, NULL }
};
value_string_ext bthci_cmd_slot_durations_vals_ext = VALUE_STRING_EXT_INIT(cmd_slot_durations_vals);
static const value_string cmd_sync_mode_vals[] = {
{ 0x00, "No synchronize attempt, no LE Periodic Advertising Sync Transfer Received event sent to Host" },
{ 0x01, "LE Periodic Advertising Sync Transfer Received event sent to Host. LE Periodic Advertising Report events disabled" },
{ 0x02, "LE Periodic Advertising Sync Transfer Received event sent to Host. LE Periodic Advertising Report events enabled" },
{ 0, NULL }
};
static const value_string cmd_key_type_vals[] = {
{ 0x00, "Use the generated private key" },
{ 0x01, "Use the debug private key" },
{ 0, NULL }
};
static const value_string cmd_sca_action_vals[] = {
{ 0x00, "Switch to a more accurate clock" },
{ 0x01, "Switch to a less accurate clock" },
{ 0, NULL }
};
static const value_string disable_enable_vals[] = {
{ 0x00, "Disable" },
{ 0x01, "Enable" },
@ -2323,6 +2432,33 @@ dissect_bthci_cmd_flow_spec(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, p
return offset;
}
static int
dissect_antenna_switching_pattern(tvbuff_t *tvb, int offset, proto_tree *tree)
{
guint8 length_antenna_pattern;
proto_tree_add_item(tree, hf_bthci_cmd_antenna_switching_pattern_length, tvb, offset, 1, ENC_NA);
length_antenna_pattern = tvb_get_guint8(tvb, offset);
offset += 1;
if (length_antenna_pattern > 0) {
proto_item *sub_item;
proto_tree *sub_tree;
sub_item = proto_tree_add_item(tree, hf_bthci_cmd_antenna_switching_pattern, tvb, offset, length_antenna_pattern, ENC_NA);
sub_tree = proto_item_add_subtree(sub_item, ett_pattern);
proto_item_append_text(sub_item, ": ");
while (length_antenna_pattern > 0) {
proto_tree_add_item(sub_tree, hf_bthci_cmd_antenna_id, tvb, offset, 1, ENC_NA);
proto_item_append_text(sub_item, "%d ", tvb_get_guint8(tvb, offset));
offset++;
length_antenna_pattern--;
}
}
return offset;
}
static int
dissect_link_control_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, guint16 cmd_ocf, bluetooth_data_t *bluetooth_data)
@ -3925,6 +4061,7 @@ dissect_informational_parameters_cmd(tvbuff_t *tvb, int offset, packet_info *pin
case 0x009: /* Read BD ADDR */
case 0x00A: /* Read Data Block Size */
case 0x00B: /* Read Local Supported Codecs */
case 0x00C: /* Read Local Simple Pairing Options */
/* NOTE: No parameters */
break;
@ -4257,13 +4394,13 @@ dissect_le_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
offset+=16;
break;
case 0x001d: /* LE Receiver Test */
case 0x001d: /* LE Receiver Test [v1] */
item = proto_tree_add_item(tree, hf_bthci_cmd_rx_frequency, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%d MHz)", 2402 + 2*tvb_get_guint8(tvb, offset));
offset++;
break;
case 0x001e: /* LE Transmitter Test */
case 0x001e: /* LE Transmitter Test [v1] */
item = proto_tree_add_item(tree, hf_bthci_cmd_tx_frequency, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%d MHz)", 2402 + 2*tvb_get_guint8(tvb, offset));
offset++;
@ -4319,7 +4456,7 @@ dissect_le_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
offset+=2;
break;
case 0x0026: /* LE Generate DHKey */
case 0x0026: /* LE Generate DHKey [v1] */
proto_tree_add_item(tree, hf_bthci_cmd_le_remote_p_256_public_key, tvb, offset, 64, ENC_NA);
offset+=64;
break;
@ -4384,7 +4521,7 @@ dissect_le_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
offset+=2;
break;
case 0x0033: /* LE Enhanced Receiver Test */
case 0x0033: /* LE Receiver Test [v2] */
item = proto_tree_add_item(tree, hf_bthci_cmd_rx_frequency, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%d MHz)", 2402 + 2*tvb_get_guint8(tvb, offset));
offset++;
@ -4394,7 +4531,7 @@ dissect_le_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
offset++;
break;
case 0x0034: /* LE Enhanced Transmitter Test */
case 0x0034: /* LE Transmitter Test [v2] */
item = proto_tree_add_item(tree, hf_bthci_cmd_tx_frequency, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%d MHz)", 2402 + 2*tvb_get_guint8(tvb, offset));
offset++;
@ -4541,7 +4678,7 @@ dissect_le_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(tree, hf_bthci_cmd_le_advts_enable, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_advertising_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset+=1;
offset+=1;
break;
case 0x0041: /* LE Set Extended Scan Parameters */
@ -4647,7 +4784,7 @@ dissect_le_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
item = proto_tree_add_item(tree, hf_bthci_cmd_le_supervision_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g sec)", tvb_get_letohs(tvb, offset)*0.01);
offset+=2;
/* 1 octet unused/RFU */
proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_cmd_sync_cte_type, ett_sync_cte_type, hfx_btcmd_sync_cte_type, ENC_NA);
offset++;
break;
@ -4682,28 +4819,196 @@ dissect_le_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
offset++;
break;
case 0x002: /* LE Read Buffer Size */
case 0x003: /* LE Read Local Supported Features */
case 0x007: /* LE Read Advertising Channel Tx Power */
case 0x00E: /* LE Create Connection Cancel */
case 0x00F: /* LE Read White List Size */
case 0x010: /* LE Clear White List */
case 0x018: /* LE Rand */
case 0x01C: /* LE Read Supported States */
case 0x01F: /* LE Test End */
case 0x023: /* LE Read Suggested Default Data Length */
case 0x025: /* LE Read Local P-256 Public Key */
case 0x029: /* LE Clear Resolving List */
case 0x02A: /* LE Read Resolving List Size */
case 0x02F: /* LE Read Maximum Data Length */
case 0x03A: /* LE Read Maximum Advertising Data Length */
case 0x03B: /* LE Read Number of Supported Advertising Sets */
case 0x03D: /* LE Clear Advertising Sets */
case 0x045: /* LE Periodic Advertising Create Sync Cancel */
case 0x049: /* LE Clear Periodic Advertiser List */
case 0x04A: /* LE Read Periodic Advertiser List Size */
case 0x04B: /* LE Read Transmit Power */
case 0x04C: /* LE Read RF Path Compensation */
case 0x004F: /* LE Receiver Test [v3] */
item = proto_tree_add_item(tree, hf_bthci_cmd_rx_frequency, tvb, offset, 1, ENC_NA);
proto_item_append_text(item, " (%d MHz)", 2402 + 2*tvb_get_guint8(tvb, offset));
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_phy, tvb, offset, 1, ENC_NA);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_modulation_index, tvb, offset, 1, ENC_NA);
offset++;
item = proto_tree_add_item(tree, hf_bthci_cmd_cte_length, tvb, offset, 1, ENC_NA);
proto_item_append_text(item, " (%d usec)", tvb_get_guint8(tvb, offset)*8);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_cte_type, tvb, offset, 1, ENC_NA);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_slot_durations, tvb, offset, 1, ENC_NA);
offset++;
offset = dissect_antenna_switching_pattern(tvb, offset, tree);
break;
case 0x0050: /* LE Transmitter Test [v3] */
item = proto_tree_add_item(tree, hf_bthci_cmd_tx_frequency, tvb, offset, 1, ENC_NA);
proto_item_append_text(item, " (%d MHz)", 2402 + 2*tvb_get_guint8(tvb, offset));
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_test_data_length, tvb, offset, 1, ENC_NA);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_test_packet_payload, tvb, offset, 1, ENC_NA);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_phy, tvb, offset, 1, ENC_NA);
offset++;
item = proto_tree_add_item(tree, hf_bthci_cmd_cte_length, tvb, offset, 1, ENC_NA);
proto_item_append_text(item, " (%d usec)", tvb_get_guint8(tvb, offset)*8);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_cte_type, tvb, offset, 1, ENC_NA);
offset++;
offset = dissect_antenna_switching_pattern(tvb, offset, tree);
break;
case 0x0051: /* LE Set Connectionless CTE Transmit Parameters */
proto_tree_add_item(tree, hf_bthci_cmd_advertising_handle, tvb, offset, 1, ENC_NA);
offset++;
item = proto_tree_add_item(tree, hf_bthci_cmd_cte_length, tvb, offset, 1, ENC_NA);
proto_item_append_text(item, " (%d usec)", tvb_get_guint8(tvb, offset)*8);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_cte_type, tvb, offset, 1, ENC_NA);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_cte_count, tvb, offset, 1, ENC_NA);
offset++;
offset = dissect_antenna_switching_pattern(tvb, offset, tree);
break;
case 0x0052: /* LE Set Connectionless CTE Transmit Enable */
proto_tree_add_item(tree, hf_bthci_cmd_advertising_handle, tvb, offset, 1, ENC_NA);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_cte_enable, tvb, offset, 1, ENC_NA);
offset++;
break;
case 0x0053: /* LE Set Connectionless IQ Sampling Enable */
proto_tree_add_item(tree, hf_bthci_cmd_sync_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_iq_sampling_enable, tvb, offset, 1, ENC_NA);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_slot_durations, tvb, offset, 1, ENC_NA);
offset++;
item = proto_tree_add_item(tree, hf_bthci_cmd_max_sampled_ctes, tvb, offset, 1, ENC_NA);
if (tvb_get_guint8(tvb, offset) == 0)
proto_item_append_text(item, " (Sample and report all available CTEs)");
offset++;
offset = dissect_antenna_switching_pattern(tvb, offset, tree);
break;
case 0x0054: /* LE Set Connection CTE Receive Parameters */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_iq_sampling_enable, tvb, offset, 1, ENC_NA);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_slot_durations, tvb, offset, 1, ENC_NA);
offset++;
offset = dissect_antenna_switching_pattern(tvb, offset, tree);
break;
case 0x0055: /* LE Set Connection CTE Transmit Parameters */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_cmd_cte_types, ett_sync_cte_type, hfx_btcmd_cte_types, ENC_NA);
offset++;
offset = dissect_antenna_switching_pattern(tvb, offset, tree);
break;
case 0x0056: /* LE Connection CTE Request Enable */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_cte_enable, tvb, offset, 1, ENC_NA);
offset++;
item = proto_tree_add_item(tree, hf_bthci_cmd_cte_request_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
if (tvb_get_letohs(tvb, offset) == 0)
proto_item_append_text(item, " (Initiate once, at earliest opportunity)");
else
proto_item_append_text(item, " (Connection Events)");
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_cte_length, tvb, offset, 1, ENC_NA);
proto_item_append_text(item, " (%d usec)", tvb_get_guint8(tvb, offset)*8);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_cte_type, tvb, offset, 1, ENC_NA);
offset++;
break;
case 0x0057: /* LE Connection CTE Response Enable */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_cte_enable, tvb, offset, 1, ENC_NA);
offset++;
break;
case 0x0059: /* LE Set Periodic Advertising Receive Enable */
proto_tree_add_item(tree, hf_bthci_cmd_sync_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_reporting_enable, tvb, offset, 1, ENC_NA);
offset++;
break;
case 0x005A: /* LE Periodic Advertising Sync Transfer */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_service_data_past, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_sync_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
break;
case 0x005B: /* LE Periodic Advertising Set Info Transfer */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_service_data_past, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_advertising_handle, tvb, offset, 1, ENC_NA);
offset++;
break;
case 0x005C: /* LE Set Periodic Advertising Sync Transfer Parameters */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
/* FALL THROUGH */
case 0x005D: /* LE Set Default Periodic Advertising Sync Transfer Parameters */
proto_tree_add_item(tree, hf_bthci_cmd_sync_mode, tvb, offset, 1, ENC_NA);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_skip, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_le_supervision_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g sec)", tvb_get_letohs(tvb, offset)*0.01);
offset+=2;
proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_cmd_sync_cte_type, ett_sync_cte_type, hfx_btcmd_sync_cte_type, ENC_NA);
offset++;
break;
case 0x005E: /* LE Generate DHKey [v2] */
proto_tree_add_item(tree, hf_bthci_cmd_le_remote_p_256_public_key, tvb, offset, 64, ENC_NA);
offset+=64;
proto_tree_add_item(tree, hf_bthci_cmd_key_type, tvb, offset, 1, ENC_NA);
offset++;
break;
case 0x005F: /* LE Modify Sleep Clock Accuracy */
proto_tree_add_item(tree, hf_bthci_cmd_sca_action, tvb, offset, 1, ENC_NA);
offset++;
break;
case 0x0002: /* LE Read Buffer Size */
case 0x0003: /* LE Read Local Supported Features */
case 0x0007: /* LE Read Advertising Channel Tx Power */
case 0x000E: /* LE Create Connection Cancel */
case 0x000F: /* LE Read White List Size */
case 0x0010: /* LE Clear White List */
case 0x0018: /* LE Rand */
case 0x001C: /* LE Read Supported States */
case 0x001F: /* LE Test End */
case 0x0023: /* LE Read Suggested Default Data Length */
case 0x0025: /* LE Read Local P-256 Public Key */
case 0x0029: /* LE Clear Resolving List */
case 0x002A: /* LE Read Resolving List Size */
case 0x002F: /* LE Read Maximum Data Length */
case 0x003A: /* LE Read Maximum Advertising Data Length */
case 0x003B: /* LE Read Number of Supported Advertising Sets */
case 0x003D: /* LE Clear Advertising Sets */
case 0x0045: /* LE Periodic Advertising Create Sync Cancel */
case 0x0049: /* LE Clear Periodic Advertiser List */
case 0x004A: /* LE Read Periodic Advertiser List Size */
case 0x004B: /* LE Read Transmit Power */
case 0x004C: /* LE Read RF Path Compensation */
case 0x0058: /* LE Read Antenna Information */
/* NOTE: No parameters */
break;
@ -6319,9 +6624,29 @@ proto_register_bthci_cmd(void)
FT_BOOLEAN, 64, NULL, G_GUINT64_CONSTANT(0x80000),
NULL, HFILL }
},
{ &hf_bthci_cmd_le_event_mask_le_connectionless_iq_report,
{ "LE Connectionless IQ Report", "bthci_cmd.le_event_mask.le_connectionless_iq_report",
FT_BOOLEAN, 64, NULL, G_GUINT64_CONSTANT(0x100000),
NULL, HFILL }
},
{ &hf_bthci_cmd_le_event_mask_le_connection_iq_report,
{ "LE Connection IQ Report", "bthci_cmd.le_event_mask.le_connection_iq_report",
FT_BOOLEAN, 64, NULL, G_GUINT64_CONSTANT(0x200000),
NULL, HFILL }
},
{ &hf_bthci_cmd_le_event_mask_le_cte_request_failed,
{ "LE CTE Request Failed", "bthci_cmd.le_event_mask.le_cte_request_failed",
FT_BOOLEAN, 64, NULL, G_GUINT64_CONSTANT(0x400000),
NULL, HFILL }
},
{ &hf_bthci_cmd_le_event_mask_le_periodic_advertising_sync_transfer_received,
{ "LE Periodic Advertising Sync Transfer Received", "bthci_cmd.le_event_mask.le_periodic_advertising_sync_transfer_received",
FT_BOOLEAN, 64, NULL, G_GUINT64_CONSTANT(0x800000),
NULL, HFILL }
},
{ &hf_bthci_cmd_le_event_mask_le_reserved,
{ "Reserved", "bthci_cmd.le_event_mask.reserved",
FT_UINT64, BASE_HEX, NULL, G_GUINT64_CONSTANT(0xFFFFFFFFFFF00000),
FT_UINT64, BASE_HEX, NULL, G_GUINT64_CONSTANT(0xFFFFFFFFFF000000),
NULL, HFILL }
},
{ &hf_bthci_cmd_le_advts_interval_min,
@ -6874,6 +7199,141 @@ proto_register_bthci_cmd(void)
FT_INT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_cte_length,
{ "CTE Length", "bthci_cmd.cte_length",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_cte_type,
{ "CTE Type", "bthci_cmd.cte_type",
FT_UINT8, BASE_HEX, VALS(cmd_cte_type_vals), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_slot_durations,
{ "Slot Durations", "bthci_cmd.slot_durations",
FT_UINT8, BASE_HEX, VALS(cmd_slot_durations_vals), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_antenna_switching_pattern_length,
{ "Antenna Switching Pattern Length", "bthci_cmd.antenna_switching_pattern_length",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_antenna_switching_pattern,
{ "Antenna Switching Pattern", "bthci_cmd.antenna_switching_pattern",
FT_NONE, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_antenna_id,
{ "Antenna Id", "bthci_cmd.antenna_id",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_cte_count,
{ "CTE Count", "bthci_cmd.cte_count",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_cte_enable,
{ "CTE Enable", "bthci_cmd.cte_enable",
FT_UINT8, BASE_HEX, VALS(disable_enable_vals), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_iq_sampling_enable,
{ "IQ Sampling Enable", "bthci_cmd.iq_sampling_enable",
FT_UINT8, BASE_HEX, VALS(disable_enable_vals), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_max_sampled_ctes,
{ "Max Sampled CTEs", "bthci_cmd.max_sampled_ctes",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_cte_request_interval,
{ "CTE Request Interval", "bthci_cmd.cte_request_interval",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_reporting_enable,
{ "Reporting Enable", "bthci_cmd.reporting_enable",
FT_UINT8, BASE_HEX, VALS(disable_enable_vals), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_sync_cte_type,
{ "Sync CTE Type", "bthci_cmd.sync_cte_type",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_sync_cte_type_no_sync_aoa,
{ "No sync to packets with AoA CTE", "bthci_cmd.sync_cte_type.no_sync_aoa",
FT_BOOLEAN, 8, NULL, 0x01,
NULL, HFILL }
},
{ &hf_bthci_cmd_sync_cte_type_no_sync_aod_1us,
{ "No sync to packets with AoD 1 usec CTE", "bthci_cmd.sync_cte_type.no_sync_aod_1us",
FT_BOOLEAN, 8, NULL, 0x02,
NULL, HFILL }
},
{ &hf_bthci_cmd_sync_cte_type_no_sync_aod_2us,
{ "No sync to packets with AoD 2 usec CTE", "bthci_cmd.sync_cte_type.no_sync_aod_2us",
FT_BOOLEAN, 8, NULL, 0x04,
NULL, HFILL }
},
{ &hf_bthci_cmd_sync_cte_type_sync_only_with_cte,
{ "Sync only to packets with CTE", "bthci_cmd.sync_cte_type.sync_only_with_cte",
FT_BOOLEAN, 8, NULL, 0x10,
NULL, HFILL }
},
{ &hf_bthci_cmd_sync_cte_type_reserved,
{ "Reserved", "bthci_cmd.sync_cte_type.reserved",
FT_UINT8, BASE_HEX, NULL, 0xE8,
NULL, HFILL }
},
{ &hf_bthci_cmd_cte_types,
{ "Allowed CTE Types", "bthci_cmd.cte_types",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_cte_types_aoa,
{ "AoA", "bthci_cmd.cte_types.aoa",
FT_BOOLEAN, 8, NULL, 0x01,
NULL, HFILL }
},
{ &hf_bthci_cmd_cte_types_aod_1us,
{ "AoD 1 usec slots", "bthci_cmd.cte_types.aod_1us",
FT_BOOLEAN, 8, NULL, 0x02,
NULL, HFILL }
},
{ &hf_bthci_cmd_cte_types_aod_2us,
{ "AoD 2 usec slots", "bthci_cmd.cte_types.aod_2us",
FT_BOOLEAN, 8, NULL, 0x04,
NULL, HFILL }
},
{ &hf_bthci_cmd_cte_types_reserved,
{ "Reserved", "bthci_cmd.cte_types.reserved",
FT_UINT8, BASE_HEX, NULL, 0xF8,
NULL, HFILL }
},
{ &hf_bthci_cmd_service_data_past,
{ "Service Data", "bthci_cmd.service_data_past",
FT_UINT16, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_sync_mode,
{ "Mode", "bthci_cmd.sync_mode",
FT_UINT8, BASE_HEX, VALS(cmd_sync_mode_vals), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_key_type,
{ "Key Type", "bthci_cmd.key_type",
FT_UINT8, BASE_HEX, VALS(cmd_key_type_vals), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_sca_action,
{ "Action", "bthci_cmd.sca_action",
FT_UINT8, BASE_HEX, VALS(cmd_sca_action_vals), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_triggered_clock_capture,
{ "Triggered Clock Capture", "bthci_cmd.triggered_clock_capture",
FT_UINT8, BASE_HEX, VALS(disable_enable_vals), 0x0,
@ -7367,6 +7827,7 @@ proto_register_bthci_cmd(void)
&ett_adv_sets,
&ett_phys_flags,
&ett_scan_init_phy_param,
&ett_sync_cte_type,
&ett_coding_format,
&ett_packet_type,
&ett_sco_packet_type,

View File

@ -33,6 +33,8 @@ extern value_string_ext bthci_cmd_eir_data_type_vals_ext;
extern value_string_ext bthci_cmd_auth_req_vals_ext;
extern value_string_ext bthci_cmd_appearance_vals_ext;
extern value_string_ext bthci_cmd_le_phy_vals_ext;
extern value_string_ext bthci_cmd_cte_type_vals_ext;
extern value_string_ext bthci_cmd_slot_durations_vals_ext;
extern const value_string bthci_cmd_io_capability_vals[];
extern const value_string bthci_cmd_oob_data_present_vals[];

View File

@ -373,6 +373,17 @@ static int hf_bthci_evt_le_features_periodic_advertising = -1;
static int hf_bthci_evt_le_features_channel_selection_algorithm_2 = -1;
static int hf_bthci_evt_le_features_power_class_1 = -1;
static int hf_bthci_evt_le_features_minimum_number_of_used_channels_procedure = -1;
static int hf_bthci_evt_le_features_connection_cte_request = -1;
static int hf_bthci_evt_le_features_connection_cte_response = -1;
static int hf_bthci_evt_le_features_connectionless_cte_tx = -1;
static int hf_bthci_evt_le_features_connectionless_cte_rx = -1;
static int hf_bthci_evt_le_features_antenna_switching_during_cte_tx_aod = -1;
static int hf_bthci_evt_le_features_antenna_switching_during_cte_rx_aoa = -1;
static int hf_bthci_evt_le_features_receiving_cte = -1;
static int hf_bthci_evt_le_features_periodic_advertising_sync_transfer_sender = -1;
static int hf_bthci_evt_le_features_periodic_advertising_sync_transfer_receiver = -1;
static int hf_bthci_evt_le_features_sleep_clock_accuracy_updates = -1;
static int hf_bthci_evt_le_features_remote_public_key_validation = -1;
static int hf_bthci_evt_le_features_reserved = -1;
static int hf_bthci_evt_mws_number_of_transports = -1;
static int hf_bthci_evt_mws_transport_layers = -1;
@ -466,6 +477,21 @@ static int hf_bthci_evt_rf_rx_path_compensation = -1;
static int hf_bthci_evt_sync_handle = -1;
static int hf_bthci_evt_data_status = -1;
static int hf_bthci_evt_advertising_handle = -1;
static int hf_bthci_evt_channel_index = -1;
static int hf_bthci_evt_cte_rssi = -1;
static int hf_bthci_evt_antenna_id = -1;
static int hf_bthci_evt_cte_type = -1;
static int hf_bthci_evt_slot_durations = -1;
static int hf_bthci_evt_packet_status = -1;
static int hf_bthci_evt_event_counter = -1;
static int hf_bthci_evt_sample_count = -1;
static int hf_bthci_evt_i_sample = -1;
static int hf_bthci_evt_q_sample = -1;
static int hf_bthci_evt_service_data_past = -1;
static int hf_bthci_evt_number_antennae = -1;
static int hf_bthci_evt_max_cte_length = -1;
static int hf_bthci_evt_max_length_antenna_switching_pattern = -1;
static int hf_bthci_evt_max_encryption_key_size = -1;
static int hf_packet_type_acl = -1;
static int hf_packet_type_acl_dh5 = -1;
static int hf_packet_type_acl_dm5 = -1;
@ -506,6 +532,17 @@ static const int *hfx_bthci_evt_le_features[] = {
&hf_bthci_evt_le_features_channel_selection_algorithm_2,
&hf_bthci_evt_le_features_power_class_1,
&hf_bthci_evt_le_features_minimum_number_of_used_channels_procedure,
&hf_bthci_evt_le_features_connection_cte_request,
&hf_bthci_evt_le_features_connection_cte_response,
&hf_bthci_evt_le_features_connectionless_cte_tx,
&hf_bthci_evt_le_features_connectionless_cte_rx,
&hf_bthci_evt_le_features_antenna_switching_during_cte_tx_aod,
&hf_bthci_evt_le_features_antenna_switching_during_cte_rx_aoa,
&hf_bthci_evt_le_features_receiving_cte,
&hf_bthci_evt_le_features_periodic_advertising_sync_transfer_sender,
&hf_bthci_evt_le_features_periodic_advertising_sync_transfer_receiver,
&hf_bthci_evt_le_features_sleep_clock_accuracy_updates,
&hf_bthci_evt_le_features_remote_public_key_validation,
&hf_bthci_evt_le_features_reserved,
NULL
};
@ -569,6 +606,29 @@ static const int *hfx_bthci_evt_le_ext_advts_evt_type[] = {
NULL
};
static int hf_bthci_evt_supported_switching_sample_rates = -1;
static int hf_bthci_evt_supported_switching_sample_rates_1us_switching_aod_tx = -1;
static int hf_bthci_evt_supported_switching_sample_rates_1us_sampling_aod_rx = -1;
static int hf_bthci_evt_supported_switching_sample_rates_1us_switching_and_sampling_aoa_rx = -1;
static int hf_bthci_evt_supported_switching_sample_rates_reserved = -1;
static const int *hfx_bthci_evt_supported_switching_sample_rates[] = {
&hf_bthci_evt_supported_switching_sample_rates_1us_switching_aod_tx,
&hf_bthci_evt_supported_switching_sample_rates_1us_sampling_aod_rx,
&hf_bthci_evt_supported_switching_sample_rates_1us_switching_and_sampling_aoa_rx,
&hf_bthci_evt_supported_switching_sample_rates_reserved,
NULL
};
static int hf_bthci_evt_simple_pairing_options = -1;
static int hf_bthci_evt_simple_pairing_options_remote_public_key_validation = -1;
static int hf_bthci_evt_simple_pairing_options_reserved = -1;
static const int *hfx_bthci_evt_simple_pairing_options[] = {
&hf_bthci_evt_simple_pairing_options_remote_public_key_validation,
&hf_bthci_evt_simple_pairing_options_reserved,
NULL
};
/* Initialize the subtree pointers */
static gint ett_bthci_evt = -1;
@ -588,6 +648,10 @@ static gint ett_mws_from_mws_baud_rates = -1;
static gint ett_mws_from_mws_baud_rates_transport_item = -1;
static gint ett_expert = -1;
static gint ett_le_ext_advts_event_type = -1;
static gint ett_iq_sample_list = -1;
static gint ett_iq_samples = -1;
static gint ett_simple_pairing_options = -1;
static gint ett_supported_switching_sample_rates = -1;
extern value_string_ext ext_usb_vendors_vals;
extern value_string_ext ext_usb_products_vals;
@ -741,6 +805,7 @@ const value_string bthci_evt_lmp_version[] = {
{0x07, "4.1"},
{0x08, "4.2"},
{0x09, "5.0"},
{0x0a, "5.1"},
{0, NULL }
};
@ -758,6 +823,7 @@ const value_string bthci_evt_hci_version[] = {
{0x07, "4.1"},
{0x08, "4.2"},
{0x09, "5.0"},
{0x0a, "5.1"},
{0, NULL }
};
@ -913,6 +979,10 @@ static const value_string evt_le_meta_subevent[] = {
{ 0x12, "LE Advertising Set Terminated" },
{ 0x13, "LE Scan Request Received" },
{ 0x14, "LE Channel Selection Algorithm" },
{ 0x15, "LE Connectionless IQ Report" },
{ 0x16, "LE Connection IQ Report" },
{ 0x17, "LE CTE Request Failed" },
{ 0x18, "LE Periodic Advertising Sync Transfer Received" },
{ 0, NULL }
};
@ -1021,6 +1091,14 @@ static const value_string unique_sam_disabled[] = {
{ 0, NULL }
};
static const value_string packet_status_vals[] = {
{ 0x00, "CRC correct" },
{ 0x01, "CRC incorrect, Length and CTETime fields used to determine sampling points" },
{ 0x02, "CRC incorrect, position and length of the CTE determined in some other way" },
{ 0xFF, "Insufficient resources, Channel Index, CTE Type, and Slot Durations invalid" },
{ 0, NULL }
};
static const unit_name_string units_number_events = { " (number events)", NULL };
@ -1165,6 +1243,41 @@ static void send_hci_summary_reason_tap(guint8 reason, packet_info *pinfo, bluet
}
}
static int
dissect_iq_sample_list(tvbuff_t *tvb, int offset, proto_tree *tree)
{
guint8 samples;
proto_tree_add_item(tree, hf_bthci_evt_sample_count, tvb, offset, 1, ENC_NA);
samples = tvb_get_guint8(tvb, offset);
offset += 1;
if (samples > 0) {
guint8 i;
proto_item *sub_item;
proto_tree *sub_tree;
sub_item = proto_tree_add_none_format(tree, hf_bthci_evt_le_report, tvb, offset, 2 * samples, "IQ Samples");
sub_tree = proto_item_add_subtree(sub_item, ett_iq_sample_list);
for (i = 0; i < samples; i++) {
proto_item *sample_item;
proto_tree *sample_tree;
sample_item = proto_tree_add_none_format(sub_tree, hf_bthci_evt_le_report, tvb, offset, 2, "Sample %2d, I:%4d, Q:%4d",
i, tvb_get_gint8(tvb, offset), tvb_get_gint8(tvb, offset+1));
sample_tree = proto_item_add_subtree(sample_item, ett_iq_samples);
proto_tree_add_item(sample_tree, hf_bthci_evt_i_sample, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(sample_tree, hf_bthci_evt_q_sample, tvb, offset, 1, ENC_NA);
offset += 1;
}
}
return offset;
}
static int
dissect_bthci_evt_inquire_complete(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, bluetooth_data_t *bluetooth_data)
@ -2752,6 +2865,80 @@ dissect_bthci_evt_le_meta(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree_add_item(tree, hf_bthci_evt_channel_selection_algorithm, tvb, offset, 1, ENC_NA);
offset += 1;
break;
case 0x15: /* LE Connectionless IQ Report */
proto_tree_add_item(tree, hf_bthci_evt_sync_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_bthci_evt_channel_index, tvb, offset, 1, ENC_NA);
offset += 1;
item = proto_tree_add_item(tree, hf_bthci_evt_cte_rssi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g dBm)", tvb_get_letohis(tvb, offset)*0.1);
offset += 2;
proto_tree_add_item(tree, hf_bthci_evt_antenna_id, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_bthci_evt_cte_type, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_bthci_evt_slot_durations, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_bthci_evt_packet_status, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_bthci_evt_event_counter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
offset = dissect_iq_sample_list(tvb, offset, tree);
break;
case 0x16: /* LE Connection IQ Report */
proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_bthci_evt_le_rx_phy, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_bthci_evt_channel_index, tvb, offset, 1, ENC_NA);
offset += 1;
item = proto_tree_add_item(tree, hf_bthci_evt_cte_rssi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g dBm)", tvb_get_letohis(tvb, offset)*0.1);
offset += 2;
proto_tree_add_item(tree, hf_bthci_evt_antenna_id, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_bthci_evt_cte_type, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_bthci_evt_slot_durations, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_bthci_evt_packet_status, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_bthci_evt_event_counter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
offset = dissect_iq_sample_list(tvb, offset, tree);
break;
case 0x17: /* LE CTE Request Failed */
proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
status = tvb_get_guint8(tvb, offset);
send_hci_summary_status_tap(status, pinfo, bluetooth_data);
offset += 1;
proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
break;
case 0x18: /* LE Periodic Advertising Sync Transfer Received */
proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
status = tvb_get_guint8(tvb, offset);
send_hci_summary_status_tap(status, pinfo, bluetooth_data);
offset += 1;
proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_bthci_evt_service_data_past, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_bthci_evt_sync_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_bthci_evt_advertising_sid, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_bthci_evt_le_peer_address_type, tvb, offset, 1, ENC_NA);
offset += 1;
offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, FALSE, bluetooth_data->interface_id, bluetooth_data->adapter_id, bd_addr);
proto_tree_add_item(tree, hf_bthci_evt_advertiser_phy, tvb, offset, 1, ENC_NA);
offset += 1;
item = proto_tree_add_item(tree, hf_bthci_evt_periodic_advertising_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g msec)", tvb_get_letohs(tvb, offset)*1.25);
offset += 2;
proto_tree_add_item(tree, hf_bthci_evt_advertiser_clock_accuracy, tvb, offset, 1, ENC_NA);
offset += 1;
break;
default:
break;
}
@ -3152,8 +3339,8 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset,
case 0x2011: /* LE Add Device To White List */
case 0x2012: /* LE Remove Device From White List */
case 0x2014: /* LE Set Host Channel Classification */
case 0x201d: /* LE Receiver Test */
case 0x201e: /* LE Transmitter Test */
case 0x201d: /* LE Receiver Test [v1] */
case 0x201e: /* LE Transmitter Test [v1] */
case 0x2024: /* LE Write Suggested Default Data Length */
case 0x2027: /* LE Add Device to Resolving List */
case 0x2028: /* LE Remove Device From Resolving List */
@ -3161,8 +3348,8 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset,
case 0x202D: /* LE Set Address Resolution Enable */
case 0x202E: /* LE Set Resolvable Private Address Timeout */
case 0x2031: /* LE Set Default PHY */
case 0x2033: /* LE Enhanced Receiver Test */
case 0x2034: /* LE Enhanced Transmitter Test */
case 0x2033: /* LE Receiver Test [v2] */
case 0x2034: /* LE Transmitter Test [v2] */
case 0x2035: /* LE Set Advertising Set Random Address */
case 0x2037: /* LE Set Extended Advertising Data */
case 0x2038: /* LE Set Extended Scan Response Data */
@ -3181,6 +3368,13 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset,
case 0x2049: /* LE Clear Periodic Advertiser List */
case 0x204D: /* LE Write RF Path Compensation */
case 0x204E: /* LE Set Privacy Mode */
case 0x204F: /* LE Receiver Test [v3] */
case 0x2050: /* LE Transmitter Test [v3] */
case 0x2051: /* LE Set Connectionless CTE Transmit Parameters */
case 0x2052: /* LE Set Connectionless CTE Transmit Enable */
case 0x2059: /* LE Set Periodic Advertising Receive Enable */
case 0x205D: /* LE Set Default Periodic Advertising Sync Transfer Parameters */
case 0x205F: /* LE Modify Sleep Clock Accuracy */
proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
send_hci_summary_status_tap(tvb_get_guint8(tvb, offset), pinfo, bluetooth_data);
offset += 1;
@ -3272,6 +3466,13 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset,
case 0x2020: /* LE Remote Connection Parameter Request Reply */
case 0x2021: /* LE Remote Connection Parameter Request Negative Reply */
case 0x2022: /* LE Set Data Length */
case 0x2054: /* LE Set Connection CTE Receive Parameters */
case 0x2055: /* LE Set Connection CTE Transmit Parameters */
case 0x2056: /* LE Connection CTE Request Enable */
case 0x2057: /* LE Connection CTE Response Enable */
case 0x205A: /* LE Periodic Advertising Sync Transfer */
case 0x205B: /* LE Periodic Advertising Set Info Transfer */
case 0x205C: /* LE Set Periodic Advertising Sync Transfer Parameters */
proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
send_hci_summary_status_tap(tvb_get_guint8(tvb, offset), pinfo, bluetooth_data);
offset += 1;
@ -4220,6 +4421,17 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset,
}
break;
case 0x100c: /* Read Local Simple Pairing Options */
proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
status = tvb_get_guint8(tvb, offset);
send_hci_summary_status_tap(status, pinfo, bluetooth_data);
offset += 1;
proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_simple_pairing_options, ett_simple_pairing_options, hfx_bthci_evt_simple_pairing_options, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_bthci_evt_max_encryption_key_size, tvb, offset, 1, ENC_NA);
offset += 1;
break;
case 0x1007: /* Read Country Code */
proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
send_hci_summary_status_tap(tvb_get_guint8(tvb, offset), pinfo, bluetooth_data);
@ -4652,6 +4864,16 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset,
break;
}
case 0x2053: /* LE Set Connectionless IQ Sampling Enable */
{
proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
send_hci_summary_status_tap(tvb_get_guint8(tvb, offset), pinfo, bluetooth_data);
offset += 1;
proto_tree_add_item(tree, hf_bthci_evt_sync_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
break;
}
case 0x0441: /* Set Connectionless Slave Broadcast */
proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
send_hci_summary_status_tap(tvb_get_guint8(tvb, offset), pinfo, bluetooth_data);
@ -4884,6 +5106,21 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset,
proto_item_append_text(item, " (%g dB)", tvb_get_letohis(tvb, offset)*0.1);
offset += 2;
break;
case 0x2058: /* LE Read Antenna Information */
proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
send_hci_summary_status_tap(tvb_get_guint8(tvb, offset), pinfo, bluetooth_data);
offset += 1;
proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_supported_switching_sample_rates,
ett_supported_switching_sample_rates, hfx_bthci_evt_supported_switching_sample_rates, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_bthci_evt_number_antennae, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_bthci_evt_max_length_antenna_switching_pattern, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_bthci_evt_max_cte_length, tvb, offset, 1, ENC_NA);
offset += 1;
break;
case 0x0401: /* Inquiry */
case 0x0405: /* Create Connection */
@ -4932,7 +5169,8 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset,
case 0x2016: /* LE Read Remote Used Features */
case 0x2019: /* LE Start Encryption */
case 0x2025: /* LE Read Local P-256 Public Key */
case 0x2026: /* LE Generate DHKey */
case 0x2026: /* LE Generate DHKey [v1] */
case 0x205E: /* LE Generate DHKey [v2] */
proto_tree_add_expert(tree, pinfo, &ei_event_unexpected_event, tvb, offset, tvb_captured_length_remaining(tvb, offset));
offset += tvb_reported_length_remaining(tvb, offset);
@ -8017,9 +8255,64 @@ proto_register_bthci_evt(void)
FT_BOOLEAN, 64, NULL, 0x10000,
NULL, HFILL }
},
{ &hf_bthci_evt_le_features_connection_cte_request,
{ "Connection CTE Request", "bthci_evt.le_features.connection_cte_request",
FT_BOOLEAN, 64, NULL, 0x20000,
NULL, HFILL }
},
{ &hf_bthci_evt_le_features_connection_cte_response,
{ "Connection CTE Response", "bthci_evt.le_features.connection_cte_response",
FT_BOOLEAN, 64, NULL, 0x40000,
NULL, HFILL }
},
{ &hf_bthci_evt_le_features_connectionless_cte_tx,
{ "Connectionless CTE Tx", "bthci_evt.le_features.connectionless_cte_tx",
FT_BOOLEAN, 64, NULL, 0x80000,
NULL, HFILL }
},
{ &hf_bthci_evt_le_features_connectionless_cte_rx,
{ "Connectionless CTE Rx", "bthci_evt.le_features.connectionless_cte_rx",
FT_BOOLEAN, 64, NULL, 0x100000,
NULL, HFILL }
},
{ &hf_bthci_evt_le_features_antenna_switching_during_cte_tx_aod,
{ "Antenna Switching During CTE Tx (AoD)", "bthci_evt.le_features.antenna_switching_during_cte_tx_aod",
FT_BOOLEAN, 64, NULL, 0x200000,
NULL, HFILL }
},
{ &hf_bthci_evt_le_features_antenna_switching_during_cte_rx_aoa,
{ "Antenna Switching During CTE Rx (AoA)", "bthci_evt.le_features.antenna_switching_during_cte_rx_aoa",
FT_BOOLEAN, 64, NULL, 0x400000,
NULL, HFILL }
},
{ &hf_bthci_evt_le_features_receiving_cte,
{ "Receiving CTE", "bthci_evt.le_features.receiving_cte",
FT_BOOLEAN, 64, NULL, 0x800000,
NULL, HFILL }
},
{ &hf_bthci_evt_le_features_periodic_advertising_sync_transfer_sender,
{ "Periodic Advertising Sync Transfer - Sender", "bthci_evt.le_features.periodic_advertising_sync_transfer_sender",
FT_BOOLEAN, 64, NULL, 0x1000000,
NULL, HFILL }
},
{ &hf_bthci_evt_le_features_periodic_advertising_sync_transfer_receiver,
{ "Periodic Advertising Sync Transfer - Receiver", "bthci_evt.le_features.periodic_advertising_sync_transfer_receiver",
FT_BOOLEAN, 64, NULL, 0x2000000,
NULL, HFILL }
},
{ &hf_bthci_evt_le_features_sleep_clock_accuracy_updates,
{ "Sleep Clock Accuracy Updates", "bthci_evt.le_features.sleep_clock_accuracy_updates",
FT_BOOLEAN, 64, NULL, 0x4000000,
NULL, HFILL }
},
{ &hf_bthci_evt_le_features_remote_public_key_validation,
{ "Remote Public Key Validation", "bthci_evt.le_features.remote_public_key_validation",
FT_BOOLEAN, 64, NULL, 0x8000000,
NULL, HFILL }
},
{ &hf_bthci_evt_le_features_reserved,
{ "Reserved", "bthci_evt.le_features.reserved",
FT_UINT64, BASE_HEX, NULL, G_GUINT64_CONSTANT(0xFFFFFFFFFFFE0000),
FT_UINT64, BASE_HEX, NULL, G_GUINT64_CONSTANT(0xFFFFFFFFF0000000),
NULL, HFILL }
},
{ &hf_bthci_evt_mws_number_of_transports,
@ -8522,6 +8815,121 @@ proto_register_bthci_evt(void)
FT_INT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_evt_channel_index,
{ "Channel Index", "bthci_evt.channel_index",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_evt_cte_rssi,
{ "RSSI", "bthci_evt.cte_rssi",
FT_INT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_evt_antenna_id,
{ "Antenna Id", "bthci_evt.antenna_id",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_evt_cte_type,
{ "CTE Type", "bthci_evt.cte_type",
FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_cte_type_vals_ext, 0x0,
NULL, HFILL }
},
{ &hf_bthci_evt_slot_durations,
{ "Slot Durations", "bthci_evt.slot_durations",
FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_slot_durations_vals_ext, 0x0,
NULL, HFILL }
},
{ &hf_bthci_evt_packet_status,
{ "Packet Status", "bthci_evt.packet_status",
FT_UINT8, BASE_HEX, VALS(packet_status_vals), 0x0,
NULL, HFILL }
},
{ &hf_bthci_evt_event_counter,
{ "Event Counter", "bthci_evt.event_counter",
FT_UINT16, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_evt_sample_count,
{ "Sample Count", "bthci_evt.sample_count",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_evt_i_sample,
{ "I", "bthci_evt.i_sample",
FT_INT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_evt_q_sample,
{ "Q", "bthci_evt.q_sample",
FT_INT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_evt_service_data_past,
{ "Service Data", "bthci_evt.service_data_past",
FT_UINT16, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_evt_number_antennae,
{ "Number of Antennae", "bthci_evt.number_antennae",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_evt_max_cte_length,
{ "Max CTE Length", "bthci_evt.max_cte_length",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_evt_max_length_antenna_switching_pattern,
{ "Max Length Antenna Switching Pattern", "bthci_evt.max_length_antenna_switching_pattern",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_evt_supported_switching_sample_rates,
{ "Supported Swithcing Sampling Rates", "bthci_evt.supported_switching_sample_rates",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_evt_supported_switching_sample_rates_1us_switching_aod_tx,
{ "1 usec switching for AoD Tx", "bthci_evt.supported_switching_sample_rates.1us_switching_aod_tx",
FT_BOOLEAN, 8, NULL, 0x01,
NULL, HFILL }
},
{ &hf_bthci_evt_supported_switching_sample_rates_1us_sampling_aod_rx,
{ "1 usec sampling for AoD Rx", "bthci_evt.supported_switching_sample_rates.1us_sampling_aod_rx",
FT_BOOLEAN, 8, NULL, 0x02,
NULL, HFILL }
},
{ &hf_bthci_evt_supported_switching_sample_rates_1us_switching_and_sampling_aoa_rx,
{ "1 usec switching and sampling for AoA Rx", "bthci_evt.supported_switching_sample_rates.1us_switching_and_sampling_aoa_rx",
FT_BOOLEAN, 8, NULL, 0x04,
NULL, HFILL }
},
{ &hf_bthci_evt_supported_switching_sample_rates_reserved,
{ "Reserved", "bthci_evt.supported_switching_sample_rates.reserved",
FT_UINT8, BASE_HEX, NULL, 0xF8,
NULL, HFILL }
},
{ &hf_bthci_evt_simple_pairing_options,
{ "Simple Pairing Options", "bthci_evt.simple_pairing_options",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_evt_simple_pairing_options_remote_public_key_validation,
{ "Remote Public Key Validation", "bthci_evt.simple_pairing_options.remote_public_key_validation",
FT_BOOLEAN, 8, NULL, 0x01,
NULL, HFILL }
},
{ &hf_bthci_evt_simple_pairing_options_reserved,
{ "Reserved", "bthci_evt.simple_pairing_options.reserved",
FT_UINT8, BASE_HEX, NULL, 0xFE,
NULL, HFILL }
},
{ &hf_bthci_evt_max_encryption_key_size,
{ "Max Encryption Key Size", "bthci_evt.max_encryption_key_size",
FT_UINT8, BASE_DEC, &units_octet_octets, 0x0,
NULL, HFILL }
},
};
static ei_register_info ei[] = {
@ -8553,7 +8961,11 @@ proto_register_bthci_evt(void)
&ett_mws_from_mws_baud_rates,
&ett_mws_from_mws_baud_rates_transport_item,
&ett_expert,
&ett_le_ext_advts_event_type
&ett_le_ext_advts_event_type,
&ett_iq_sample_list,
&ett_iq_samples,
&ett_simple_pairing_options,
&ett_supported_switching_sample_rates
};
/* Decode As handling