diff options
author | Michal Labedzki <michal.labedzki@tieto.com> | 2017-01-16 09:53:27 +0100 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-01-17 21:04:22 +0000 |
commit | ae03fc73539e0ca65edaea0e37a724ff8169de9f (patch) | |
tree | a2c389f2cd00af75c4b82f47c25bbe5b99fed20e /epan/dissectors/packet-bthci_evt.c | |
parent | 57f530a7fe06ff7325804a4a2a2aac6cd657ba02 (diff) |
Bluetooth: HCI_EVT: Implement some commands from Core 4
Now all unimplemented commands are in /* TODO */
Change-Id: I53c8dd0a660b62403214a3c75297e627337ed5fb
Reviewed-on: https://code.wireshark.org/review/19645
Petri-Dish: Michal Labedzki <michal.tomasz.labedzki@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-bthci_evt.c')
-rw-r--r-- | epan/dissectors/packet-bthci_evt.c | 467 |
1 files changed, 367 insertions, 100 deletions
diff --git a/epan/dissectors/packet-bthci_evt.c b/epan/dissectors/packet-bthci_evt.c index 222fa2d3c9..ce3eb41d4b 100644 --- a/epan/dissectors/packet-bthci_evt.c +++ b/epan/dissectors/packet-bthci_evt.c @@ -103,6 +103,7 @@ static int hf_bthci_evt_link_key = -1; static int hf_bthci_evt_key_type = -1; static int hf_bthci_evt_max_slots = -1; static int hf_bthci_evt_clock_offset = -1; +static int hf_bthci_evt_clock_offset_32 = -1; static int hf_bthci_evt_link_type_2dh1 = -1; static int hf_bthci_evt_link_type_3dh1 = -1; static int hf_bthci_evt_link_type_dm1 = -1; @@ -390,6 +391,15 @@ static int hf_bthci_evt_mws_from_mws_baud_rates = -1; static int hf_bthci_evt_mws_from_mws_baud_rates_tranport_item = -1; static int hf_bthci_evt_mws_from_mws_baud_rate = -1; static int hf_bthci_evt_selected_tx_power = -1; +static int hf_bthci_evt_which_clock = -1; +static int hf_bthci_evt_slot_offset = -1; +static int hf_bthci_evt_lt_addr = -1; +static int hf_bthci_evt_next_broadcast_instant = -1; +static int hf_bthci_evt_connectionless_slave_broadcast_interval = -1; +static int hf_bthci_evt_service_data = -1; +static int hf_bthci_evt_receive_status = -1; +static int hf_bthci_evt_fragment = -1; +static int hf_bthci_evt_data = -1; static const int *hfx_bthci_evt_le_features[] = { &hf_bthci_evt_le_features_encryption, @@ -406,6 +416,8 @@ static const int *hfx_bthci_evt_le_features[] = { static expert_field ei_event_undecoded = EI_INIT; static expert_field ei_event_unknown_event = EI_INIT; +static expert_field ei_event_unexpected_event = EI_INIT; +static expert_field ei_event_unexpected_parameter = EI_INIT; static expert_field ei_event_unknown_command = EI_INIT; static expert_field ei_parameter_unexpected = EI_INIT; static expert_field ei_manufacturer_data_changed = EI_INIT; @@ -788,8 +800,30 @@ static const value_string mws_transport_layer_vals[] = { { 0, NULL } }; +static const value_string which_clock_vals[] = { + { 0x00, "Local Clock" }, + { 0x01, "Piconet Clock" }, + { 0, NULL } +}; + +static const value_string receive_status_vals[] = { + { 0x00, "Packet Received Successfully" }, + { 0x01, "Fragment, Data_Length or Data Fields Invalid" }, + { 0, NULL } +}; + +static const value_string fragment_vals[] = { + { 0x00, "Continuation" }, + { 0x01, "Start" }, + { 0x01, "End" }, + { 0x01, "No Fragmentation" }, + { 0, NULL } +}; + + static const unit_name_string units_number_events = { " (number events)", NULL }; + void proto_register_bthci_evt(void); void proto_reg_handoff_bthci_evt(void); @@ -2655,7 +2689,6 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c47: /* Write Page Scan Type */ case 0x0c49: /* Write AFH Channel Assessment Mode */ case 0x0c52: /* Write Extended Inquiry Response */ - case 0x0c53: /* Refresh Encryption Key */ case 0x0c56: /* Write Simple Pairing Mode */ case 0x0c59: /* Write Inquiry Tx Power Level */ case 0x0c5b: /* Write Default Erroneous Data Reporting */ @@ -2664,8 +2697,16 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c65: /* Write Location Data */ case 0x0c67: /* Write Flow Control Mode */ case 0x0c6a: /* Write Best Effort Timeout */ - case 0x0c6b: /* Short Range Mode */ case 0x0c6d: /* Write LE Host Supported */ + case 0x0c6e: /* Set MWS Channel Parameters */ + case 0x0c6f: /* Set External Frame Configuration */ + case 0x0c71: /* Set MWS Transport Layer */ + case 0x0c72: /* Set MWS Scan Frequency Table */ + case 0x0c73: /* Set MWS Pattern Configuration */ + case 0x0c7a: /* Write Secure Connections Host Support */ + case 0x0c7f: /* Write Extended Page Timeout */ + case 0x0c81: /* Write Extended Inquiry Length */ + case 0x140d: /* Set Triggered Clock Capture */ case 0x1802: /* Write Loopback Mode */ case 0x1803: /* Enable Device Under Test Mode */ case 0x1804: /* Write Simple Pairing Debug Mode */ @@ -2687,6 +2728,11 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x2014: /* LE Set Host Channel Classification */ case 0x201d: /* LE Receiver Test */ case 0x201e: /* LE Transmitter Test */ + case 0x2027: /* LE Add Device to Resolving List */ + case 0x2028: /* LE Remove Device From Resolving List */ + case 0x2029: /* LE Clear Resolving List */ + 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 */ @@ -2725,13 +2771,15 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x040e: /* PIN Code Request Negative Reply */ case 0x041a: /* Remote Name Request Cancel */ case 0x042b: /* IO Capability Request Reply */ - case 0x0434: /* IO Capability Request Negative Reply */ case 0x042c: /* User Confirmation Request Reply */ case 0x042d: /* User Confirmation Request Negative Reply */ case 0x042e: /* User Passkey Request Reply */ case 0x042f: /* User Passkey Request Negative Reply */ case 0x0430: /* Remote OOB Data Request Reply */ case 0x0433: /* Remote OOB Data Request Negative Reply */ + case 0x0434: /* IO Capability Request Negative Reply */ + case 0x0440: /* Truncated Page Cancel */ + case 0x0445: /* Remote OOB Extended Data Request Reply */ case 0x0c60: /* Send Keypress Notification */ 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); @@ -2787,10 +2835,14 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c08: /* Flush */ case 0x0c28: /* Write Automatic Flush Timeout */ case 0x0c37: /* Write Link Supervision Timeout */ - case 0x0c5f: /* Enhanced Flush */ + case 0x0c7c: /* Write Authenticated Payload Timeout */ case 0x1402: /* Reset Failed Contact Counter */ + case 0x180a: /* Write Secure Connections Test Mode */ case 0x201a: /* LE Long Term Key Request Reply */ case 0x201b: /* LE Long Term Key Request Neg Reply */ + case 0x2020: /* LE Remote Connection Parameter Request Reply */ + case 0x2021: /* LE Remote Connection Parameter Request Negative Reply */ + case 0x2022: /* LE Set Data Length */ 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; @@ -3470,6 +3522,19 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, offset += 1; break; + case 0x0c74: /* Set Reserved LT_ADDR */ + case 0x0c75: /* Delete Reserved LT_ADDR */ + case 0x0c76: /* Set Connectionless Slave Broadcast Data */ + proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN); + 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_lt_addr, tvb, offset, 1, ENC_LITTLE_ENDIAN); + offset += 1; + + break; + case 0x1001: /* Read Local Version Information */ { proto_item *hci_revision_item; proto_item *manufacturer_item; @@ -3830,6 +3895,84 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, offset += 1; break; + case 0x140C: /* Get MWS Transport Layer Configuration */ { + guint8 transports; + guint8 i_transport; + guint16 baud_rates = 0; + guint16 i_baud_rate; + gint32 baud_rate_to; + proto_item *sub_item; + proto_tree *sub_tree; + proto_item *sub2_item; + proto_tree *sub2_tree; + gint offset_baud_rates; + + 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_mws_number_of_transports, tvb, offset, 1, ENC_NA); + transports = tvb_get_guint8(tvb, offset); + offset += 1; + + sub_item = proto_tree_add_item(tree, hf_bthci_evt_mws_transport_layers, tvb, offset, transports * 2, ENC_NA); + sub_tree = proto_item_add_subtree(sub_item, ett_mws_transport_layers); + + offset_baud_rates = offset = 1; + + for (i_transport = 0; i_transport < transports; i_transport += 1) { + sub2_item = proto_tree_add_item(sub_tree, hf_bthci_evt_mws_transport_layers_item, tvb, offset, transports * 2, ENC_NA); + sub2_tree = proto_item_add_subtree(sub2_item, ett_mws_transport_layers_item); + proto_item_append_text(sub2_item, " #%u", i_transport + 1); + + proto_tree_add_item(sub2_tree, hf_bthci_evt_mws_transport_layer, tvb, offset, 1, ENC_NA); + offset += 1; + + proto_tree_add_item(sub2_tree, hf_bthci_evt_mws_number_of_baud_rates, tvb, offset, 1, ENC_NA); + baud_rates += tvb_get_guint8(tvb, offset); + offset += 1; + } + + sub_item = proto_tree_add_item(tree, hf_bthci_evt_mws_to_mws_baud_rates, tvb, offset, baud_rates * 4, ENC_NA); + sub_tree = proto_item_add_subtree(sub_item, ett_mws_to_mws_baud_rates); + + baud_rate_to = -1; + i_transport = 1; + sub2_tree = sub_tree; + for (i_baud_rate = 0; i_baud_rate < baud_rates; i_baud_rate += 1) { + if (baud_rate_to == -1 || baud_rate_to == i_baud_rate) { + baud_rate_to = tvb_get_guint8(tvb, offset_baud_rates + (i_transport - 1) * 2); + sub2_item = proto_tree_add_item(sub_tree, hf_bthci_evt_mws_to_mws_baud_rates_tranport_item, tvb, offset, (baud_rate_to - i_baud_rate) * 4, ENC_NA); + proto_item_append_text(sub2_item, " #%u", i_transport); + sub2_tree = proto_item_add_subtree(sub2_item, ett_mws_to_mws_baud_rates_transport_item); + i_transport += 1; + } + + proto_tree_add_item(sub2_tree, hf_bthci_evt_mws_to_mws_baud_rate, tvb, offset, 4, ENC_LITTLE_ENDIAN); + offset += 4; + } + + sub_item = proto_tree_add_item(tree, hf_bthci_evt_mws_from_mws_baud_rates, tvb, offset, baud_rates * 4, ENC_NA); + sub_tree = proto_item_add_subtree(sub_item, ett_mws_from_mws_baud_rates); + + baud_rate_to = -1; + i_transport = 1; + sub2_tree = sub_tree; + for (i_baud_rate = 0; i_baud_rate < baud_rates; i_baud_rate += 1) { + if (baud_rate_to == -1 || baud_rate_to == i_baud_rate) { + baud_rate_to = tvb_get_guint8(tvb, offset_baud_rates + (i_transport - 1) * 2); + sub2_item = proto_tree_add_item(sub_tree, hf_bthci_evt_mws_from_mws_baud_rates_tranport_item, tvb, offset, (baud_rate_to - i_baud_rate) * 4, ENC_NA); + proto_item_append_text(sub2_item, " #%u", i_transport); + sub2_tree = proto_item_add_subtree(sub2_item, ett_mws_from_mws_baud_rates_transport_item); + i_transport += 1; + } + + proto_tree_add_item(sub2_tree, hf_bthci_evt_mws_from_mws_baud_rate, tvb, offset, 4, ENC_LITTLE_ENDIAN); + offset += 4; + } + break; } + case 0x1801: /* Read Loopback Mode */ proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN); status = tvb_get_guint8(tvb, offset); @@ -4010,100 +4153,21 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, break; } - case 0x140C: /* Get MWS Transport Layer Configuration */ { - guint8 transports; - guint8 i_transport; - guint16 baud_rates = 0; - guint16 i_baud_rate; - gint32 baud_rate_to; - proto_item *sub_item; - proto_tree *sub_tree; - proto_item *sub2_item; - proto_tree *sub2_tree; - gint offset_baud_rates; - - 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_mws_number_of_transports, tvb, offset, 1, ENC_NA); - transports = tvb_get_guint8(tvb, offset); - offset += 1; - - sub_item = proto_tree_add_item(tree, hf_bthci_evt_mws_transport_layers, tvb, offset, transports * 2, ENC_NA); - sub_tree = proto_item_add_subtree(sub_item, ett_mws_transport_layers); - - offset_baud_rates = offset = 1; - - for (i_transport = 0; i_transport < transports; i_transport += 1) { - sub2_item = proto_tree_add_item(sub_tree, hf_bthci_evt_mws_transport_layers_item, tvb, offset, transports * 2, ENC_NA); - sub2_tree = proto_item_add_subtree(sub2_item, ett_mws_transport_layers_item); - proto_item_append_text(sub2_item, " #%u", i_transport + 1); - - proto_tree_add_item(sub2_tree, hf_bthci_evt_mws_transport_layer, tvb, offset, 1, ENC_NA); - offset += 1; - - proto_tree_add_item(sub2_tree, hf_bthci_evt_mws_number_of_baud_rates, tvb, offset, 1, ENC_NA); - baud_rates += tvb_get_guint8(tvb, offset); - offset += 1; - } - - sub_item = proto_tree_add_item(tree, hf_bthci_evt_mws_to_mws_baud_rates, tvb, offset, baud_rates * 4, ENC_NA); - sub_tree = proto_item_add_subtree(sub_item, ett_mws_to_mws_baud_rates); - - baud_rate_to = -1; - i_transport = 1; - sub2_tree = sub_tree; - for (i_baud_rate = 0; i_baud_rate < baud_rates; i_baud_rate += 1) { - if (baud_rate_to == -1 || baud_rate_to == i_baud_rate) { - baud_rate_to = tvb_get_guint8(tvb, offset_baud_rates + (i_transport - 1) * 2); - sub2_item = proto_tree_add_item(sub_tree, hf_bthci_evt_mws_to_mws_baud_rates_tranport_item, tvb, offset, (baud_rate_to - i_baud_rate) * 4, ENC_NA); - proto_item_append_text(sub2_item, " #%u", i_transport); - sub2_tree = proto_item_add_subtree(sub2_item, ett_mws_to_mws_baud_rates_transport_item); - i_transport += 1; - } - - proto_tree_add_item(sub2_tree, hf_bthci_evt_mws_to_mws_baud_rate, tvb, offset, 4, ENC_LITTLE_ENDIAN); - offset += 4; - } - - sub_item = proto_tree_add_item(tree, hf_bthci_evt_mws_from_mws_baud_rates, tvb, offset, baud_rates * 4, ENC_NA); - sub_tree = proto_item_add_subtree(sub_item, ett_mws_from_mws_baud_rates); - - baud_rate_to = -1; - i_transport = 1; - sub2_tree = sub_tree; - for (i_baud_rate = 0; i_baud_rate < baud_rates; i_baud_rate += 1) { - if (baud_rate_to == -1 || baud_rate_to == i_baud_rate) { - baud_rate_to = tvb_get_guint8(tvb, offset_baud_rates + (i_transport - 1) * 2); - sub2_item = proto_tree_add_item(sub_tree, hf_bthci_evt_mws_from_mws_baud_rates_tranport_item, tvb, offset, (baud_rate_to - i_baud_rate) * 4, ENC_NA); - proto_item_append_text(sub2_item, " #%u", i_transport); - sub2_tree = proto_item_add_subtree(sub2_item, ett_mws_from_mws_baud_rates_transport_item); - i_transport += 1; - } - - proto_tree_add_item(sub2_tree, hf_bthci_evt_mws_from_mws_baud_rate, tvb, offset, 4, ENC_LITTLE_ENDIAN); - offset += 4; - } - break; } - - case 0x0C7A: /* Write Secure Connections Host Support */ - case 0x2020: /* LE Remote Connection Parameter Request Reply */ - case 0x2021: /* LE Remote Connection Parameter Request Negative Reply */ - case 0x2022: /* LE Set Data Length */ + case 0x0441: /* Set Connectionless Slave Broadcast */ + case 0x0442: /* Set Connectionless Slave Broadcast Receive */ + case 0x0C70: /* Set MWS Signaling */ + case 0x0C77: /* Read Synchronization Train Parameters */ + case 0x0C78: /* Write Synchronization Train Parameters */ + case 0x0C79: /* Read Secure Connections Host Support */ + case 0x0C7B: /* Read Authenticated Payload Timeout */ + case 0x0C7D: /* Read Local OOB Extended Data */ + case 0x0C7E: /* Read Extended Page Timeout */ + case 0x0C80: /* Read Extended Inquiry Length */ case 0x2023: /* LE Read Suggested Default Data Length */ case 0x2024: /* LE Write Suggested Default Data Length */ - case 0x2025: /* LE Read Local P-256 Public Key */ - case 0x2026: /* LE Generate DHKey */ - case 0x2027: /* LE Add Device to Resolving List */ - case 0x2028: /* LE Remove Device From Resolving List */ - case 0x2029: /* LE Clear Resolving List */ case 0x202A: /* LE Read Resolving List Size */ case 0x202B: /* LE Read Peer Resolvable Address */ case 0x202C: /* LE Read Local Resolvable Address */ - case 0x202D: /* LE Set Address Resolution Enable */ - case 0x202E: /* LE Set Resolvable Private Address Timeout */ case 0x202F: /* LE Read Maximum Data Length */ /* TODO */ proto_tree_add_expert(tree, pinfo, &ei_event_undecoded, tvb, offset, tvb_captured_length_remaining(tvb, offset)); @@ -4111,6 +4175,67 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, break; + case 0x0401: /* Inquiry */ + case 0x0405: /* Create Connection */ + case 0x0406: /* Disconnect */ + case 0x0407: /* Add SCO Connection */ + case 0x0409: /* Accept Connection Request */ + case 0x040A: /* Reject Connection Request */ + case 0x040F: /* Change Connection Packet Type */ + case 0x0411: /* Authentication Requested */ + case 0x0413: /* Set Connection Encryption */ + case 0x0415: /* Change Connection Link Key */ + case 0x0417: /* Master Link Key */ + case 0x0419: /* Remote Name Request */ + case 0x041B: /* Read Remote Supported Features */ + case 0x041C: /* Read Remote Extended Features */ + case 0x041D: /* Read Remote Version Information */ + case 0x041F: /* Read Clock Offset */ + case 0x0428: /* Setup Synchronous Connection */ + case 0x0429: /* Accept Synchronous Connection Request */ + case 0x042A: /* Reject Synchronous Connection Request */ + case 0x0435: /* Create Physical Link */ + case 0x0436: /* Accept Physical Link */ + case 0x0437: /* Disconnect Physical Link */ + case 0x0438: /* Create Logical Link */ + case 0x0439: /* Accept Logical Link */ + case 0x043A: /* Disconnect Logical Link */ + case 0x043C: /* Flow Spec Modify */ + case 0x043D: /* Enhanced Setup Synchronous Connection */ + case 0x043E: /* Enhanced Accept Synchronous Connection Request */ + case 0x043F: /* Truncated Page */ + case 0x0443: /* Start Synchronization Train */ + case 0x0444: /* Receive Synchronization Train */ + case 0x0801: /* Hold Mode */ + case 0x0803: /* Sniff Mode */ + case 0x0804: /* Exit Sniff Mode */ + case 0x0805: /* Park State */ + case 0x0806: /* Exit Park State */ + case 0x0807: /* QoS Setup*/ + case 0x080B: /* Switch Role*/ + case 0x0810: /* Flow Specification */ + case 0x0C53: /* Refresh Encryption Key */ + case 0x0C5F: /* Enhanced Flush */ + case 0x0C6B: /* Short Range Mode */ + case 0x200D: /* LE Create Connection */ + case 0x2013: /* LE Connection Update */ + 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 */ + 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); + + break; + + case 0x0C35: /* Host Number Of Completed Packets */ + if (tvb_captured_length_remaining(tvb, offset) > 0) { + proto_tree_add_expert(tree, pinfo, &ei_event_unexpected_parameter, tvb, offset, tvb_captured_length_remaining(tvb, offset)); + offset += tvb_reported_length_remaining(tvb, offset); + } + + break; + default: proto_tree_add_expert(tree, pinfo, &ei_event_unknown_command, tvb, offset, tvb_captured_length_remaining(tvb, offset)); offset += tvb_reported_length_remaining(tvb, offset); @@ -4895,26 +5020,116 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat offset = dissect_bthci_evt_amp_status_change(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); break; - case 0x56: /* Inquiry Response Notification */ - proto_tree_add_item(bthci_evt_tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); + case 0x4e: /* Triggered Clock Capture */ + proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; - break; + proto_tree_add_item(tree, hf_bthci_evt_which_clock, tvb, offset, 1, ENC_LITTLE_ENDIAN); + offset += 1; - case 0x4e: /* Triggered Clock Capture */ + proto_tree_add_item(tree, hf_bthci_evt_clock, tvb, offset, 4, ENC_LITTLE_ENDIAN); + offset += 4; + + proto_tree_add_item(tree, hf_bthci_evt_slot_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN); + offset += 2; + + break; case 0x4f: /* Synchronization Train Complete */ + proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN); + offset += 1; + + break; case 0x50: /* Synchronization Train Received */ + proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN); + offset += 1; + + offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, FALSE, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL); + + proto_tree_add_item(tree, hf_bthci_evt_clock_offset_32, tvb, offset, 4, ENC_LITTLE_ENDIAN); + offset += 4; + + proto_tree_add_item(tree, hf_bthci_evt_afh_channel_map, tvb, offset, 10, ENC_NA); + offset += 10; + + proto_tree_add_item(tree, hf_bthci_evt_lt_addr, tvb, offset, 1, ENC_LITTLE_ENDIAN); + offset += 1; + + proto_tree_add_item(tree, hf_bthci_evt_next_broadcast_instant, tvb, offset, 4, ENC_LITTLE_ENDIAN); + offset += 4; + + proto_tree_add_item(tree, hf_bthci_evt_connectionless_slave_broadcast_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN); + offset += 2; + + proto_tree_add_item(tree, hf_bthci_evt_service_data, tvb, offset, 1, ENC_LITTLE_ENDIAN); + offset += 1; + + break; case 0x51: /* Connectionless Slave Broadcast Receive */ + { + guint8 length; + + offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, FALSE, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL); + + proto_tree_add_item(tree, hf_bthci_evt_lt_addr, tvb, offset, 1, ENC_LITTLE_ENDIAN); + offset += 1; + + proto_tree_add_item(tree, hf_bthci_evt_clock, tvb, offset, 4, ENC_LITTLE_ENDIAN); + offset += 4; + + proto_tree_add_item(tree, hf_bthci_evt_clock_offset_32, tvb, offset, 4, ENC_LITTLE_ENDIAN); + offset += 4; + + proto_tree_add_item(tree, hf_bthci_evt_receive_status, tvb, offset, 1, ENC_LITTLE_ENDIAN); + offset += 1; + + proto_tree_add_item(tree, hf_bthci_evt_fragment, tvb, offset, 1, ENC_LITTLE_ENDIAN); + offset += 1; + + proto_tree_add_item(tree, hf_bthci_evt_data_length, tvb, offset, 1, ENC_LITTLE_ENDIAN); + length = tvb_get_guint8(tvb, offset); + offset += 1; + + proto_tree_add_item(tree, hf_bthci_evt_data, tvb, offset, length, ENC_NA); + offset += 1; + + } + break; case 0x52: /* Connectionless Slave Broadcast Timeout */ + offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, FALSE, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL); + + proto_tree_add_item(tree, hf_bthci_evt_lt_addr, tvb, offset, 1, ENC_LITTLE_ENDIAN); + offset += 1; + + break; case 0x53: /* Truncated Page Complete */ + proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN); + offset += 1; + + offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, FALSE, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL); + + break; case 0x54: /* Slave Page Response Timeout */ + /* NOTE: no parameters */ + break; case 0x55: /* Connectionless Slave Broadcast Channel Map Change */ + proto_tree_add_item(tree, hf_bthci_evt_afh_channel_map, tvb, offset, 10, ENC_NA); + offset += 10; + + break; + case 0x56: /* Inquiry Response Notification */ + proto_tree_add_item(tree, hf_bthci_evt_iac_lap, tvb, offset, 3, ENC_LITTLE_ENDIAN); + offset += 3; + + proto_tree_add_item(tree, hf_bthci_evt_rssi, tvb, offset, 1, ENC_LITTLE_ENDIAN); + offset += 1; + + break; case 0xfe: /* Bluetooth Logo Testing */ /* TODO: Implement above cases */ proto_tree_add_expert(bthci_evt_tree, pinfo, &ei_event_undecoded, tvb, offset, tvb_captured_length_remaining(tvb, offset)); offset += tvb_reported_length_remaining(tvb, offset); - break; + break; case 0xff: /* Vendor-Specific */ if (!dissector_try_uint_new(vendor_dissector_table, HCI_VENDOR_DEFAULT, tvb, pinfo, tree, TRUE, bluetooth_data)) { if (bluetooth_data) { @@ -7002,14 +7217,66 @@ proto_register_bthci_evt(void) { "Selected TX Power (dBm)", "bthci_evt.transmit_power_level", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL } + }, + { &hf_bthci_evt_which_clock, + { "Which Clock", "bthci_evt.which_clock", + FT_UINT8, BASE_HEX, VALS(which_clock_vals), 0x0, + NULL, HFILL } + }, + { &hf_bthci_evt_slot_offset, + { "Slot Offset", "bthci_evt.slot_offset", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_bthci_evt_clock_offset_32, + { "Clock Offset", "bthci_evt.clock_offset_32", + FT_UINT32, BASE_HEX, NULL, 0x0FFFFFFF, + "Bits 0-27 of the Clock Offset between CLKslave-CLK", HFILL } + }, + { &hf_bthci_evt_next_broadcast_instant, + { "Next Broadcast Instant", "bthci_evt.next_broadcast_instant", + FT_UINT32, BASE_HEX, NULL, 0x0FFFFFFF, + "CLK of a future broadcast on this channel", HFILL } + }, + { &hf_bthci_evt_lt_addr, + { "LT_ADDR", "bthci_evt.lt_addr", + FT_UINT8, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, + { &hf_bthci_evt_connectionless_slave_broadcast_interval, + { "Connectionless Slave Broadcast Interval", "bthci_evt.connectionless_slave_broadcast_interval", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_bthci_evt_service_data, + { "Service Data", "bthci_evt.service_data", + FT_UINT8, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, + { &hf_bthci_evt_receive_status, + { "Receive Status", "bthci_evt.receive_status", + FT_UINT8, BASE_HEX, VALS(receive_status_vals), 0x0, + NULL, HFILL } + }, + { &hf_bthci_evt_fragment, + { "Fragment", "bthci_evt.fragment", + FT_UINT8, BASE_HEX, VALS(fragment_vals), 0x0, + NULL, HFILL } + }, + { &hf_bthci_evt_data, + { "Data", "bthci_evt.data", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL } } }; static ei_register_info ei[] = { { &ei_event_undecoded, { "bthci_evt.expert.event.undecoded", PI_UNDECODED, PI_NOTE, "Event undecoded", EXPFILL }}, { &ei_event_unknown_event, { "bthci_evt.expert.event.unknown_event", PI_PROTOCOL, PI_WARN, "Unknown event", EXPFILL }}, + { &ei_event_unexpected_event, { "bthci_evt.expert.event.unexpected_event", PI_PROTOCOL, PI_WARN, "Unexpected event", EXPFILL }}, + { &ei_event_unexpected_parameter, { "bthci_evt.expert.event.unexpected_parameter", PI_PROTOCOL, PI_WARN, "Unexpected parameter", EXPFILL }}, { &ei_event_unknown_command, { "bthci_evt.expert.event.unknown_command", PI_PROTOCOL, PI_WARN, "Unknown command", EXPFILL }}, - { &ei_parameter_unexpected, { "bthci_evt.expert.parameter.unexpected", PI_PROTOCOL, PI_WARN, "Unexpected command parameter", EXPFILL }}, + { &ei_parameter_unexpected, { "bthci_evt.expert.parameter.unexpected", PI_PROTOCOL, PI_WARN, "Unexpected command parameter", EXPFILL }}, { &ei_manufacturer_data_changed, { "bthci_evt.expert.event.manufacturer_data_changed", PI_PROTOCOL, PI_WARN, "Manufacturer data changed", EXPFILL }} }; @@ -7052,7 +7319,7 @@ proto_register_bthci_evt(void) module = prefs_register_protocol(proto_bthci_evt, NULL); prefs_register_static_text_preference(module, "hci_evt.version", - "Bluetooth HCI version: 4.0 (Core)", + "Bluetooth HCI version: 4.0 (Core) + Addendum 4", "Version of protocol supported by this dissector."); register_decode_as(&bthci_evt_vendor_da); |