diff options
-rw-r--r-- | docbook/release-notes.asciidoc | 1 | ||||
-rw-r--r-- | epan/dissectors/packet-bluetooth.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-bluetooth.h | 29 | ||||
-rw-r--r-- | epan/dissectors/packet-bthci_cmd.c | 33 | ||||
-rw-r--r-- | epan/dissectors/packet-bthci_evt.c | 414 | ||||
-rw-r--r-- | epan/dissectors/packet-bthci_vendor.c | 69 | ||||
-rw-r--r-- | ui/qt/CMakeLists.txt | 3 | ||||
-rw-r--r-- | ui/qt/Makefile.am | 2 | ||||
-rw-r--r-- | ui/qt/Makefile.common | 4 | ||||
-rw-r--r-- | ui/qt/Wireshark.pro | 3 | ||||
-rw-r--r-- | ui/qt/bluetooth_hci_summary_dialog.cpp | 727 | ||||
-rw-r--r-- | ui/qt/bluetooth_hci_summary_dialog.h | 124 | ||||
-rw-r--r-- | ui/qt/bluetooth_hci_summary_dialog.ui | 661 | ||||
-rw-r--r-- | ui/qt/main_window.h | 1 | ||||
-rw-r--r-- | ui/qt/main_window.ui | 6 | ||||
-rw-r--r-- | ui/qt/main_window_slots.cpp | 11 |
16 files changed, 2031 insertions, 59 deletions
diff --git a/docbook/release-notes.asciidoc b/docbook/release-notes.asciidoc index 74d8ebc7fd..e238c13393 100644 --- a/docbook/release-notes.asciidoc +++ b/docbook/release-notes.asciidoc @@ -36,6 +36,7 @@ since version 1.99.7: ** The reload button has been added back to the toolbar. ** The "Decode As" dialog no longer saves decoding behavior. ** You can now stop loading large capture files. +** The Bluetooth HCI Summary has been added. The following features are new (or have been significantly updated) since version 1.99.6: diff --git a/epan/dissectors/packet-bluetooth.c b/epan/dissectors/packet-bluetooth.c index 12bfec2008..43152d4680 100644 --- a/epan/dissectors/packet-bluetooth.c +++ b/epan/dissectors/packet-bluetooth.c @@ -61,6 +61,7 @@ static wmem_tree_t *hci_vendors = NULL; static int bluetooth_tap = -1; int bluetooth_device_tap = -1; +int bluetooth_hci_summary_tap = -1; const value_string bluetooth_uuid_vals[] = { /* Protocol Identifiers - https://www.bluetooth.org/en-us/specification/assigned-numbers/service-discovery */ @@ -1554,6 +1555,7 @@ proto_register_bluetooth(void) bluetooth_tap = register_tap("bluetooth"); bluetooth_device_tap = register_tap("bluetooth.device"); + bluetooth_hci_summary_tap = register_tap("bluetooth.hci_summary"); bluetooth_uuid_table = register_dissector_table("bluetooth.uuid", "BT Service UUID", FT_STRING, BASE_NONE); diff --git a/epan/dissectors/packet-bluetooth.h b/epan/dissectors/packet-bluetooth.h index 923eb1df69..a4a55cd1f7 100644 --- a/epan/dissectors/packet-bluetooth.h +++ b/epan/dissectors/packet-bluetooth.h @@ -229,7 +229,36 @@ typedef struct _bluetooth_device_tap_t { } data; } bluetooth_device_tap_t; +enum bluetooth_hci_summary_type { + BLUETOOTH_HCI_SUMMARY_OPCODE, + BLUETOOTH_HCI_SUMMARY_EVENT_OPCODE, + BLUETOOTH_HCI_SUMMARY_EVENT, + BLUETOOTH_HCI_SUMMARY_VENDOR_OPCODE, + BLUETOOTH_HCI_SUMMARY_VENDOR_EVENT_OPCODE, + BLUETOOTH_HCI_SUMMARY_VENDOR_EVENT, + BLUETOOTH_HCI_SUMMARY_STATUS, + BLUETOOTH_HCI_SUMMARY_STATUS_PENDING, + BLUETOOTH_HCI_SUMMARY_REASON, + BLUETOOTH_HCI_SUMMARY_HARDWARE_ERROR +}; + +typedef struct _bluetooth_hci_summary_tap_t { + guint32 interface_id; + guint32 adapter_id; + + guint8 ogf; + guint8 ocf; + guint8 event; + guint8 status; + guint8 reason; + guint8 hardware_error; + + const gchar *name; + enum bluetooth_hci_summary_type type; +} bluetooth_hci_summary_tap_t; + extern int bluetooth_device_tap; +extern int bluetooth_hci_summary_tap; WS_DLL_PUBLIC const value_string bluetooth_uuid_vals[]; WS_DLL_PUBLIC const bluetooth_uuid_custom_t bluetooth_uuid_custom[]; diff --git a/epan/dissectors/packet-bthci_cmd.c b/epan/dissectors/packet-bthci_cmd.c index 8546a57ef8..70c655c25b 100644 --- a/epan/dissectors/packet-bthci_cmd.c +++ b/epan/dissectors/packet-bthci_cmd.c @@ -3122,6 +3122,33 @@ dissect_bthci_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat ocf = opcode & 0x03ff; ogf = (guint8) (opcode >> 10); + if (ogf == HCI_OGF_VENDOR_SPECIFIC) + proto_item_append_text(ti_cmd," - %s", val_to_str_ext(opcode, &bthci_cmd_opcode_vals_ext, "Vendor Command 0x%04x")); + else + proto_item_append_text(ti_cmd," - %s", val_to_str_ext(opcode, &bthci_cmd_opcode_vals_ext, "Unknown 0x%04x")); + + if (have_tap_listener(bluetooth_hci_summary_tap)) { + bluetooth_hci_summary_tap_t *tap_hci_summary; + + tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t); + if (bluetooth_data) { + tap_hci_summary->interface_id = bluetooth_data->interface_id; + tap_hci_summary->adapter_id = bluetooth_data->adapter_id; + } else { + tap_hci_summary->interface_id = HCI_INTERFACE_DEFAULT; + tap_hci_summary->adapter_id = HCI_ADAPTER_DEFAULT; + } + + tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_OPCODE; + tap_hci_summary->ogf = ogf; + tap_hci_summary->ocf = ocf; + if (try_val_to_str_ext(opcode, &bthci_cmd_opcode_vals_ext)) + tap_hci_summary->name = val_to_str_ext(opcode, &bthci_cmd_opcode_vals_ext, "Unknown 0x%04x"); + else + tap_hci_summary->name = NULL; + tap_queue_packet(bluetooth_hci_summary_tap, pinfo, tap_hci_summary); + } + if (!pinfo->fd->flags.visited) { bthci_cmd_data = (bthci_cmd_data_t *) wmem_new(wmem_file_scope(), bthci_cmd_data_t); bthci_cmd_data->opcode = opcode; @@ -3133,12 +3160,6 @@ dissect_bthci_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat bthci_cmd_data->response_abs_ts = pinfo->fd->abs_ts; } - if (ogf == HCI_OGF_VENDOR_SPECIFIC) - proto_item_append_text(ti_cmd," - %s", val_to_str_ext(opcode, &bthci_cmd_opcode_vals_ext, "Vendor Command 0x%04x")); - else - proto_item_append_text(ti_cmd," - %s", val_to_str_ext(opcode, &bthci_cmd_opcode_vals_ext, "Unknown 0x%04x")); - - col_set_str(pinfo->cinfo, COL_PROTOCOL, "HCI_CMD"); ti_opcode = proto_tree_add_item(bthci_cmd_tree, hf_bthci_cmd_opcode, tvb, offset, 2, ENC_LITTLE_ENDIAN); diff --git a/epan/dissectors/packet-bthci_evt.c b/epan/dissectors/packet-bthci_evt.c index ee41d4293d..9e9466652f 100644 --- a/epan/dissectors/packet-bthci_evt.c +++ b/epan/dissectors/packet-bthci_evt.c @@ -810,10 +810,81 @@ save_remote_device_name(tvbuff_t *tvb, gint offset, packet_info *pinfo, } } +static void send_hci_summary_status_tap(guint8 status, packet_info *pinfo, bluetooth_data_t *bluetooth_data) +{ + if (have_tap_listener(bluetooth_hci_summary_tap)) { + bluetooth_hci_summary_tap_t *tap_hci_summary; + + tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t); + if (bluetooth_data) { + tap_hci_summary->interface_id = bluetooth_data->interface_id; + tap_hci_summary->adapter_id = bluetooth_data->adapter_id; + } else { + tap_hci_summary->interface_id = HCI_INTERFACE_DEFAULT; + tap_hci_summary->adapter_id = HCI_ADAPTER_DEFAULT; + } + + tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_STATUS; + tap_hci_summary->status = status; + if (try_val_to_str_ext(status, &bthci_cmd_status_vals_ext)) + tap_hci_summary->name = val_to_str_ext(status, &bthci_cmd_status_vals_ext, "Unknown 0x%02x"); + else + tap_hci_summary->name = NULL; + tap_queue_packet(bluetooth_hci_summary_tap, pinfo, tap_hci_summary); + } +} + +static void send_hci_summary_pending_tap(packet_info *pinfo, bluetooth_data_t *bluetooth_data) +{ + if (have_tap_listener(bluetooth_hci_summary_tap)) { + bluetooth_hci_summary_tap_t *tap_hci_summary; + + tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t); + if (bluetooth_data) { + tap_hci_summary->interface_id = bluetooth_data->interface_id; + tap_hci_summary->adapter_id = bluetooth_data->adapter_id; + } else { + tap_hci_summary->interface_id = HCI_INTERFACE_DEFAULT; + tap_hci_summary->adapter_id = HCI_ADAPTER_DEFAULT; + } + + tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_STATUS_PENDING; + tap_hci_summary->status = 0; + tap_hci_summary->name = "Pending"; + tap_queue_packet(bluetooth_hci_summary_tap, pinfo, tap_hci_summary); + } +} + +static void send_hci_summary_reason_tap(guint8 reason, packet_info *pinfo, bluetooth_data_t *bluetooth_data) +{ + if (have_tap_listener(bluetooth_hci_summary_tap)) { + bluetooth_hci_summary_tap_t *tap_hci_summary; + + tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t); + if (bluetooth_data) { + tap_hci_summary->interface_id = bluetooth_data->interface_id; + tap_hci_summary->adapter_id = bluetooth_data->adapter_id; + } else { + tap_hci_summary->interface_id = HCI_INTERFACE_DEFAULT; + tap_hci_summary->adapter_id = HCI_ADAPTER_DEFAULT; + } + + tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_REASON; + tap_hci_summary->reason = reason; + if (try_val_to_str_ext(reason, &bthci_cmd_status_vals_ext)) + tap_hci_summary->name = val_to_str_ext(reason, &bthci_cmd_status_vals_ext, "Unknown 0x%02x"); + else + tap_hci_summary->name = NULL; + tap_queue_packet(bluetooth_hci_summary_tap, pinfo, tap_hci_summary); + } +} + static int -dissect_bthci_evt_inquire_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) +dissect_bthci_evt_inquire_complete(tvbuff_t *tvb, int offset, packet_info *pinfo, + proto_tree *tree, bluetooth_data_t *bluetooth_data) { 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; return offset; @@ -906,7 +977,7 @@ dissect_bthci_evt_connect_request(tvbuff_t *tvb, int offset, packet_info *pinfo, } static int -dissect_bthci_evt_disconnect_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, +dissect_bthci_evt_disconnect_complete(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data) { guint32 connection_handle; @@ -914,6 +985,7 @@ dissect_bthci_evt_disconnect_complete(tvbuff_t *tvb, int offset, packet_info *pi 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_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -921,6 +993,7 @@ dissect_bthci_evt_disconnect_complete(tvbuff_t *tvb, int offset, packet_info *pi offset += 2; proto_tree_add_item(tree, hf_bthci_evt_reason, tvb, offset, 1, ENC_LITTLE_ENDIAN); + send_hci_summary_reason_tap(tvb_get_guint8(tvb, offset), pinfo, bluetooth_data); offset += 1; if (!pinfo->fd->flags.visited && status == STATUS_SUCCESS) { @@ -952,9 +1025,11 @@ dissect_bthci_evt_disconnect_complete(tvbuff_t *tvb, int offset, packet_info *pi } static int -dissect_bthci_evt_auth_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) +dissect_bthci_evt_auth_complete(tvbuff_t *tvb, int offset, packet_info *pinfo, + proto_tree *tree, bluetooth_data_t *bluetooth_data) { 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -1128,9 +1203,11 @@ dissect_bthci_evt_return_link_keys(tvbuff_t *tvb, int offset, packet_info *pinfo } static int -dissect_bthci_evt_read_remote_support_features_complete(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) +dissect_bthci_evt_read_remote_support_features_complete(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data) { 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -1148,6 +1225,7 @@ dissect_bthci_evt_remote_name_req_complete(tvbuff_t *tvb, int offset, guint8 bd_addr[6]; 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; offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, FALSE, bluetooth_data->interface_id, bluetooth_data->adapter_id, bd_addr); @@ -1211,9 +1289,11 @@ dissect_bthci_evt_remote_name_req_complete(tvbuff_t *tvb, int offset, } static int -dissect_bthci_evt_read_remote_version_information_complete(tvbuff_t *tvb, int offset, packet_info *pinfo, bluetooth_data_t *bluetooth_data, proto_tree *tree) +dissect_bthci_evt_read_remote_version_information_complete(tvbuff_t *tvb, int offset, + packet_info *pinfo, bluetooth_data_t *bluetooth_data, proto_tree *tree) { 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -1322,6 +1402,7 @@ dissect_bthci_evt_mode_change(tvbuff_t *tvb, int offset, packet_info *pinfo, 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_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -1378,6 +1459,7 @@ dissect_bthci_evt_role_change(tvbuff_t *tvb, int offset, packet_info *pinfo, 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; offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, FALSE, bluetooth_data->interface_id, bluetooth_data->adapter_id, bd_addr); @@ -1430,11 +1512,30 @@ dissect_bthci_evt_role_change(tvbuff_t *tvb, int offset, packet_info *pinfo, } static int -dissect_bthci_evt_hardware_error(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) +dissect_bthci_evt_hardware_error(tvbuff_t *tvb, int offset, packet_info *pinfo, + proto_tree *tree, bluetooth_data_t *bluetooth_data) { proto_tree_add_item(tree, hf_bthci_evt_hardware_code, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; + if (have_tap_listener(bluetooth_hci_summary_tap)) { + bluetooth_hci_summary_tap_t *tap_hci_summary; + + tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t); + if (bluetooth_data) { + tap_hci_summary->interface_id = bluetooth_data->interface_id; + tap_hci_summary->adapter_id = bluetooth_data->adapter_id; + } else { + tap_hci_summary->interface_id = HCI_INTERFACE_DEFAULT; + tap_hci_summary->adapter_id = HCI_ADAPTER_DEFAULT; + } + + tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_HARDWARE_ERROR; + tap_hci_summary->hardware_error = tvb_get_guint8(tvb, offset - 1); + tap_hci_summary->name = NULL; + tap_queue_packet(bluetooth_hci_summary_tap, pinfo, tap_hci_summary); + } + return offset; } @@ -1462,12 +1563,14 @@ dissect_bthci_evt_data_buffer_overflow(tvbuff_t *tvb, int offset, packet_info *p } static int -dissect_bthci_evt_read_clock_offset_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) +dissect_bthci_evt_read_clock_offset_complete(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data) { proto_item *handle_item; gint16 clk; 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -1503,13 +1606,15 @@ dissect_bthci_evt_qos_violation(tvbuff_t *tvb, int offset, packet_info *pinfo _U } static int -dissect_bthci_evt_conn_packet_type_changed(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) +dissect_bthci_evt_conn_packet_type_changed(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data) { guint16 packet_types; proto_tree *handle_tree; proto_item *ti_ptype_subtree; 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -1589,9 +1694,11 @@ dissect_bthci_evt_command_status(tvbuff_t *tvb, int offset, packet_info *pinfo, if (status_code != 0) { 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); } else { proto_tree_add_item(tree, hf_bthci_evt_status_pending, tvb, offset, 1, ENC_LITTLE_ENDIAN); + send_hci_summary_pending_tap(pinfo, bluetooth_data); } offset += 1; @@ -1601,6 +1708,28 @@ dissect_bthci_evt_command_status(tvbuff_t *tvb, int offset, packet_info *pinfo, opcode = tvb_get_letohs(tvb, offset); ogf = opcode >> 10; + if (have_tap_listener(bluetooth_hci_summary_tap)) { + bluetooth_hci_summary_tap_t *tap_hci_summary; + + tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t); + if (bluetooth_data) { + tap_hci_summary->interface_id = bluetooth_data->interface_id; + tap_hci_summary->adapter_id = bluetooth_data->adapter_id; + } else { + tap_hci_summary->interface_id = HCI_INTERFACE_DEFAULT; + tap_hci_summary->adapter_id = HCI_ADAPTER_DEFAULT; + } + + tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_EVENT_OPCODE; + tap_hci_summary->ogf = ogf; + tap_hci_summary->ocf = opcode & 0x03ff; + if (try_val_to_str_ext(opcode, &bthci_cmd_opcode_vals_ext)) + tap_hci_summary->name = val_to_str_ext(opcode, &bthci_cmd_opcode_vals_ext, "Unknown 0x%04x"); + else + tap_hci_summary->name = NULL; + tap_queue_packet(bluetooth_hci_summary_tap, pinfo, tap_hci_summary); + } + if (status_code != 0) add_opcode(opcode_list, opcode, COMMAND_STATUS_RESULT); else @@ -1777,6 +1906,7 @@ static int dissect_bthci_evt_simple_pairing_complete(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data) { 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; offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, FALSE, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL); @@ -1836,6 +1966,7 @@ dissect_bthci_evt_le_meta(tvbuff_t *tvb, int offset, packet_info *pinfo, case 0x01: /* LE Connection Complete */ 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_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -1937,7 +2068,9 @@ dissect_bthci_evt_le_meta(tvbuff_t *tvb, int offset, packet_info *pinfo, break; case 0x03: /* LE Connection Update Complete */ 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; + proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; item = proto_tree_add_item(tree, hf_bthci_evt_le_con_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -1954,7 +2087,9 @@ dissect_bthci_evt_le_meta(tvbuff_t *tvb, int offset, packet_info *pinfo, break; case 0x04: /* LE Read Remote Used Features Complete */ 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; + 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_feature_00, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -1984,10 +2119,13 @@ dissect_bthci_evt_le_meta(tvbuff_t *tvb, int offset, packet_info *pinfo, } static int -dissect_bthci_evt_physical_link_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) +dissect_bthci_evt_physical_link_complete(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data) { 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; + proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; return offset; @@ -2002,15 +2140,20 @@ dissect_bthci_evt_channel_select_physical_link_recovery(tvbuff_t *tvb, int offse } static int -dissect_bthci_evt_disconnect_physical_link_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) +dissect_bthci_evt_disconnect_physical_link_complete(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data) { 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; proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; + proto_tree_add_item(tree, hf_bthci_evt_reason, tvb, offset, 1, ENC_LITTLE_ENDIAN); + send_hci_summary_reason_tap(tvb_get_guint8(tvb, offset), pinfo, bluetooth_data); offset += 1; + return offset; } @@ -2025,10 +2168,13 @@ dissect_bthci_evt_physical_link_loss_early_warning(tvbuff_t *tvb, int offset, pa } static int -dissect_bthci_evt_logical_link_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) +dissect_bthci_evt_logical_link_complete(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data) { 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; + proto_tree_add_item(tree, hf_bthci_evt_logical_link_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -2039,22 +2185,31 @@ dissect_bthci_evt_logical_link_complete(tvbuff_t *tvb, int offset, packet_info * } static int -dissect_bthci_evt_disconnect_logical_link_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) +dissect_bthci_evt_disconnect_logical_link_complete(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data) { 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; + proto_tree_add_item(tree, hf_bthci_evt_logical_link_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; + proto_tree_add_item(tree, hf_bthci_evt_reason, tvb, offset, 1, ENC_LITTLE_ENDIAN); + send_hci_summary_reason_tap(tvb_get_guint8(tvb, offset), pinfo, bluetooth_data); offset += 1; + return offset; } static int -dissect_bthci_evt_flow_spec_modify_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) +dissect_bthci_evt_flow_spec_modify_complete(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data) { 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; + proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; return offset; @@ -2084,10 +2239,13 @@ dissect_bthci_evt_number_of_completed_data_blocks(tvbuff_t *tvb, int offset, pac } static int -dissect_bthci_evt_amp_start_stop_test(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) +dissect_bthci_evt_amp_start_stop_test(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data) { 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; + proto_tree_add_item(tree, hf_bthci_evt_test_scenario, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; return offset; @@ -2114,10 +2272,13 @@ dissect_bthci_evt_amp_receiver_test(tvbuff_t *tvb, int offset, packet_info *pinf } static int -dissect_bthci_evt_short_range_mode_change_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) +dissect_bthci_evt_short_range_mode_change_complete(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data) { 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; + proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_bthci_evt_short_range_mode_state, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -2126,10 +2287,13 @@ dissect_bthci_evt_short_range_mode_change_complete(tvbuff_t *tvb, int offset, pa } static int -dissect_bthci_evt_amp_status_change(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) +dissect_bthci_evt_amp_status_change(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data) { 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; + proto_tree_add_item(tree, hf_bthci_evt_amp_status, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; return offset; @@ -2293,6 +2457,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x201d: /* LE Receiver Test */ case 0x201e: /* LE Transmitter Test */ 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; break; @@ -2317,6 +2482,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0433: /* Remote OOB Data Request Negative 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); offset += 1; offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, local_addr, bluetooth_data->interface_id, bluetooth_data->adapter_id, bd_addr); @@ -2374,6 +2540,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x201a: /* LE Long Term Key Request Reply */ case 0x201b: /* LE Long Term Key Request Neg Reply */ 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -2383,8 +2550,19 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, /* This is a list of Commands that all return status and timeout */ case 0x0c15: /* Read Connection Accept Timeout */ + 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; + + timeout = tvb_get_letohs(tvb, offset); + item = proto_tree_add_item(tree, hf_bthci_evt_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN); + proto_item_append_text(item, " slots (%g msec)", timeout*0.625); + offset += 2; + + break; case 0x0c17: /* Read Page Timeout */ 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; timeout = tvb_get_letohs(tvb, offset); @@ -2398,6 +2576,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c27: /* Read Automatic Flush Timeout */ case 0x0c36: /* Read Link Supervision Timeout */ 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -2414,6 +2593,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c1b: /* Read Page Scan Activity */ case 0x0c1d: /* Read Inquiry Scan Activity */ 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; proto_tree_add_item(tree, hf_bthci_evt_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -2426,6 +2606,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0420: /* Read LMP Handle */ 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -2440,6 +2621,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x043b: /* Logical Link Cancel */ 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; proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -2451,6 +2633,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, break; case 0x0809: /* Role Discovery */ 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -2463,6 +2646,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x080c: /* Read Link Policy Settings */ 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -2478,6 +2662,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x080e: /* Read Default Link Policy Settings */ 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; proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_switch, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -2490,6 +2675,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c09: /* Read PIN Type */ 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; proto_tree_add_item(tree, hf_bthci_evt_pin_type, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -2499,6 +2685,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c0d: /* Read Stored Link Key */ 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; proto_tree_add_item(tree, hf_bthci_evt_max_num_keys, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -2511,6 +2698,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c11: /* Write Stored Link Key */ 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; proto_tree_add_item(tree, hf_bthci_evt_num_keys_written, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -2520,6 +2708,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c12: /* Delete Stored Link Key */ 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; proto_tree_add_item(tree, hf_bthci_evt_num_keys_deleted, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -2530,6 +2719,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c14: /* Read Local Name */ 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_device_name, tvb, offset, 248, ENC_UTF_8|ENC_NA); @@ -2579,6 +2769,8 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c19: /* Read Scan Enable */ 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_scan_enable, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -2588,6 +2780,8 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c1f: /* Read Authentication Enable */ 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_authentication_enable, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -2597,6 +2791,8 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c21: /* Read Encryption Mode */ 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_encryption_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -2606,6 +2802,8 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c23: /* Read Class of Device */ 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; call_dissector(btcommon_cod_handle, tvb_new_subset_length(tvb, offset, 3), pinfo, tree); @@ -2615,6 +2813,8 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c25: /* Read Voice Setting */ 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_input_unused, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -2629,6 +2829,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c29: /* Read Num Broadcast Retransmissions */ 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; proto_tree_add_item(tree, hf_bthci_evt_num_broadcast_retransm, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -2638,6 +2839,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c2b: /* Read Hold Mode Activity */ 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; proto_tree_add_item(tree, hf_bthci_evt_hold_mode_act_page, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -2649,6 +2851,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c2d: /* Read Transmit Power Level */ 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -2661,6 +2864,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c2e: /* Read SCO Flow Control Enable */ 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; proto_tree_add_item(tree, hf_bthci_evt_sco_flow_cont_enable, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -2671,6 +2875,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c38: /* Read Number of Supported IAC */ 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; proto_tree_add_item(tree, hf_bthci_evt_num_supp_iac, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -2680,6 +2885,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c39: /* Read Current IAC LAP */ 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; num8 = tvb_get_guint8(tvb, offset); @@ -2694,6 +2900,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c3b: /* Read Page Scan Period Mode */ 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; proto_tree_add_item(tree, hf_bthci_evt_page_scan_period_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -2703,6 +2910,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c3d: /* Read Page Scan Mode */ 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; proto_tree_add_item(tree, hf_bthci_evt_page_scan_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -2713,13 +2921,17 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c42: /* Read Inquiry Scan Type */ case 0x0c46: /* Read Page Scan Type */ 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; + proto_tree_add_item(tree, hf_bthci_evt_scan_type, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; break; case 0x0c44: /* Read Inquiry Mode */ 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_inq_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; @@ -2727,6 +2939,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c48: /* Read AFH Channel Assessment Mode */ 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; proto_tree_add_item(tree, hf_bthci_evt_afh_ch_assessment_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; @@ -2734,6 +2947,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c51: /* Read Extended Inquiry Response */ 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; proto_tree_add_item(tree, hf_bthci_evt_fec_required, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -2746,6 +2960,8 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c55: /* Read Simple Pairing Mode */ 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_simple_pairing_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -2754,7 +2970,9 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c57: /* Read Local OOB Data */ 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; + proto_tree_add_item(tree, hf_bthci_evt_hash_c, tvb, offset, 16, ENC_NA); offset += 16; proto_tree_add_item(tree, hf_bthci_evt_randomizer_r, tvb, offset, 16, ENC_NA); @@ -2763,7 +2981,9 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c58: /* Read Inquiry Response Tx Power Level */ 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; + proto_tree_add_item(tree, hf_bthci_evt_power_level_type, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; break; @@ -2771,6 +2991,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c5a: /* Read Default Erroneous Data Reporting */ 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; proto_tree_add_item(tree, hf_bthci_evt_err_data_reporting, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -2780,6 +3001,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c61: /* Read Logical Link Accept Timeout */ 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; item = proto_tree_add_item(tree, hf_bthci_evt_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN); proto_item_append_text(item, " slots (%g msec)", tvb_get_letohs(tvb, offset)*0.625); @@ -2788,6 +3010,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c64: /* Read Location Data */ 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; proto_tree_add_item(tree, hf_bthci_evt_location_domain_aware, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; @@ -2801,6 +3024,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c66: /* Read Flow Control Mode */ 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; proto_tree_add_item(tree, hf_bthci_evt_flow_control_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; @@ -2808,6 +3032,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c68: /* Read Enhanced Tx Power Level */ 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; @@ -2821,6 +3046,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c69: /* Read Best Effort Timeout */ 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; proto_tree_add_item(tree, hf_bthci_evt_flush_to_us, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; @@ -2828,6 +3054,8 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x0c6c: /* Read LE Host Supported */ 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_le_supported_host, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; @@ -2842,6 +3070,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, 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_bthci_evt_hci_version, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -2947,7 +3176,9 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, break; case 0x1002: /* Read Local Supported Commands */ - proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN); + 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_local_supported_cmds, tvb, offset, 64, ENC_NA); @@ -2956,7 +3187,9 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, break; case 0x1003: /* Read Local Supported Features */ - proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN); + 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; offset = dissect_bthci_evt_lmp_features(tvb, offset, pinfo, tree, 0); @@ -2967,7 +3200,9 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, { guint8 page_number; - proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN); + 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; page_number = tvb_get_guint8(tvb, offset); @@ -2984,6 +3219,8 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x1005: /* Read Buffer Size */ 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_host_data_packet_length_acl, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -3001,7 +3238,9 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, break; case 0x100a: /* Read Data Block Size */ - proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN); + 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_max_acl_data_packet_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; @@ -3009,10 +3248,12 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, offset += 2; proto_tree_add_item(tree, hf_bthci_evt_total_num_data_blocks, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; + 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); offset += 1; proto_tree_add_item(tree, hf_bthci_evt_country_code, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -3022,6 +3263,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x1401: /* Read Failed Contact Counter */ 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -3034,6 +3276,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x1403: /* Get Link Quality */ 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -3046,6 +3289,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x1405: /* Read RSSI */ 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -3058,6 +3302,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x1406: /* Read AFH Channel Map */ 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -3073,6 +3318,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x1407: /* Read Clock */ 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -3089,6 +3335,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x1408: /* Read Encryption Key Size */ 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; @@ -3098,7 +3345,10 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x1409: /* Read Local AMP Info */ 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_amp_status, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_bthci_evt_total_bandwidth, tvb, offset, 4, ENC_LITTLE_ENDIAN); @@ -3123,6 +3373,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x140a: /* Read Local AMP Assoc */ 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; proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; @@ -3134,6 +3385,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x140b: /* Write Remote AMP Assoc */ 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; proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; @@ -3141,6 +3393,8 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, 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); + send_hci_summary_status_tap(status, pinfo, bluetooth_data); offset += 1; proto_tree_add_item(tree, hf_bthci_evt_loopback_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; @@ -3148,6 +3402,8 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x2002: /* LE Read Buffer Size */ 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; item = proto_tree_add_item(tree, hf_bthci_evt_le_acl_data_pkt_len, tvb, offset, 2, ENC_LITTLE_ENDIAN); if ( (tvb_get_letohs(tvb, offset) == 0) && (tvb_get_guint8(tvb, offset+2) == 0) ) @@ -3159,6 +3415,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x2003: /* LE Read Local Supported Features */ 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; if (tree) { @@ -3175,6 +3432,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x2007: /* LE Read Advertising Channel Tx Power */ { 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; proto_tree_add_item(tree, hf_bthci_evt_transmit_power_level, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; @@ -3184,6 +3442,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x200f: /* LE Read White List Size */ { 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; proto_tree_add_item(tree, hf_bthci_evt_white_list_size, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; @@ -3196,6 +3455,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, proto_item *sub_item; 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; @@ -3211,6 +3471,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x2017: /* LE Encrypt */ { 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; proto_tree_add_item(tree, hf_bthci_evt_encrypted_data, tvb, offset, 16, ENC_NA); offset += 16; @@ -3220,6 +3481,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x2018: /* LE Rand */ { 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; proto_tree_add_item(tree, hf_bthci_evt_random_number, tvb, offset, 8, ENC_NA); offset += 8; @@ -3232,6 +3494,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, proto_item *ti_le_states_subtree; 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; ti_le_states = proto_tree_add_item(tree, hf_bthci_evt_le_states, tvb, offset, 8, ENC_NA); @@ -3276,6 +3539,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, case 0x201f: /* LE Test End */ { 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; proto_tree_add_item(tree, hf_bthci_evt_le_num_packets, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; @@ -3295,9 +3559,11 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, } static int -dissect_bthci_evt_qos_setup_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) +dissect_bthci_evt_qos_setup_complete(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data) { 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -3318,6 +3584,7 @@ dissect_bthci_evt_qos_setup_complete(tvbuff_t *tvb, int offset, packet_info *pin proto_tree_add_item(tree, hf_bthci_evt_latency, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_bthci_evt_delay_variation, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; @@ -3325,9 +3592,11 @@ dissect_bthci_evt_qos_setup_complete(tvbuff_t *tvb, int offset, packet_info *pin } static int -dissect_bthci_evt_change_conn_link_key_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) +dissect_bthci_evt_change_conn_link_key_complete(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data) { 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -3337,9 +3606,11 @@ dissect_bthci_evt_change_conn_link_key_complete(tvbuff_t *tvb, int offset, packe } static int -dissect_bthci_evt_master_link_key_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) +dissect_bthci_evt_master_link_key_complete(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data) { 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -3352,9 +3623,11 @@ dissect_bthci_evt_master_link_key_complete(tvbuff_t *tvb, int offset, packet_inf } static int -dissect_bthci_evt_encryption_change(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) +dissect_bthci_evt_encryption_change(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data) { 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -3367,11 +3640,13 @@ dissect_bthci_evt_encryption_change(tvbuff_t *tvb, int offset, packet_info *pinf } static int -dissect_bthci_evt_read_remote_ext_features_complete(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) +dissect_bthci_evt_read_remote_ext_features_complete(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data) { guint8 page_number; 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -3405,6 +3680,7 @@ dissect_bthci_evt_sync_connection_complete(tvbuff_t *tvb, int offset, 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_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -3495,11 +3771,13 @@ dissect_bthci_evt_sync_connection_complete(tvbuff_t *tvb, int offset, } static int -dissect_bthci_evt_sync_connection_changed(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) +dissect_bthci_evt_sync_connection_changed(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data) { proto_item *item; 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -3523,11 +3801,13 @@ dissect_bthci_evt_sync_connection_changed(tvbuff_t *tvb, int offset, packet_info } static int -dissect_bthci_evt_sniff_subrating(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) +dissect_bthci_evt_sniff_subrating(tvbuff_t *tvb, int offset, packet_info *pinfo, + proto_tree *tree, bluetooth_data_t *bluetooth_data) { proto_item *item; 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -3553,9 +3833,11 @@ dissect_bthci_evt_sniff_subrating(tvbuff_t *tvb, int offset, packet_info *pinfo } static int -dissect_bthci_evt_flow_specification_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) +dissect_bthci_evt_flow_specification_complete(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data) { 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -3595,9 +3877,11 @@ dissect_bthci_evt_enhanced_flush_complete(tvbuff_t *tvb, int offset, packet_info } static int -dissect_bthci_evt_encryption_key_refresh_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) +dissect_bthci_evt_encryption_key_refresh_complete(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data) { 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; proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -3715,6 +3999,27 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat proto_item_append_text(bthci_evt_tree, " - %s", val_to_str_ext_const(evt_code, &bthci_evt_evt_code_vals_ext, "Unknown 0x%08x")); offset += 1; + if (have_tap_listener(bluetooth_hci_summary_tap)) { + bluetooth_hci_summary_tap_t *tap_hci_summary; + + tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t); + if (bluetooth_data) { + tap_hci_summary->interface_id = bluetooth_data->interface_id; + tap_hci_summary->adapter_id = bluetooth_data->adapter_id; + } else { + tap_hci_summary->interface_id = HCI_INTERFACE_DEFAULT; + tap_hci_summary->adapter_id = HCI_ADAPTER_DEFAULT; + } + + tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_EVENT; + tap_hci_summary->event = evt_code; + if (try_val_to_str_ext(evt_code, &bthci_evt_evt_code_vals_ext)) + tap_hci_summary->name = val_to_str_ext(evt_code, &bthci_evt_evt_code_vals_ext, "Unknown 0x%04x"); + else + tap_hci_summary->name = NULL; + tap_queue_packet(bluetooth_hci_summary_tap, pinfo, tap_hci_summary); + } + param_length = tvb_get_guint8(tvb, offset); proto_tree_add_item(bthci_evt_tree, hf_bthci_evt_param_length, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; @@ -3727,7 +4032,7 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat if (param_length > 0) { switch(evt_code) { case 0x01: /* Inquiry Complete */ - offset = dissect_bthci_evt_inquire_complete(tvb, offset, pinfo, bthci_evt_tree); + offset = dissect_bthci_evt_inquire_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); add_opcode(opcode_list, 0x0401, COMMAND_STATUS_NORMAL); /* Inquiry */ add_opcode(opcode_list, 0x0403, COMMAND_STATUS_NORMAL); /* Periodic Inquiry Mode */ break; @@ -3754,7 +4059,7 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat break; case 0x06: /* Authentication Complete */ - offset = dissect_bthci_evt_auth_complete(tvb, offset, pinfo, bthci_evt_tree); + offset = dissect_bthci_evt_auth_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); add_opcode(opcode_list, 0x0411, COMMAND_STATUS_NORMAL); /* Authentication Requested */ break; @@ -3764,21 +4069,21 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat break; case 0x08: /* Encryption Change */ - offset = dissect_bthci_evt_encryption_change(tvb, offset, pinfo, bthci_evt_tree); + offset = dissect_bthci_evt_encryption_change(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); add_opcode(opcode_list, 0x0413, COMMAND_STATUS_NORMAL); /* Encryption Requested */ add_opcode(opcode_list, 0x2019, COMMAND_STATUS_NORMAL); /* LE Start Encryption */ break; case 0x09: /* Change Connection Link Key Complete */ - offset = dissect_bthci_evt_change_conn_link_key_complete(tvb, offset, pinfo, bthci_evt_tree); + offset = dissect_bthci_evt_change_conn_link_key_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); break; case 0x0a: /* Master Link Key Complete */ - offset = dissect_bthci_evt_master_link_key_complete(tvb, offset, pinfo, bthci_evt_tree); + offset = dissect_bthci_evt_master_link_key_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); break; case 0x0b: /* Read Remote Support Features Complete */ - offset = dissect_bthci_evt_read_remote_support_features_complete(tvb, offset, pinfo, bthci_evt_tree); + offset = dissect_bthci_evt_read_remote_support_features_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); add_opcode(opcode_list, 0x41B, COMMAND_STATUS_NORMAL); /* Read Remote Supported Features */ break; @@ -3788,7 +4093,7 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat break; case 0x0d: /* QoS Setup Complete */ - offset = dissect_bthci_evt_qos_setup_complete(tvb, offset, pinfo, bthci_evt_tree); + offset = dissect_bthci_evt_qos_setup_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); break; case 0x0e: /* Command Complete */ @@ -3801,7 +4106,7 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat break; case 0x10: /* Hardware Error */ - offset = dissect_bthci_evt_hardware_error(tvb, offset, pinfo, bthci_evt_tree); + offset = dissect_bthci_evt_hardware_error(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); break; case 0x11: /* Flush Occurred */ @@ -3852,11 +4157,11 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat break; case 0x1c: /* Read Clock Offset Complete */ - offset = dissect_bthci_evt_read_clock_offset_complete(tvb, offset, pinfo, bthci_evt_tree); + offset = dissect_bthci_evt_read_clock_offset_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); break; case 0x1d: /* Connection Packet Type Changed */ - offset = dissect_bthci_evt_conn_packet_type_changed(tvb, offset, pinfo, bthci_evt_tree); + offset = dissect_bthci_evt_conn_packet_type_changed(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); add_opcode(opcode_list, 0x040F, COMMAND_STATUS_NORMAL); /* Change Connection Packet Type */ break; @@ -3873,7 +4178,7 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat break; case 0x21: /* Flow Specification Complete */ - offset = dissect_bthci_evt_flow_specification_complete(tvb, offset, pinfo, bthci_evt_tree); + offset = dissect_bthci_evt_flow_specification_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); break; case 0x22: /* Inquiry Result with RSSI */ @@ -3881,7 +4186,7 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat break; case 0x23: /* Read Remote Extended Features Complete */ - offset = dissect_bthci_evt_read_remote_ext_features_complete(tvb, offset, pinfo, bthci_evt_tree); + offset = dissect_bthci_evt_read_remote_ext_features_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); add_opcode(opcode_list, 0x41C, COMMAND_STATUS_NORMAL); /* Read Remote Supported Features */ break; @@ -3894,12 +4199,12 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat break; case 0x2d: /* Synchronous Connection Changed */ - offset = dissect_bthci_evt_sync_connection_changed(tvb, offset, pinfo, bthci_evt_tree); + offset = dissect_bthci_evt_sync_connection_changed(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); add_opcode(opcode_list, 0x043D, COMMAND_STATUS_NORMAL); /* Enhanced Setup Synchronous Connection */ break; case 0x2e: /* Sniff Subrating */ - offset = dissect_bthci_evt_sniff_subrating(tvb, offset, pinfo, bthci_evt_tree); + offset = dissect_bthci_evt_sniff_subrating(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); break; case 0x2f: /* Extended Inquiry Result */ @@ -3913,7 +4218,7 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat break; case 0x30: /* Encryption Key Refresh Complete */ - offset = dissect_bthci_evt_encryption_key_refresh_complete(tvb, offset, pinfo, bthci_evt_tree); + offset = dissect_bthci_evt_encryption_key_refresh_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); add_opcode(opcode_list, 0x2019, COMMAND_STATUS_NORMAL); /* LE Start Encryption */ break; @@ -3966,7 +4271,7 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat break; case 0x40: /* Physical Link Complete */ - offset = dissect_bthci_evt_physical_link_complete(tvb, offset, pinfo, bthci_evt_tree); + offset = dissect_bthci_evt_physical_link_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); break; case 0x41: /* Channel Selected */ @@ -3975,7 +4280,7 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat break; case 0x42: /* Disconnect Physical Link Complete */ - offset = dissect_bthci_evt_disconnect_physical_link_complete(tvb, offset, pinfo, bthci_evt_tree); + offset = dissect_bthci_evt_disconnect_physical_link_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); break; case 0x43: /* Physical Link Loss Early Warning */ @@ -3983,15 +4288,15 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat break; case 0x45: /* Logical Link Complete */ - offset = dissect_bthci_evt_logical_link_complete(tvb, offset, pinfo, bthci_evt_tree); + offset = dissect_bthci_evt_logical_link_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); break; case 0x46: /* Disconnect Logical Link Complete */ - offset = dissect_bthci_evt_disconnect_logical_link_complete(tvb, offset, pinfo, bthci_evt_tree); + offset = dissect_bthci_evt_disconnect_logical_link_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); break; case 0x47: /* Flow Spec Modify Complete */ - offset = dissect_bthci_evt_flow_spec_modify_complete(tvb, offset, pinfo, bthci_evt_tree); + offset = dissect_bthci_evt_flow_spec_modify_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); break; case 0x48: /* Number Of Completed Data Blocks */ @@ -3999,8 +4304,13 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat break; case 0x49: /* AMP Start Test */ + offset = dissect_bthci_evt_amp_start_stop_test(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); + add_opcode(opcode_list, 0x1809, COMMAND_STATUS_NORMAL); /* AMP Test */ + break; + case 0x4a: /* AMP Test End */ - offset = dissect_bthci_evt_amp_start_stop_test(tvb, offset, pinfo, bthci_evt_tree); + offset = dissect_bthci_evt_amp_start_stop_test(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); + add_opcode(opcode_list, 0x1808, COMMAND_STATUS_NORMAL); /* AMP Test End */ break; case 0x4b: /* AMP Receiver Test */ @@ -4008,11 +4318,11 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat break; case 0x4c: /* Short Range Mode Change Complete */ - offset = dissect_bthci_evt_short_range_mode_change_complete(tvb, offset, pinfo, bthci_evt_tree); + offset = dissect_bthci_evt_short_range_mode_change_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); break; case 0x4d: /* AMP Status Change */ - offset = dissect_bthci_evt_amp_status_change(tvb, offset, pinfo, bthci_evt_tree); + offset = dissect_bthci_evt_amp_status_change(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data); break; case 0x4e: /* Triggered Clock Capture */ diff --git a/epan/dissectors/packet-bthci_vendor.c b/epan/dissectors/packet-bthci_vendor.c index 62872ac275..813ee013ab 100644 --- a/epan/dissectors/packet-bthci_vendor.c +++ b/epan/dissectors/packet-bthci_vendor.c @@ -26,6 +26,7 @@ #include <epan/packet.h> #include <epan/expert.h> +#include <epan/tap.h> #include "packet-bluetooth.h" #include "packet-bthci_cmd.h" @@ -404,6 +405,28 @@ dissect_bthci_vendor_broadcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre else col_append_fstr(pinfo->cinfo, COL_INFO, "Unknown Command 0x%04X (opcode 0x%04X)", ocf, opcode); + if (have_tap_listener(bluetooth_hci_summary_tap)) { + bluetooth_hci_summary_tap_t *tap_hci_summary; + + tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t); + if (bluetooth_data) { + tap_hci_summary->interface_id = bluetooth_data->interface_id; + tap_hci_summary->adapter_id = bluetooth_data->adapter_id; + } else { + tap_hci_summary->interface_id = HCI_INTERFACE_DEFAULT; + tap_hci_summary->adapter_id = HCI_ADAPTER_DEFAULT; + } + + tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_VENDOR_OPCODE; + tap_hci_summary->ogf = opcode >> 10; + tap_hci_summary->ocf = ocf; + if (try_val_to_str(ocf, opcode_ocf_vals)) + tap_hci_summary->name = description; + else + tap_hci_summary->name = NULL; + tap_queue_packet(bluetooth_hci_summary_tap, pinfo, tap_hci_summary); + } + proto_tree_add_item(main_tree, hf_parameter_length, tvb, offset, 1, ENC_NA); length = tvb_get_guint8(tvb, offset); offset += 1; @@ -757,10 +780,32 @@ dissect_bthci_vendor_broadcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre col_add_fstr(pinfo->cinfo, COL_INFO, "Rcvd Broadcom "); event_code = tvb_get_guint8(tvb, offset); - col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(event_code, &bthci_evt_evt_code_vals_ext, "Unknown 0x%08x")); + description = val_to_str_ext_const(event_code, &bthci_evt_evt_code_vals_ext, "Unknown 0x%08x"); + col_append_str(pinfo->cinfo, COL_INFO, description); proto_tree_add_item(main_tree, hf_event_code, tvb, offset, 1, ENC_NA); offset += 1; + if (have_tap_listener(bluetooth_hci_summary_tap)) { + bluetooth_hci_summary_tap_t *tap_hci_summary; + + tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t); + if (bluetooth_data) { + tap_hci_summary->interface_id = bluetooth_data->interface_id; + tap_hci_summary->adapter_id = bluetooth_data->adapter_id; + } else { + tap_hci_summary->interface_id = HCI_INTERFACE_DEFAULT; + tap_hci_summary->adapter_id = HCI_ADAPTER_DEFAULT; + } + + tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_VENDOR_EVENT; + tap_hci_summary->event = event_code; + if (try_val_to_str_ext(event_code, &bthci_evt_evt_code_vals_ext)) + tap_hci_summary->name = description; + else + tap_hci_summary->name = NULL; + tap_queue_packet(bluetooth_hci_summary_tap, pinfo, tap_hci_summary); + } + proto_tree_add_item(main_tree, hf_parameter_length, tvb, offset, 1, ENC_NA); length = tvb_get_guint8(tvb, offset); offset += 1; @@ -785,6 +830,28 @@ dissect_bthci_vendor_broadcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre else col_append_fstr(pinfo->cinfo, COL_INFO, " (Unknown Command 0x%04X [opcode 0x%04X])", ocf, opcode); + if (have_tap_listener(bluetooth_hci_summary_tap)) { + bluetooth_hci_summary_tap_t *tap_hci_summary; + + tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t); + if (bluetooth_data) { + tap_hci_summary->interface_id = bluetooth_data->interface_id; + tap_hci_summary->adapter_id = bluetooth_data->adapter_id; + } else { + tap_hci_summary->interface_id = HCI_INTERFACE_DEFAULT; + tap_hci_summary->adapter_id = HCI_ADAPTER_DEFAULT; + } + + tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_VENDOR_EVENT_OPCODE; + tap_hci_summary->ogf = opcode >> 10; + tap_hci_summary->ocf = ocf; + if (try_val_to_str(ocf, opcode_ocf_vals)) + tap_hci_summary->name = description; + else + tap_hci_summary->name = NULL; + tap_queue_packet(bluetooth_hci_summary_tap, pinfo, tap_hci_summary); + } + proto_tree_add_item(main_tree, hf_status, tvb, offset, 1, ENC_NA); status = tvb_get_guint8(tvb, offset); offset += 1; diff --git a/ui/qt/CMakeLists.txt b/ui/qt/CMakeLists.txt index 43bfd7bbd8..f5fc5b104d 100644 --- a/ui/qt/CMakeLists.txt +++ b/ui/qt/CMakeLists.txt @@ -26,6 +26,7 @@ set(WIRESHARK_QT_HEADERS accordion_frame.h bluetooth_att_server_attributes_dialog.h bluetooth_devices_dialog.h + bluetooth_hci_summary_dialog.h accordion_frame.h byte_view_tab.h byte_view_text.h @@ -157,6 +158,7 @@ set(WIRESHARK_QT_SRC accordion_frame.cpp bluetooth_att_server_attributes_dialog.cpp bluetooth_devices_dialog.cpp + bluetooth_hci_summary_dialog.cpp byte_view_tab.cpp byte_view_text.cpp capture_file.cpp @@ -291,6 +293,7 @@ set(WIRESHARK_QT_UI about_dialog.ui bluetooth_att_server_attributes_dialog.ui bluetooth_devices_dialog.ui + bluetooth_hci_summary_dialog.ui capture_file_progress_frame.ui capture_file_properties_dialog.ui capture_interfaces_dialog.ui diff --git a/ui/qt/Makefile.am b/ui/qt/Makefile.am index 0f045e182d..ddf6d4bc74 100644 --- a/ui/qt/Makefile.am +++ b/ui/qt/Makefile.am @@ -134,6 +134,8 @@ bluetooth_att_server_attributes_dialog.$(OBJEXT): ui_bluetooth_att_server_attrib bluetooth_devices_dialog.$(OBJEXT): ui_bluetooth_devices_dialog.h +bluetooth_hci_summary_dialog.$(OBJEXT): ui_bluetooth_hci_summary_dialog.h + capture_file_progress_frame.$(OBJEXT): ui_capture_file_progress_frame.h capture_file_properties_dialog.$(OBJEXT): ui_capture_file_properties_dialog.h diff --git a/ui/qt/Makefile.common b/ui/qt/Makefile.common index 5264100aec..89d20a5c3e 100644 --- a/ui/qt/Makefile.common +++ b/ui/qt/Makefile.common @@ -32,6 +32,7 @@ NODIST_GENERATED_HEADER_FILES = \ ui_about_dialog.h \ ui_bluetooth_att_server_attributes_dialog.h \ ui_bluetooth_devices_dialog.h \ + ui_bluetooth_hci_summary_dialog.h \ ui_capture_file_progress_frame.h \ ui_capture_file_properties_dialog.h \ ui_capture_interfaces_dialog.h \ @@ -135,6 +136,7 @@ MOC_HDRS = \ accordion_frame.h \ bluetooth_att_server_attributes_dialog.h \ bluetooth_devices_dialog.h \ + bluetooth_hci_summary_dialog.h \ byte_view_tab.h \ byte_view_text.h \ capture_file.h \ @@ -248,6 +250,7 @@ UI_FILES = \ about_dialog.ui \ bluetooth_att_server_attributes_dialog.ui \ bluetooth_devices_dialog.ui \ + bluetooth_hci_summary_dialog.ui \ capture_file_progress_frame.ui \ capture_file_properties_dialog.ui \ capture_interfaces_dialog.ui \ @@ -366,6 +369,7 @@ WIRESHARK_QT_SRC = \ accordion_frame.cpp \ bluetooth_att_server_attributes_dialog.cpp \ bluetooth_devices_dialog.cpp \ + bluetooth_hci_summary_dialog.cpp \ byte_view_tab.cpp \ byte_view_text.cpp \ capture_file.cpp \ diff --git a/ui/qt/Wireshark.pro b/ui/qt/Wireshark.pro index d2fb545d02..4e70796b93 100644 --- a/ui/qt/Wireshark.pro +++ b/ui/qt/Wireshark.pro @@ -208,6 +208,7 @@ FORMS += \ about_dialog.ui \ bluetooth_att_server_attributes_dialog.ui \ bluetooth_devices_dialog.ui \ + bluetooth_hci_summary_dialog.ui \ capture_file_progress_frame.ui \ capture_file_properties_dialog.ui \ capture_interfaces_dialog.ui \ @@ -278,6 +279,7 @@ HEADERS += $$HEADERS_WS_C \ accordion_frame.h \ bluetooth_att_server_attributes_dialog.h \ bluetooth_devices_dialog.h \ + bluetooth_hci_summary_dialog.h \ capture_file_progress_frame.h \ capture_file_properties_dialog.h \ capture_interfaces_dialog.h \ @@ -636,6 +638,7 @@ SOURCES += \ accordion_frame.cpp \ bluetooth_att_server_attributes_dialog.cpp \ bluetooth_devices_dialog.cpp \ + bluetooth_hci_summary_dialog.cpp \ byte_view_tab.cpp \ byte_view_text.cpp \ capture_file.cpp \ diff --git a/ui/qt/bluetooth_hci_summary_dialog.cpp b/ui/qt/bluetooth_hci_summary_dialog.cpp new file mode 100644 index 0000000000..23d68e6e00 --- /dev/null +++ b/ui/qt/bluetooth_hci_summary_dialog.cpp @@ -0,0 +1,727 @@ +/* bluetooth_hci_summary_dialog.cpp + * + * Wireshark - Network traffic analyzer + * By Gerald Combs <gerald@wireshark.org> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "bluetooth_hci_summary_dialog.h" +#include "ui_bluetooth_hci_summary_dialog.h" + +#include "epan/epan.h" +#include "epan/addr_resolv.h" +#include "epan/to_str.h" +#include "epan/epan_dissect.h" +#include "epan/dissectors/packet-bluetooth.h" +#include "epan/dissectors/packet-bthci_cmd.h" +#include "epan/dissectors/packet-bthci_evt.h" + +#include "ui/simple_dialog.h" + +#include <QClipboard> +#include <QContextMenuEvent> +#include <QPushButton> +#include <QTreeWidget> +#include <QFileDialog> + +static const int column_number_name = 0; +static const int column_number_ogf = 1; +static const int column_number_ocf = 2; +static const int column_number_opcode = 3; +static const int column_number_event = 4; +static const int column_number_status = 5; +static const int column_number_reason = 6; +static const int column_number_hardware_error = 7; +static const int column_number_occurrence = 8; + +typedef struct _item_data_t { + guint32 interface_id; + guint32 adapter_id; + guint32 frame_number; +} item_data_t; + +Q_DECLARE_METATYPE(item_data_t *) + +static gboolean +bluetooth_device_tap_packet(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *edt, const void* data) +{ + bluetooth_hci_summary_tapinfo_t *tapinfo = (bluetooth_hci_summary_tapinfo_t *) tapinfo_ptr; + + if (tapinfo->tap_packet) + tapinfo->tap_packet(tapinfo, pinfo, edt, data); + + return TRUE; +} + +static void +bluetooth_device_tap_reset(void *tapinfo_ptr) +{ + bluetooth_hci_summary_tapinfo_t *tapinfo = (bluetooth_hci_summary_tapinfo_t *) tapinfo_ptr; + + if (tapinfo->tap_reset) + tapinfo->tap_reset(tapinfo); +} + +static void +bluetooth_devices_tap(void *data) +{ + GString *error_string; + + error_string = register_tap_listener("bluetooth.hci_summary", data, NULL, + 0, + bluetooth_device_tap_reset, + bluetooth_device_tap_packet, + NULL + ); + + if (error_string != NULL) { + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, + "%s", error_string->str); + g_string_free(error_string, TRUE); + } +} + + +BluetoothHciSummaryDialog::BluetoothHciSummaryDialog(QWidget &parent, CaptureFile &cf) : + WiresharkDialog(parent, cf), + ui(new Ui::BluetoothHciSummaryDialog) +{ + ui->setupUi(this); + resize(parent.width() * 4 / 5, parent.height() * 2 / 3); + + connect(ui->tableTreeWidget, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(tableContextMenu(const QPoint &))); + connect(ui->tableTreeWidget, SIGNAL(itemExpanded(QTreeWidgetItem *)), this, SLOT(tableItemExpanded(QTreeWidgetItem *))); + connect(ui->tableTreeWidget, SIGNAL(itemCollapsed(QTreeWidgetItem *)), this, SLOT(tableItemCollapsed(QTreeWidgetItem *))); + + connect(ui->interfaceComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(interfaceCurrentIndexChanged(int))); + connect(ui->adapterComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(adapterCurrentIndexChanged(int))); + + for (int i = 0; i < ui->tableTreeWidget->columnCount(); i++) { + ui->tableTreeWidget->resizeColumnToContents(i); + } + + context_menu_.addActions(QList<QAction *>() << ui->actionCopy_Cell); + context_menu_.addActions(QList<QAction *>() << ui->actionCopy_Rows); + context_menu_.addActions(QList<QAction *>() << ui->actionCopy_All); + context_menu_.addActions(QList<QAction *>() << ui->actionSave_as_image); + + tapinfo_.tap_packet = tapPacket; + tapinfo_.tap_reset = tapReset; + tapinfo_.ui = this; + + item_link_control_ = ui->tableTreeWidget->topLevelItem(0); + item_link_policy_ = ui->tableTreeWidget->topLevelItem(1); + item_controller_and_baseband_ = ui->tableTreeWidget->topLevelItem(2); + item_informational_ = ui->tableTreeWidget->topLevelItem(3); + item_status_parameters_ = ui->tableTreeWidget->topLevelItem(4); + item_testing_ = ui->tableTreeWidget->topLevelItem(5); + item_low_energy_ = ui->tableTreeWidget->topLevelItem(6); + item_logo_testing_ = ui->tableTreeWidget->topLevelItem(7); + item_vendor_ = ui->tableTreeWidget->topLevelItem(8); + item_unknown_ogf_ = ui->tableTreeWidget->topLevelItem(9); + item_events_ = ui->tableTreeWidget->topLevelItem(10); + item_status_ = ui->tableTreeWidget->topLevelItem(11); + item_reason_ = ui->tableTreeWidget->topLevelItem(12); + item_hardware_errors_ = ui->tableTreeWidget->topLevelItem(13); + + bluetooth_devices_tap(&tapinfo_); + + cap_file_.retapPackets(); +} + + +BluetoothHciSummaryDialog::~BluetoothHciSummaryDialog() +{ + delete ui; + + remove_tap_listener(&tapinfo_); +} + + +void BluetoothHciSummaryDialog::captureFileClosing() +{ + remove_tap_listener(&tapinfo_); + + ui->interfaceComboBox->setEnabled(FALSE); + ui->adapterComboBox->setEnabled(FALSE); + + WiresharkDialog::captureFileClosing(); +} + + +void BluetoothHciSummaryDialog::changeEvent(QEvent *event) +{ + if (0 != event) + { + switch (event->type()) + { + case QEvent::LanguageChange: + ui->retranslateUi(this); + break; + default: + break; + } + } + QDialog::changeEvent(event); +} + + +void BluetoothHciSummaryDialog::tableContextMenu(const QPoint &pos) +{ + context_menu_.exec(ui->tableTreeWidget->viewport()->mapToGlobal(pos)); +} + +void BluetoothHciSummaryDialog::tableItemExpanded(QTreeWidgetItem *item) +{ + Q_UNUSED(item); + + for (int i = 0; i < ui->tableTreeWidget->columnCount(); i++) { + ui->tableTreeWidget->resizeColumnToContents(i); + } +} + +void BluetoothHciSummaryDialog::tableItemCollapsed(QTreeWidgetItem *item) +{ + Q_UNUSED(item); + + for (int i = 0; i < ui->tableTreeWidget->columnCount(); i++) { + ui->tableTreeWidget->resizeColumnToContents(i); + } +} + +void BluetoothHciSummaryDialog::on_actionCopy_Cell_triggered() +{ + QClipboard *clipboard = QApplication::clipboard(); + QString copy; + + copy = QString(ui->tableTreeWidget->currentItem()->text(ui->tableTreeWidget->currentColumn())); + + clipboard->setText(copy); +} + + +void BluetoothHciSummaryDialog::on_actionCopy_Rows_triggered() +{ + QClipboard *clipboard = QApplication::clipboard(); + QString copy; + QList<QTreeWidgetItem *> items; + QList<QTreeWidgetItem *>::iterator i_item; + + items = ui->tableTreeWidget->selectedItems(); + + for (i_item = items.begin(); i_item != items.end(); ++i_item) { + copy += QString("%1 %2 %3 %4 %5 %6 %7 %8 %9\n") + .arg((*i_item)->text(column_number_name), -60) + .arg((*i_item)->text(column_number_ogf), -10) + .arg((*i_item)->text(column_number_ocf), -10) + .arg((*i_item)->text(column_number_opcode), -10) + .arg((*i_item)->text(column_number_event), -10) + .arg((*i_item)->text(column_number_status), -10) + .arg((*i_item)->text(column_number_reason), -10) + .arg((*i_item)->text(column_number_hardware_error), -15) + .arg((*i_item)->text(column_number_occurrence), -10); + } + + clipboard->setText(copy); +} + +void BluetoothHciSummaryDialog::tapReset(void *tapinfo_ptr ) +{ + bluetooth_hci_summary_tapinfo_t *tapinfo = (bluetooth_hci_summary_tapinfo_t *) tapinfo_ptr; + BluetoothHciSummaryDialog *dialog = static_cast<BluetoothHciSummaryDialog *>(tapinfo->ui); + + dialog->item_link_control_->takeChildren(); + dialog->item_link_control_->setText(column_number_occurrence, "0"); + + dialog->item_link_policy_->takeChildren(); + dialog->item_link_policy_->setText(column_number_occurrence, "0"); + + dialog->item_controller_and_baseband_->takeChildren(); + dialog->item_controller_and_baseband_->setText(column_number_occurrence, "0"); + + dialog->item_informational_->takeChildren(); + dialog->item_informational_->setText(column_number_occurrence, "0"); + + dialog->item_status_parameters_->takeChildren(); + dialog->item_status_parameters_->setText(column_number_occurrence, "0"); + + dialog->item_testing_->takeChildren(); + dialog->item_testing_->setText(column_number_occurrence, "0"); + + dialog->item_low_energy_->takeChildren(); + dialog->item_low_energy_->setText(column_number_occurrence, "0"); + + dialog->item_logo_testing_->takeChildren(); + dialog->item_logo_testing_->setText(column_number_occurrence, "0"); + + dialog->item_vendor_->takeChildren(); + dialog->item_vendor_->setText(column_number_occurrence, "0"); + + dialog->item_unknown_ogf_->takeChildren(); + dialog->item_unknown_ogf_->setText(column_number_occurrence, "0"); + + dialog->item_events_->takeChildren(); + dialog->item_events_->setText(column_number_occurrence, "0"); + + dialog->item_status_->takeChildren(); + dialog->item_status_->setText(column_number_occurrence, "0"); + + dialog->item_reason_->takeChildren(); + dialog->item_reason_->setText(column_number_occurrence, "0"); + + dialog->item_hardware_errors_->takeChildren(); + dialog->item_hardware_errors_->setText(column_number_occurrence, "0"); +} + +gboolean BluetoothHciSummaryDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data) +{ + bluetooth_hci_summary_tapinfo_t *tapinfo = static_cast<bluetooth_hci_summary_tapinfo_t *>(tapinfo_ptr); + BluetoothHciSummaryDialog *dialog = static_cast<BluetoothHciSummaryDialog *>(tapinfo->ui); + bluetooth_hci_summary_tap_t *tap_hci = static_cast<bluetooth_hci_summary_tap_t *>(const_cast<void *>(data)); + QTreeWidgetItem *main_item = NULL; + QTreeWidgetItem *item = NULL; + QTreeWidgetItem *frame_item = NULL; + item_data_t *item_data = NULL; + QString adapter; + QString name; + + name = tr("Unknown"); + + if (pinfo->phdr->presence_flags & WTAP_HAS_INTERFACE_ID) { + gchar *interface; + const char *interface_name; + + interface_name = epan_get_interface_name(pinfo->epan, pinfo->phdr->interface_id); + interface = wmem_strdup_printf(wmem_packet_scope(), "%u: %s", pinfo->phdr->interface_id, interface_name); + + if (dialog->ui->interfaceComboBox->findText(interface) == -1) + dialog->ui->interfaceComboBox->addItem(interface); + + if (interface && dialog->ui->interfaceComboBox->currentIndex() > 0) { + if (dialog->ui->interfaceComboBox->currentText() != interface) + return TRUE; + } + } + + adapter = QString(tr("Adapter %1")).arg(tap_hci->adapter_id); + + if (dialog->ui->adapterComboBox->findText(adapter) == -1) { + dialog->ui->adapterComboBox->addItem(adapter); + } + + if (dialog->ui->adapterComboBox->currentIndex() > 0) { + if (dialog->ui->adapterComboBox->currentText() != adapter) + return TRUE; + } + + switch (tap_hci->type) { + case BLUETOOTH_HCI_SUMMARY_OPCODE: + case BLUETOOTH_HCI_SUMMARY_EVENT_OPCODE: + case BLUETOOTH_HCI_SUMMARY_VENDOR_OPCODE: + case BLUETOOTH_HCI_SUMMARY_VENDOR_EVENT_OPCODE: + switch (tap_hci->ogf) { + case HCI_OGF_LINK_CONTROL: + main_item = dialog->item_link_control_; + break; + case HCI_OGF_LINK_POLICY: + main_item = dialog->item_link_policy_; + break; + case HCI_OGF_HOST_CONTROLLER: + main_item = dialog->item_controller_and_baseband_; + break; + case HCI_OGF_INFORMATIONAL: + main_item = dialog->item_informational_; + break; + case HCI_OGF_STATUS: + main_item = dialog->item_status_parameters_; + break; + case HCI_OGF_TESTING: + main_item = dialog->item_testing_; + break; + case HCI_OGF_LOW_ENERGY: + main_item = dialog->item_low_energy_; + break; + case HCI_OGF_LOGO_TESTING: + main_item = dialog->item_logo_testing_; + break; + case HCI_OGF_VENDOR_SPECIFIC: + main_item = dialog->item_vendor_; + break; + default: + main_item = dialog->item_unknown_ogf_; + } + + for (int i_item = 0; i_item < main_item->childCount(); i_item +=1) { + if (main_item->child(i_item)->text(column_number_opcode) == QString("").sprintf("0x%04X", tap_hci->ogf << 10 | tap_hci->ocf)) { + item = main_item->child(i_item); + if (tap_hci->type == BLUETOOTH_HCI_SUMMARY_VENDOR_OPCODE && tap_hci->name) + item->setText(column_number_name, tap_hci->name); + break; + } + } + + if (!item) { + item = new QTreeWidgetItem(); + if (tap_hci->name) + name = tap_hci->name; + + item->setText(column_number_name, name); + item->setText(column_number_ogf, QString("").sprintf("0x%02X", tap_hci->ogf)); + item->setText(column_number_ocf, QString("").sprintf("0x%04X", tap_hci->ocf)); + item->setText(column_number_opcode, QString("").sprintf("0x%04X", tap_hci->ogf << 10 | tap_hci->ocf)); + if (tap_hci->type == BLUETOOTH_HCI_SUMMARY_OPCODE) + item->setText(column_number_occurrence, "0"); + else + item->setText(column_number_occurrence, "1"); + + main_item->addChild(item); + main_item->sortChildren(column_number_opcode, Qt::AscendingOrder); + + main_item->setText(column_number_occurrence, QString::number(main_item->text(column_number_occurrence).toInt() + 1)); + } + + if (tap_hci->type != BLUETOOTH_HCI_SUMMARY_EVENT_OPCODE && tap_hci->type != BLUETOOTH_HCI_SUMMARY_VENDOR_EVENT_OPCODE) + item->setText(column_number_occurrence, QString::number(item->text(column_number_occurrence).toInt() + 1)); + + /* I belive bthci_cmd/bthci_evt already add frame item */ + if (tap_hci->type == BLUETOOTH_HCI_SUMMARY_VENDOR_OPCODE || + tap_hci->type == BLUETOOTH_HCI_SUMMARY_VENDOR_EVENT_OPCODE) + break; + + frame_item = new QTreeWidgetItem(); + frame_item->setText(column_number_name, QString(tr("Frame %1")).arg(pinfo->fd->num)); + frame_item->setText(column_number_ogf, QString("").sprintf("0x%02X", tap_hci->ogf)); + frame_item->setText(column_number_ocf, QString("").sprintf("0x%04X", tap_hci->ocf)); + frame_item->setText(column_number_opcode, QString("").sprintf("0x%04X", tap_hci->ogf << 10 | tap_hci->ocf)); + item->addChild(frame_item); + + item_data = wmem_new(wmem_file_scope(), item_data_t); + item_data->interface_id = tap_hci->interface_id; + item_data->adapter_id = tap_hci->adapter_id; + item_data->frame_number = pinfo->fd->num; + frame_item->setData(0, Qt::UserRole, QVariant::fromValue<item_data_t *>(item_data)); + + break; + case BLUETOOTH_HCI_SUMMARY_EVENT: + case BLUETOOTH_HCI_SUMMARY_VENDOR_EVENT: + main_item = dialog->item_events_; + + for (int i_item = 0; i_item < main_item->childCount(); i_item +=1) { + if (main_item->child(i_item)->text(column_number_event) == QString("").sprintf("0x%02X", tap_hci->event)) { + item = main_item->child(i_item); + if (tap_hci->type == BLUETOOTH_HCI_SUMMARY_VENDOR_EVENT && tap_hci->name) + item->setText(column_number_name, tap_hci->name); + break; + } + } + + if (!item) { + QString name; + + item = new QTreeWidgetItem(); + if (tap_hci->name) + name = tap_hci->name; + + item->setText(column_number_name, name); + item->setText(column_number_event, QString("").sprintf("0x%02X", tap_hci->event)); + + main_item->addChild(item); + main_item->sortChildren(column_number_event, Qt::AscendingOrder); + main_item->setText(column_number_occurrence, QString::number(main_item->text(column_number_occurrence).toInt() + 1)); + } + + item->setText(column_number_occurrence, QString::number(item->text(column_number_occurrence).toInt() + 1)); + + /* I belive bthci_cmd/bthci_evt already add frame item */ + if (tap_hci->type == BLUETOOTH_HCI_SUMMARY_VENDOR_EVENT) + break; + + frame_item = new QTreeWidgetItem(); + frame_item->setText(column_number_name, QString(tr("Frame %1")).arg(pinfo->fd->num)); + frame_item->setText(column_number_event, QString("").sprintf("0x%02X", tap_hci->event)); + item->addChild(frame_item); + + item_data = wmem_new(wmem_file_scope(), item_data_t); + item_data->interface_id = tap_hci->interface_id; + item_data->adapter_id = tap_hci->adapter_id; + item_data->frame_number = pinfo->fd->num; + frame_item->setData(0, Qt::UserRole, QVariant::fromValue<item_data_t *>(item_data)); + + break; + case BLUETOOTH_HCI_SUMMARY_STATUS: + main_item = dialog->item_status_; + + for (int i_item = 0; i_item < main_item->childCount(); i_item +=1) { + if (main_item->child(i_item)->text(column_number_status) == QString("").sprintf("0x%02X", tap_hci->status)) { + item = main_item->child(i_item); + break; + } + } + + if (!item) { + if (tap_hci->name) + name = tap_hci->name; + + item = new QTreeWidgetItem(); + item->setText(column_number_name, name); + item->setText(column_number_status, QString("").sprintf("0x%02X", tap_hci->status)); + + main_item->addChild(item); + main_item->sortChildren(column_number_event, Qt::AscendingOrder); + main_item->setText(column_number_occurrence, QString::number(main_item->text(column_number_occurrence).toInt() + 1)); + } + + item->setText(column_number_occurrence, QString::number(item->text(column_number_occurrence).toInt() + 1)); + + frame_item = new QTreeWidgetItem(); + frame_item->setText(column_number_name, QString(tr("Frame %1")).arg(pinfo->fd->num)); + frame_item->setText(column_number_status, QString("").sprintf("0x%02X", tap_hci->status)); + item->addChild(frame_item); + + item_data = wmem_new(wmem_file_scope(), item_data_t); + item_data->interface_id = tap_hci->interface_id; + item_data->adapter_id = tap_hci->adapter_id; + item_data->frame_number = pinfo->fd->num; + frame_item->setData(0, Qt::UserRole, QVariant::fromValue<item_data_t *>(item_data)); + + break; + case BLUETOOTH_HCI_SUMMARY_STATUS_PENDING: + main_item = dialog->item_status_; + + for (int i_item = 0; i_item < main_item->childCount(); i_item +=1) { + if (main_item->child(i_item)->text(column_number_status) == QString("").sprintf("%u", tap_hci->status)) { + item = main_item->child(i_item); + break; + } + } + + if (!item) { + item = new QTreeWidgetItem(); + item->setText(column_number_name, tr("Pending")); + item->setText(column_number_status, QString("").sprintf("%u", tap_hci->status)); + + main_item->addChild(item); + main_item->sortChildren(column_number_event, Qt::AscendingOrder); + main_item->setText(column_number_occurrence, QString::number(main_item->text(column_number_occurrence).toInt() + 1)); + } + + item->setText(column_number_occurrence, QString::number(item->text(column_number_occurrence).toInt() + 1)); + + frame_item = new QTreeWidgetItem(); + frame_item->setText(column_number_name, QString(tr("Frame %1")).arg(pinfo->fd->num)); + frame_item->setText(column_number_status, QString("").sprintf("%u", tap_hci->status)); + item->addChild(frame_item); + + item_data = wmem_new(wmem_file_scope(), item_data_t); + item_data->interface_id = tap_hci->interface_id; + item_data->adapter_id = tap_hci->adapter_id; + item_data->frame_number = pinfo->fd->num; + frame_item->setData(0, Qt::UserRole, QVariant::fromValue<item_data_t *>(item_data)); + + break; + case BLUETOOTH_HCI_SUMMARY_REASON: + main_item = dialog->item_reason_; + + for (int i_item = 0; i_item < main_item->childCount(); i_item +=1) { + if (main_item->child(i_item)->text(column_number_reason) == QString("").sprintf("0x%02X", tap_hci->reason)) { + item = main_item->child(i_item); + break; + } + } + + if (!item) { + if (tap_hci->name) + name = tap_hci->name; + + item = new QTreeWidgetItem(); + item->setText(column_number_name, name); + item->setText(column_number_reason, QString("").sprintf("0x%02X", tap_hci->reason)); + + main_item->addChild(item); + main_item->sortChildren(column_number_event, Qt::AscendingOrder); + main_item->setText(column_number_occurrence, QString::number(main_item->text(column_number_occurrence).toInt() + 1)); + } + + item->setText(column_number_occurrence, QString::number(item->text(column_number_occurrence).toInt() + 1)); + + frame_item = new QTreeWidgetItem(); + frame_item->setText(column_number_name, QString(tr("Frame %1")).arg(pinfo->fd->num)); + frame_item->setText(column_number_reason, QString("").sprintf("0x%02X", tap_hci->reason)); + item->addChild(frame_item); + + item_data = wmem_new(wmem_file_scope(), item_data_t); + item_data->interface_id = tap_hci->interface_id; + item_data->adapter_id = tap_hci->adapter_id; + item_data->frame_number = pinfo->fd->num; + frame_item->setData(0, Qt::UserRole, QVariant::fromValue<item_data_t *>(item_data)); + + break; + case BLUETOOTH_HCI_SUMMARY_HARDWARE_ERROR: + main_item = dialog->item_hardware_errors_; + + for (int i_item = 0; i_item < main_item->childCount(); i_item +=1) { + if (main_item->child(i_item)->text(column_number_hardware_error) == QString("").sprintf("0x%02X", tap_hci->hardware_error)) { + item = main_item->child(i_item); + break; + } + } + + if (!item) { + item = new QTreeWidgetItem(); + item->setText(column_number_name, QString("").sprintf("Hardware error 0x%02X", tap_hci->hardware_error)); + item->setText(column_number_hardware_error, QString("").sprintf("0x%02X", tap_hci->hardware_error)); + + main_item->addChild(item); + main_item->sortChildren(column_number_event, Qt::AscendingOrder); + main_item->setText(column_number_occurrence, QString::number(main_item->text(column_number_occurrence).toInt() + 1)); + } + + item->setText(column_number_occurrence, QString::number(item->text(column_number_occurrence).toInt() + 1)); + + frame_item = new QTreeWidgetItem(); + frame_item->setText(column_number_name, QString(tr("Frame %1")).arg(pinfo->fd->num)); + frame_item->setText(column_number_hardware_error, QString("").sprintf("0x%02X", tap_hci->hardware_error)); + item->addChild(frame_item); + + item_data = wmem_new(wmem_file_scope(), item_data_t); + item_data->interface_id = tap_hci->interface_id; + item_data->adapter_id = tap_hci->adapter_id; + item_data->frame_number = pinfo->fd->num; + frame_item->setData(0, Qt::UserRole, QVariant::fromValue<item_data_t *>(item_data)); + + break; + } + + for (int i = 0; i < dialog->ui->tableTreeWidget->columnCount(); i++) { + dialog->ui->tableTreeWidget->resizeColumnToContents(i); + } + + return TRUE; +} + +void BluetoothHciSummaryDialog::interfaceCurrentIndexChanged(int) +{ + cap_file_.retapPackets(); +} + +void BluetoothHciSummaryDialog::adapterCurrentIndexChanged(int) +{ + cap_file_.retapPackets(); +} + +void BluetoothHciSummaryDialog::on_tableTreeWidget_itemActivated(QTreeWidgetItem *item, int) +{ + if (!cap_file_.isValid()) + return; + + item_data_t *item_data = item->data(0, Qt::UserRole).value<item_data_t *>(); + + if (item_data) + emit goToPacket(item_data->frame_number); +} + + +void BluetoothHciSummaryDialog::recursiveCopyTreeItems(QTreeWidgetItem *item, QString ©, int ident_level) +{ + if (!item->isExpanded()) return; + + for (int i_item = 0; i_item < item->childCount(); i_item += 1) { + copy.append(QString(" ").repeated(ident_level)); + copy += QString("%1 %2 %3 %4 %5 %6 %7 %8 %9\n") + .arg(item->child(i_item)->text(column_number_name), -60 + 4 * ident_level) + .arg(item->child(i_item)->text(column_number_ogf), -10) + .arg(item->child(i_item)->text(column_number_ocf), -10) + .arg(item->child(i_item)->text(column_number_opcode), -10) + .arg(item->child(i_item)->text(column_number_event), -10) + .arg(item->child(i_item)->text(column_number_status), -10) + .arg(item->child(i_item)->text(column_number_reason), -10) + .arg(item->child(i_item)->text(column_number_hardware_error), -15) + .arg(item->child(i_item)->text(column_number_occurrence), -10); + + recursiveCopyTreeItems(item->child(i_item), copy, ident_level + 1); + } +} + +void BluetoothHciSummaryDialog::on_actionCopy_All_triggered() +{ + QClipboard *clipboard = QApplication::clipboard(); + QString copy; + QTreeWidgetItemIterator i_item(ui->tableTreeWidget); + + copy += QString("%1 %2 %3 %4 %5 %6 %7 %8 %9\n") + .arg(ui->tableTreeWidget->headerItem()->text(column_number_name), -60) + .arg(ui->tableTreeWidget->headerItem()->text(column_number_ogf), -10) + .arg(ui->tableTreeWidget->headerItem()->text(column_number_ocf), -10) + .arg(ui->tableTreeWidget->headerItem()->text(column_number_opcode), -10) + .arg(ui->tableTreeWidget->headerItem()->text(column_number_event), -10) + .arg(ui->tableTreeWidget->headerItem()->text(column_number_status), -10) + .arg(ui->tableTreeWidget->headerItem()->text(column_number_reason), -10) + .arg(ui->tableTreeWidget->headerItem()->text(column_number_hardware_error), -15) + .arg(ui->tableTreeWidget->headerItem()->text(column_number_occurrence), -10); + + for (int i_item = 0; i_item < ui->tableTreeWidget->topLevelItemCount(); i_item += 1) { + QTreeWidgetItem *item = ui->tableTreeWidget->topLevelItem(i_item); + + copy += QString("%1 %2 %3 %4 %5 %6 %7 %8 %9\n") + .arg(item->text(column_number_name), -60) + .arg(item->text(column_number_ogf), -10) + .arg(item->text(column_number_ocf), -10) + .arg(item->text(column_number_opcode), -10) + .arg(item->text(column_number_event), -10) + .arg(item->text(column_number_status), -10) + .arg(item->text(column_number_reason), -10) + .arg(item->text(column_number_hardware_error), -15) + .arg(item->text(column_number_occurrence), -10); + + recursiveCopyTreeItems(ui->tableTreeWidget->topLevelItem(i_item), copy, 1); + } + + clipboard->setText(copy); +} + +void BluetoothHciSummaryDialog::on_actionSave_as_image_triggered() +{ + QPixmap image; + + QString fileName = QFileDialog::getSaveFileName(this, + tr("Save Table Image"), + "bluetooth_hci_summary.png", + tr("PNG Image (*.png)")); + + if (fileName.isEmpty()) return; + + image = QPixmap::grabWidget(ui->tableTreeWidget); + image.save(fileName, "PNG"); +} + +void BluetoothHciSummaryDialog::on_buttonBox_clicked(QAbstractButton *) +{ +/* if (button == foo_button_) */ +} + +/* + * Editor modelines + * + * Local Variables: + * c-basic-offset: 4 + * tab-width: 8 + * indent-tabs-mode: nil + * End: + * + * ex: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: + */ diff --git a/ui/qt/bluetooth_hci_summary_dialog.h b/ui/qt/bluetooth_hci_summary_dialog.h new file mode 100644 index 0000000000..ee3b92259e --- /dev/null +++ b/ui/qt/bluetooth_hci_summary_dialog.h @@ -0,0 +1,124 @@ +/* bluetooth_hci_summary_dialog.h + * + * Wireshark - Network traffic analyzer + * By Gerald Combs <gerald@wireshark.org> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef BLUETOOTH_HCI_SUMMARY_DIALOG_H +#define BLUETOOTH_HCI_SUMMARY_DIALOG_H + +#include "config.h" + +#include <glib.h> + +#include "wireshark_dialog.h" +#include "cfile.h" +#include "packet_list.h" + +#include "epan/tap.h" + +#include <QMenu> + +class QAbstractButton; +class QPushButton; +class QTreeWidgetItem; + +typedef struct _bluetooth_hci_summary_tapinfo_t { + tap_reset_cb tap_reset; + tap_packet_cb tap_packet; + void *ui; +} bluetooth_hci_summary_tapinfo_t; + +namespace Ui { +class BluetoothHciSummaryDialog; +} + +class BluetoothHciSummaryDialog : public WiresharkDialog +{ + Q_OBJECT + +public: + explicit BluetoothHciSummaryDialog(QWidget &parent, CaptureFile &cf); + ~BluetoothHciSummaryDialog(); + +public slots: + +signals: + void updateFilter(QString &filter, bool force = false); + void captureFileChanged(capture_file *cf); + void goToPacket(int packet_num); + +protected: + +protected slots: + void changeEvent(QEvent* event); + +private: + Ui::BluetoothHciSummaryDialog *ui; + + bluetooth_hci_summary_tapinfo_t tapinfo_; + QMenu context_menu_; + + QTreeWidgetItem *item_link_control_; + QTreeWidgetItem *item_link_policy_; + QTreeWidgetItem *item_controller_and_baseband_; + QTreeWidgetItem *item_informational_; + QTreeWidgetItem *item_status_parameters_; + QTreeWidgetItem *item_testing_; + QTreeWidgetItem *item_low_energy_; + QTreeWidgetItem *item_logo_testing_; + QTreeWidgetItem *item_vendor_; + QTreeWidgetItem *item_unknown_ogf_; + QTreeWidgetItem *item_events_; + QTreeWidgetItem *item_status_; + QTreeWidgetItem *item_reason_; + QTreeWidgetItem *item_hardware_errors_; + + static void tapReset(void *tapinfo_ptr); + static gboolean tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data); + +private slots: + void captureFileClosing(); + void recursiveCopyTreeItems(QTreeWidgetItem *item, QString ©, int ident_level); + void on_tableTreeWidget_itemActivated(QTreeWidgetItem *item, int); + void on_buttonBox_clicked(QAbstractButton *button); + void on_actionCopy_Cell_triggered(); + void on_actionCopy_Rows_triggered(); + void on_actionCopy_All_triggered(); + void on_actionSave_as_image_triggered(); + void tableContextMenu(const QPoint &pos); + void tableItemExpanded(QTreeWidgetItem *item); + void tableItemCollapsed(QTreeWidgetItem *item); + void interfaceCurrentIndexChanged(int index); + void adapterCurrentIndexChanged(int index); +}; + +#endif // BLUETOOTH_HCI_SUMMARY_DIALOG_H + +/* + * Editor modelines + * + * Local Variables: + * c-basic-offset: 4 + * tab-width: 8 + * indent-tabs-mode: nil + * End: + * + * ex: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: + */ diff --git a/ui/qt/bluetooth_hci_summary_dialog.ui b/ui/qt/bluetooth_hci_summary_dialog.ui new file mode 100644 index 0000000000..8e429f2c51 --- /dev/null +++ b/ui/qt/bluetooth_hci_summary_dialog.ui @@ -0,0 +1,661 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>BluetoothHciSummaryDialog</class> + <widget class="QDialog" name="BluetoothHciSummaryDialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>880</width> + <height>477</height> + </rect> + </property> + <property name="baseSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="windowTitle"> + <string>Bluetooth HCI Summary</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QTreeWidget" name="tableTreeWidget"> + <property name="contextMenuPolicy"> + <enum>Qt::CustomContextMenu</enum> + </property> + <property name="editTriggers"> + <set>QAbstractItemView::NoEditTriggers</set> + </property> + <property name="showDropIndicator" stdset="0"> + <bool>false</bool> + </property> + <property name="alternatingRowColors"> + <bool>true</bool> + </property> + <property name="selectionMode"> + <enum>QAbstractItemView::ExtendedSelection</enum> + </property> + <property name="textElideMode"> + <enum>Qt::ElideMiddle</enum> + </property> + <property name="indentation"> + <number>30</number> + </property> + <property name="rootIsDecorated"> + <bool>true</bool> + </property> + <property name="uniformRowHeights"> + <bool>false</bool> + </property> + <property name="itemsExpandable"> + <bool>true</bool> + </property> + <property name="sortingEnabled"> + <bool>false</bool> + </property> + <property name="animated"> + <bool>false</bool> + </property> + <property name="allColumnsShowFocus"> + <bool>false</bool> + </property> + <property name="headerHidden"> + <bool>false</bool> + </property> + <attribute name="headerCascadingSectionResizes"> + <bool>false</bool> + </attribute> + <attribute name="headerDefaultSectionSize"> + <number>100</number> + </attribute> + <attribute name="headerHighlightSections"> + <bool>false</bool> + </attribute> + <attribute name="headerMinimumSectionSize"> + <number>100</number> + </attribute> + <attribute name="headerShowSortIndicator" stdset="0"> + <bool>false</bool> + </attribute> + <attribute name="headerStretchLastSection"> + <bool>true</bool> + </attribute> + <column> + <property name="text"> + <string>Name</string> + </property> + </column> + <column> + <property name="text"> + <string>OGF</string> + </property> + </column> + <column> + <property name="text"> + <string>OCF</string> + </property> + </column> + <column> + <property name="text"> + <string>Opcode</string> + </property> + </column> + <column> + <property name="text"> + <string>Event</string> + </property> + </column> + <column> + <property name="text"> + <string>Status</string> + </property> + </column> + <column> + <property name="text"> + <string>Reason</string> + </property> + </column> + <column> + <property name="text"> + <string>Hardware Error</string> + </property> + </column> + <column> + <property name="text"> + <string>Occurrence</string> + </property> + </column> + <item> + <property name="text"> + <string>Link Control Commands</string> + </property> + <property name="text"> + <string>0x01</string> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string>0</string> + </property> + </item> + <item> + <property name="text"> + <string>Link Policy Commands</string> + </property> + <property name="text"> + <string>0x02</string> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string>0</string> + </property> + </item> + <item> + <property name="text"> + <string>Controller & Baseband Commands</string> + </property> + <property name="text"> + <string>0x03</string> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string>0</string> + </property> + </item> + <item> + <property name="text"> + <string>Informational Parameters</string> + </property> + <property name="text"> + <string>0x04</string> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string>0</string> + </property> + </item> + <item> + <property name="text"> + <string>Status Parameters</string> + </property> + <property name="text"> + <string>0x05</string> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string>0</string> + </property> + </item> + <item> + <property name="text"> + <string>Testing Commands</string> + </property> + <property name="text"> + <string>0x06</string> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string>0</string> + </property> + </item> + <item> + <property name="text"> + <string>LE Controller Commands</string> + </property> + <property name="text"> + <string>0x08</string> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string>0</string> + </property> + </item> + <item> + <property name="text"> + <string>Bluetooth Logo Testing Commands</string> + </property> + <property name="text"> + <string>0x3E</string> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string>0</string> + </property> + </item> + <item> + <property name="text"> + <string>Vendor-Specific Commands</string> + </property> + <property name="text"> + <string>0x3F</string> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string>0</string> + </property> + </item> + <item> + <property name="text"> + <string>Unknown OGF</string> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + </item> + <item> + <property name="text"> + <string>Events</string> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string>0</string> + </property> + </item> + <item> + <property name="text"> + <string>Status</string> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string>0</string> + </property> + </item> + <item> + <property name="text"> + <string>Reason</string> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + </item> + <item> + <property name="text"> + <string>Hardware Errors</string> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="text"> + <string>0</string> + </property> + </item> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0"> + <property name="spacing"> + <number>-1</number> + </property> + <property name="sizeConstraint"> + <enum>QLayout::SetDefaultConstraint</enum> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QComboBox" name="interfaceComboBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>350</width> + <height>0</height> + </size> + </property> + <item> + <property name="text"> + <string>All Interfaces</string> + </property> + </item> + </widget> + </item> + <item> + <widget class="QComboBox" name="adapterComboBox"> + <property name="minimumSize"> + <size> + <width>320</width> + <height>0</height> + </size> + </property> + <item> + <property name="text"> + <string>All Adapters</string> + </property> + </item> + </widget> + </item> + </layout> + </item> + <item> + <widget class="QLabel" name="hintLabel"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Close</set> + </property> + </widget> + </item> + </layout> + <action name="actionCopy_Cell"> + <property name="text"> + <string>Copy Cell</string> + </property> + </action> + <action name="actionCopy_Rows"> + <property name="text"> + <string>Copy Rows</string> + </property> + </action> + <action name="actionCopy_All"> + <property name="text"> + <string>Copy All</string> + </property> + </action> + <action name="actionSave_as_image"> + <property name="text"> + <string>Save as image</string> + </property> + </action> + </widget> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>BluetoothHciSummaryDialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>374</x> + <y>407</y> + </hint> + <hint type="destinationlabel"> + <x>374</x> + <y>214</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>BluetoothHciSummaryDialog</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>374</x> + <y>407</y> + </hint> + <hint type="destinationlabel"> + <x>374</x> + <y>214</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/ui/qt/main_window.h b/ui/qt/main_window.h index 6f74cda8f6..1c238b7495 100644 --- a/ui/qt/main_window.h +++ b/ui/qt/main_window.h @@ -519,6 +519,7 @@ private slots: void on_actionATT_Server_Attributes_triggered(); void on_actionDevices_triggered(); + void on_actionHCI_Summary_triggered(); void externalMenuItem_triggered(); diff --git a/ui/qt/main_window.ui b/ui/qt/main_window.ui index 6a334ef049..637dcd949a 100644 --- a/ui/qt/main_window.ui +++ b/ui/qt/main_window.ui @@ -566,6 +566,7 @@ </property> <addaction name="actionATT_Server_Attributes"/> <addaction name="actionDevices"/> + <addaction name="actionHCI_Summary"/> </widget> <widget class="QMenu" name="menuTools"> <property name="title"> @@ -2347,6 +2348,11 @@ <string>Devices</string> </property> </action> + <action name="actionHCI_Summary"> + <property name="text"> + <string>HCI Summary</string> + </property> + </action> <action name="actionViewShowPacketInNewWindow"> <property name="text"> <string>Show Packet in New &Window</string> diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index d62d91ccad..9f77bd487f 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -76,6 +76,7 @@ #include "about_dialog.h" #include "bluetooth_att_server_attributes_dialog.h" #include "bluetooth_devices_dialog.h" +#include "bluetooth_hci_summary_dialog.h" #include "capture_file_dialog.h" #include "capture_file_properties_dialog.h" #include "color_utils.h" @@ -2959,6 +2960,16 @@ void MainWindow::on_actionDevices_triggered() bluetooth_devices_dialog->show(); } +void MainWindow::on_actionHCI_Summary_triggered() +{ + BluetoothHciSummaryDialog *bluetooth_hci_summary_dialog = new BluetoothHciSummaryDialog(*this, capture_file_); + connect(bluetooth_hci_summary_dialog, SIGNAL(goToPacket(int)), + packet_list_, SLOT(goToPacket(int))); + connect(bluetooth_hci_summary_dialog, SIGNAL(updateFilter(QString&, bool)), + this, SLOT(filterPackets(QString&, bool))); + bluetooth_hci_summary_dialog->show(); +} + // Help Menu void MainWindow::on_actionHelpContents_triggered() { |