aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-bthci_cmd.c
diff options
context:
space:
mode:
authorMichal Labedzki <michal.labedzki@tieto.com>2015-05-19 11:55:01 +0200
committerMichal Labedzki <michal.labedzki@tieto.com>2016-06-10 13:50:35 +0000
commit237f2d400669aec77dabfba29c9d4cbbd75d246e (patch)
treeec463009d669f7add0cf46f786d9628da08fa17d /epan/dissectors/packet-bthci_cmd.c
parent2df337d5385ddbb501c11b3d22080060d054436d (diff)
Qt/Bluetooth: Add Device dialog
Device dialog appears when user double clicks on device in Devices dialog (Bluetooth->Devices). It provides summary of device, like BD_ADDR, name, timeouts, etc. Base on information from HCI layer, so this feature is more interesting for local devices (capturing on its side). Each field has changes counter, what mean that value at specified field changes in time, for example: user change device name 3 times. Please note that initial change is not counted. It means that you can see fielkd without any value then change occur and counter is not increased. It will be increased next time. Reason for that is in most cases field value is unknown at start. Change-Id: Ife0a6bd454eac00a28f8eb2906e1b395695b0307 Reviewed-on: https://code.wireshark.org/review/15793 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
Diffstat (limited to 'epan/dissectors/packet-bthci_cmd.c')
-rw-r--r--epan/dissectors/packet-bthci_cmd.c43
1 files changed, 37 insertions, 6 deletions
diff --git a/epan/dissectors/packet-bthci_cmd.c b/epan/dissectors/packet-bthci_cmd.c
index abe2a910f1..f17167ccc5 100644
--- a/epan/dissectors/packet-bthci_cmd.c
+++ b/epan/dissectors/packet-bthci_cmd.c
@@ -1327,7 +1327,7 @@ const value_string bthci_cmd_scan_enable_values[] = {
{0, NULL }
};
-static const value_string cmd_authentication_enable_values[] = {
+const value_string bthci_cmd_authentication_enable_values[] = {
{0x00, "Authentication disabled" },
{0x01, "Authentication enabled for all connection" },
{0, NULL }
@@ -1393,7 +1393,7 @@ static const value_string cmd_loopback_modes[] = {
{0, NULL }
};
-static const value_string cmd_encrypt_mode_vals[] = {
+const value_string bthci_cmd_encrypt_mode_vals[] = {
{ 0x00, "Encryption Disabled" },
{ 0x01, "Encryption only for Point-To-Point Packets" },
{ 0x02, "Encryption for Point-To-Point and Broadcast Packets" },
@@ -1448,7 +1448,7 @@ static const value_string cmd_scan_types[] = {
{ 0, NULL }
};
-static const value_string cmd_inq_modes[] = {
+const value_string bthci_cmd_inq_modes[] = {
{0x00, "Standard Results" },
{0x01, "Results With RSSI" },
{0x02, "Results With RSSI or Extended Results" },
@@ -2419,28 +2419,43 @@ dissect_host_controller_baseband_cmd(tvbuff_t *tvb, int offset, packet_info *pin
} else {
proto_item_append_text(item, " Illegal Page Timeout");
}
+ if (!pinfo->fd->flags.visited && bthci_cmd_data) {
+ bthci_cmd_data->data.page_timeout = timeout;
+ }
offset+=2;
break;
case 0x001a: /* Write Scan Enable */
proto_tree_add_item(tree, hf_bthci_cmd_scan_enable,
tvb, offset, 1, ENC_LITTLE_ENDIAN);
+ if (!pinfo->fd->flags.visited && bthci_cmd_data) {
+ bthci_cmd_data->data.scan = tvb_get_guint8(tvb, offset);
+ }
offset++;
break;
case 0x0020: /* Write Authentication Enable */
proto_tree_add_item(tree, hf_bthci_cmd_authentication_enable,
tvb, offset, 1, ENC_LITTLE_ENDIAN);
+ if (!pinfo->fd->flags.visited && bthci_cmd_data) {
+ bthci_cmd_data->data.authentication = tvb_get_guint8(tvb, offset);
+ }
offset++;
break;
case 0x0022: /* Write Encryption Mode */
proto_tree_add_item(tree, hf_bthci_cmd_encrypt_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
+ if (!pinfo->fd->flags.visited && bthci_cmd_data) {
+ bthci_cmd_data->data.encryption = tvb_get_guint8(tvb, offset);
+ }
offset++;
break;
case 0x0024: /* Write Class of Device */
call_dissector(btcommon_cod_handle, tvb_new_subset_length(tvb, offset, 3), pinfo, tree);
+ if (!pinfo->fd->flags.visited && bthci_cmd_data) {
+ bthci_cmd_data->data.class_of_device = tvb_get_guint24(tvb, offset, ENC_LITTLE_ENDIAN);
+ }
offset += 3;
break;
@@ -2457,6 +2472,9 @@ dissect_host_controller_baseband_cmd(tvbuff_t *tvb, int offset, packet_info *pin
tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_air_coding_format,
tvb, offset, 2, ENC_LITTLE_ENDIAN);
+ if (!pinfo->fd->flags.visited && bthci_cmd_data) {
+ bthci_cmd_data->data.voice_setting = tvb_get_guint16(tvb, offset, ENC_LITTLE_ENDIAN);
+ }
offset+=2;
break;
@@ -2523,6 +2541,13 @@ dissect_host_controller_baseband_cmd(tvbuff_t *tvb, int offset, packet_info *pin
proto_tree_add_item(tree, hf_bthci_cmd_host_total_num_sco_data_packets,
tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
+
+ if (!pinfo->fd->flags.visited && bthci_cmd_data) {
+ bthci_cmd_data->data.mtus.acl_mtu = tvb_get_guint16(tvb, offset - 7, ENC_LITTLE_ENDIAN);
+ bthci_cmd_data->data.mtus.sco_mtu = tvb_get_guint8(tvb, offset - 5);
+ bthci_cmd_data->data.mtus.acl_packets = tvb_get_guint16(tvb, offset - 4, ENC_LITTLE_ENDIAN);
+ bthci_cmd_data->data.mtus.sco_packets = tvb_get_guint16(tvb, offset - 2, ENC_LITTLE_ENDIAN);
+ }
break;
case 0x0035: /* Host Number Of Completed Packets */
@@ -2608,6 +2633,9 @@ dissect_host_controller_baseband_cmd(tvbuff_t *tvb, int offset, packet_info *pin
case 0x0045: /* Write Inquiry Mode */
proto_tree_add_item(tree, hf_bthci_cmd_inq_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
+ if (!pinfo->fd->flags.visited && bthci_cmd_data) {
+ bthci_cmd_data->data.inquiry_mode = tvb_get_guint8(tvb, offset);
+ }
offset++;
break;
@@ -2647,6 +2675,9 @@ dissect_host_controller_baseband_cmd(tvbuff_t *tvb, int offset, packet_info *pin
case 0x0056: /* Write Simple Pairing Mode */
proto_tree_add_item(tree, hf_bthci_cmd_simple_pairing_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
+ if (!pinfo->fd->flags.visited && bthci_cmd_data) {
+ bthci_cmd_data->data.simple_pairing_mode = tvb_get_guint8(tvb, offset);
+ }
offset++;
break;
@@ -3525,7 +3556,7 @@ proto_register_bthci_cmd(void)
},
{ &hf_bthci_cmd_encrypt_mode,
{ "Encryption Mode", "bthci_cmd.encrypt_mode",
- FT_UINT8, BASE_HEX, VALS(cmd_encrypt_mode_vals), 0x0,
+ FT_UINT8, BASE_HEX, VALS(bthci_cmd_encrypt_mode_vals), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_bd_addr,
@@ -3895,7 +3926,7 @@ proto_register_bthci_cmd(void)
},
{ &hf_bthci_cmd_authentication_enable,
{ "Authentication Enable", "bthci_cmd.auth_enable",
- FT_UINT8, BASE_HEX, VALS(cmd_authentication_enable_values), 0x0,
+ FT_UINT8, BASE_HEX, VALS(bthci_cmd_authentication_enable_values), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_input_unused,
@@ -4296,7 +4327,7 @@ proto_register_bthci_cmd(void)
},
{ &hf_bthci_cmd_inq_mode,
{"Inquiry Mode", "bthci_cmd.inq_scan_type",
- FT_UINT8, BASE_DEC, VALS(cmd_inq_modes), 0x0,
+ FT_UINT8, BASE_DEC, VALS(bthci_cmd_inq_modes), 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_fec_required,