2 * Routines for the Bluetooth HCI Event dissection
3 * Copyright 2002, Christoph Scholz <scholz@cs.uni-bonn.de>
4 * From: http://affix.sourceforge.net/archive/ethereal_affix-3.patch
6 * Refactored for wireshark checkin
9 * Updated to HCI specification 2.1 + EDR
10 * Allan M. Madsen 2007
14 * Wireshark - Network traffic analyzer
15 * By Gerald Combs <gerald@wireshark.org>
16 * Copyright 1998 Gerald Combs
18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License
20 * as published by the Free Software Foundation; either version 2
21 * of the License, or (at your option) any later version.
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
40 #include <epan/packet.h>
41 #include <epan/strutil.h>
43 #include <packet-hci_h4.h>
44 #include <addr_resolv.h>
46 static dissector_handle_t bthci_com_handle;
48 /* Initialize the protocol and registered fields */
49 static int proto_bthci_evt = -1;
50 static int hf_bthci_evt_code = -1;
51 static int hf_bthci_evt_param_length = -1;
52 static int hf_bthci_evt_params = -1;
53 static int hf_bthci_evt_num_command_packets = -1;
54 static int hf_bthci_evt_num_handles = -1;
55 static int hf_bthci_evt_connection_handle = -1;
56 static int hf_bthci_evt_num_compl_packets = -1;
57 static int hf_bthci_evt_com_opcode = -1;
58 static int hf_bthci_evt_ret_params = -1;
59 static int hf_bthci_evt_status = -1;
60 static int hf_bthci_evt_status_pending = -1;
61 static int hf_bthci_evt_ocf = -1;
62 static int hf_bthci_evt_ogf = -1;
63 static int hf_bthci_evt_bd_addr = -1;
64 static int hf_bthci_evt_class_of_device = -1;
65 static int hf_bthci_evt_link_type = -1;
66 static int hf_bthci_evt_encryption_mode = -1;
67 static int hf_bthci_evt_reason = -1;
68 static int hf_bthci_evt_remote_name = -1;
69 static int hf_bthci_evt_encryption_enable = -1;
70 static int hf_bthci_evt_key_flag = -1;
71 static int hf_bthci_evt_vers_nr = -1;
72 static int hf_bthci_evt_hci_vers_nr = -1;
73 static int hf_bthci_evt_hci_revision = -1;
74 static int hf_bthci_evt_comp_id = -1;
75 static int hf_bthci_evt_sub_vers_nr = -1;
76 static int hf_bthci_evt_flags = -1;
77 static int hf_bthci_evt_service_type = -1;
78 static int hf_bthci_evt_token_rate = -1;
79 static int hf_bthci_evt_peak_bandwidth = -1;
80 static int hf_bthci_evt_latency = -1;
81 static int hf_bthci_evt_delay_variation = -1;
82 static int hf_bthci_evt_hardware_code = -1;
83 static int hf_bthci_evt_role = -1;
84 static int hf_bthci_evt_curr_role = -1;
85 static int hf_bthci_evt_curr_mode = -1;
86 static int hf_bthci_evt_interval = -1;
87 static int hf_bthci_evt_link_key = -1;
88 static int hf_bthci_evt_key_type = -1;
89 static int hf_bthci_evt_max_slots = -1;
90 static int hf_bthci_evt_clock_offset = -1;
91 static int hf_bthci_evt_link_type_2dh1 = -1;
92 static int hf_bthci_evt_link_type_3dh1 = -1;
93 static int hf_bthci_evt_link_type_dm1 = -1;
94 static int hf_bthci_evt_link_type_dh1 = -1;
95 static int hf_bthci_evt_link_type_2dh3 = -1;
96 static int hf_bthci_evt_link_type_3dh3 = -1;
97 static int hf_bthci_evt_link_type_dm3 = -1;
98 static int hf_bthci_evt_link_type_dh3 = -1;
99 static int hf_bthci_evt_link_type_2dh5 = -1;
100 static int hf_bthci_evt_link_type_3dh5 = -1;
101 static int hf_bthci_evt_link_type_dm5 = -1;
102 static int hf_bthci_evt_link_type_dh5 = -1;
103 static int hf_bthci_evt_link_type_hv1 = -1;
104 static int hf_bthci_evt_link_type_hv2 = -1;
105 static int hf_bthci_evt_link_type_hv3 = -1;
106 static int hf_bthci_evt_page_scan_mode = -1;
107 static int hf_bthci_evt_page_scan_repetition_mode = -1;
108 static int hf_bthci_evt_page_scan_period_mode = -1;
109 static int hf_bthci_evt_lmp_feature_00 = -1;
110 static int hf_bthci_evt_lmp_feature_01 = -1;
111 static int hf_bthci_evt_lmp_feature_02 = -1;
112 static int hf_bthci_evt_lmp_feature_03 = -1;
113 static int hf_bthci_evt_lmp_feature_04 = -1;
114 static int hf_bthci_evt_lmp_feature_05 = -1;
115 static int hf_bthci_evt_lmp_feature_06 = -1;
116 static int hf_bthci_evt_lmp_feature_07 = -1;
117 static int hf_bthci_evt_lmp_feature_10 = -1;
118 static int hf_bthci_evt_lmp_feature_11 = -1;
119 static int hf_bthci_evt_lmp_feature_12 = -1;
120 static int hf_bthci_evt_lmp_feature_13 = -1;
121 static int hf_bthci_evt_lmp_feature_14 = -1;
122 static int hf_bthci_evt_lmp_feature_15 = -1;
123 static int hf_bthci_evt_lmp_feature_16 = -1;
124 static int hf_bthci_evt_lmp_feature_17 = -1;
125 static int hf_bthci_evt_lmp_feature_20 = -1;
126 static int hf_bthci_evt_lmp_feature_21 = -1;
127 static int hf_bthci_evt_lmp_feature_22 = -1;
128 static int hf_bthci_evt_lmp_feature_23 = -1;
129 static int hf_bthci_evt_lmp_feature_24 = -1;
130 static int hf_bthci_evt_lmp_feature_27 = -1;
131 static int hf_bthci_evt_lmp_feature_31 = -1;
132 static int hf_bthci_evt_lmp_feature_32 = -1;
133 static int hf_bthci_evt_lmp_feature_33 = -1;
134 static int hf_bthci_evt_lmp_feature_34 = -1;
135 static int hf_bthci_evt_lmp_feature_35 = -1;
136 static int hf_bthci_evt_lmp_feature_36 = -1;
137 static int hf_bthci_evt_lmp_feature_37 = -1;
138 static int hf_bthci_evt_lmp_feature_40 = -1;
139 static int hf_bthci_evt_lmp_feature_41 = -1;
140 static int hf_bthci_evt_lmp_feature_43 = -1;
141 static int hf_bthci_evt_lmp_feature_44 = -1;
142 static int hf_bthci_evt_lmp_feature_47 = -1;
143 static int hf_bthci_evt_lmp_feature_50 = -1;
144 static int hf_bthci_evt_lmp_feature_51 = -1;
145 static int hf_bthci_evt_lmp_feature_52 = -1;
146 static int hf_bthci_evt_lmp_feature_53 = -1;
147 static int hf_bthci_evt_lmp_feature_54 = -1;
148 static int hf_bthci_evt_lmp_feature_55 = -1;
149 static int hf_bthci_evt_lmp_feature_56 = -1;
150 static int hf_bthci_evt_lmp_feature_57 = -1;
151 static int hf_bthci_evt_lmp_feature_60 = -1;
152 static int hf_bthci_evt_lmp_feature_63 = -1;
153 static int hf_bthci_evt_lmp_feature_64 = -1;
154 static int hf_bthci_evt_lmp_feature_65 = -1;
155 static int hf_bthci_evt_lmp_feature_66 = -1;
156 static int hf_bthci_evt_lmp_feature_70 = -1;
157 static int hf_bthci_evt_lmp_feature_71 = -1;
158 static int hf_bthci_evt_lmp_feature_77 = -1;
159 static int hf_bthci_evt_num_keys = -1;
160 static int hf_bthci_evt_num_keys_read = -1;
161 static int hf_bthci_evt_max_num_keys = -1;
162 static int hf_bthci_evt_num_responses = -1;
163 static int hf_bthci_evt_num_keys_written = -1;
164 static int hf_bthci_evt_num_keys_deleted = -1;
165 static int hf_bthci_evt_link_policy_setting_switch = -1;
166 static int hf_bthci_evt_link_policy_setting_hold = -1;
167 static int hf_bthci_evt_link_policy_setting_sniff = -1;
168 static int hf_bthci_evt_link_policy_setting_park = -1;
169 static int hf_bthci_evt_pin_type = -1;
170 static int hf_bthci_evt_device_name = -1;
171 static int hf_bthci_evt_timeout = -1;
172 static int hf_bthci_evt_scan_enable = -1;
173 static int hf_bthci_evt_authentication_enable = -1;
174 static int hf_bthci_evt_sco_flow_cont_enable = -1;
175 static int hf_bthci_evt_window = -1;
176 static int hf_bthci_evt_input_coding = -1;
177 static int hf_bthci_evt_input_data_format = -1;
178 static int hf_bthci_evt_input_sample_size = -1;
179 static int hf_bthci_evt_num_broadcast_retransm = -1;
180 static int hf_bthci_evt_hold_mode_act_page = -1;
181 static int hf_bthci_evt_hold_mode_act_inquiry = -1;
182 static int hf_bthci_evt_hold_mode_act_periodic = -1;
183 static int hf_bthci_evt_transmit_power_level = -1;
184 static int hf_bthci_evt_num_supp_iac = -1;
185 static int hf_bthci_evt_num_curr_iac = -1;
186 static int hf_bthci_evt_iac_lap = -1;
187 static int hf_bthci_evt_loopback_mode = -1;
188 static int hf_bthci_evt_country_code = -1;
189 static int hf_bthci_evt_failed_contact_counter = -1;
190 static int hf_bthci_evt_link_quality = -1;
191 static int hf_bthci_evt_rssi = -1;
192 static int hf_bthci_evt_host_data_packet_length_acl = -1;
193 static int hf_bthci_evt_host_data_packet_length_sco = -1;
194 static int hf_bthci_evt_host_total_num_acl_data_packets = -1;
195 static int hf_bthci_evt_host_total_num_sco_data_packets = -1;
196 static int hf_bthci_evt_page_number = -1;
197 static int hf_bthci_evt_max_page_number = -1;
198 static int hf_bthci_evt_local_supported_cmds = -1;
199 static int hf_bthci_evt_fec_required = -1;
200 static int hf_bthci_evt_err_data_reporting = -1;
201 static int hf_bthci_evt_scan_type = -1;
202 static int hf_bthci_evt_inq_mode = -1;
203 static int hf_bthci_evt_power_level_type = -1;
204 static int hf_bthci_evt_ext_lmp_features = -1;
205 static int hf_bthci_evt_sync_link_type = -1;
206 static int hf_bthci_evt_sync_tx_interval = -1;
207 static int hf_bthci_evt_sync_rtx_window = -1;
208 static int hf_bthci_evt_sync_rx_packet_length = -1;
209 static int hf_bthci_evt_sync_tx_packet_length = -1;
210 static int hf_bthci_evt_air_mode = -1;
211 static int hf_bthci_evt_max_tx_latency = -1;
212 static int hf_bthci_evt_max_rx_latency = -1;
213 static int hf_bthci_evt_min_remote_timeout = -1;
214 static int hf_bthci_evt_min_local_timeout = -1;
215 static int hf_bthci_evt_link_supervision_timeout = -1;
216 static int hf_bthci_evt_token_bucket_size = -1;
217 static int hf_bthci_evt_flow_direction = -1;
218 static int hf_bthci_evt_afh_ch_assessment_mode = -1;
219 static int hf_bthci_evt_lmp_handle = -1;
220 static int hf_bthci_evt_clock = -1;
221 static int hf_bthci_evt_clock_accuracy = -1;
222 static int hf_bthci_evt_afh_mode = -1;
223 static int hf_bthci_evt_afh_channel_map = -1;
224 static int hf_bthci_evt_simple_pairing_mode = -1;
225 static int hf_bthci_evt_randomizer_r = -1;
226 static int hf_bthci_evt_hash_c = -1;
227 static int hf_bthci_evt_io_capability = -1;
228 static int hf_bthci_evt_oob_data_present = -1;
229 static int hf_bthci_evt_auth_requirements = -1;
230 static int hf_bthci_evt_numeric_value = -1;
231 static int hf_bthci_evt_passkey = -1;
232 static int hf_bthci_evt_notification_type = -1;
233 static int hf_bthci_evt_eir_data = -1;
234 static int hf_bthci_evt_eir_struct_length = -1;
235 static int hf_bthci_evt_eir_struct_type = -1;
236 static int hf_bthci_evt_sc_uuid16 = -1;
237 static int hf_bthci_evt_sc_uuid32 = -1;
238 static int hf_bthci_evt_sc_uuid128 = -1;
241 /* Initialize the subtree pointers */
242 static gint ett_bthci_evt = -1;
243 static gint ett_opcode = -1;
244 static gint ett_lmp_subtree = -1;
245 static gint ett_ptype_subtree = -1;
246 static gint ett_eir_subtree = -1;
247 static gint ett_eir_struct_subtree = -1;
249 static const value_string evt_code_vals[] = {
250 {0x01, "Inquiry Complete"},
251 {0x02, "Inquiry Result"},
252 {0x03, "Connect Complete"},
253 {0x04, "Connect Request"},
254 {0x05, "Disconnect Complete"},
255 {0x06, "Auth Complete"},
256 {0x07, "Remote Name Req Complete"},
257 {0x08, "Encrypt Change"},
258 {0x09, "Change Connection Link Key Complete"},
259 {0x0a, "Master Link Key Complete"},
260 {0x0b, "Read Remote Supported Features"},
261 {0x0c, "Read Remote Ver Info Complete"},
262 {0x0d, "QoS Setup Complete"},
263 {0x0e, "Command Complete"},
264 {0x0f, "Command Status"},
265 {0x10, "Hardware Error"},
266 {0x11, "Flush Occurred"},
267 {0x12, "Role Change"},
268 {0x13, "Number of Completed Packets"},
269 {0x14, "Mode Change"},
270 {0x15, "Return Link Keys"},
271 {0x16, "PIN Code Request"},
272 {0x17, "Link Key Request"},
273 {0x18, "Link Key Notification"},
274 {0x19, "Loopback Command"},
275 {0x1a, "Data Buffer Overflow"},
276 {0x1b, "Max Slots Change"},
277 {0x1c, "Read Clock Offset Complete"},
278 {0x1d, "Connection Packet Type Changed"},
279 {0x1e, "QoS Violation"},
280 {0x1f, "Page Scan Mode Change"},
281 {0x20, "Page Scan Repetition Mode Change"},
282 {0x21, "Flow Specification Complete"},
283 {0x22, "Inquiry Result With RSSI"},
284 {0x23, "Read Remote Extended Features Complete"},
285 {0x2c, "Synchronous Connection Complete"},
286 {0x2d, "Synchronous Connection Changed"},
287 {0x2e, "Sniff Subrate"},
288 {0x2f, "Extended Inquiry Result"},
289 {0x30, "Encryption Key Refresh Complete"},
290 {0x31, "IO Capability Request"},
291 {0x32, "IO Capability Response"},
292 {0x33, "User Confirmation Request"},
293 {0x34, "User Passkey Request"},
294 {0x35, "Remote OOB Data Request"},
295 {0x36, "Simple Pairing Complete"},
296 {0x38, "Link Supervision Timeout Changed"},
297 {0x39, "Enhanced Flush Complete"},
298 {0x3b, "User Passkey Notification"},
299 {0x3c, "Keypress Notification"},
300 {0x3d, "Remote Host Supported Features Notification"},
301 {0xfe, "Bluetooth Logo Testing"},
302 {0xff, "Vendor-Specific"},
306 static const value_string bthci_cmd_status_pending_vals[] = {
311 static const value_string evt_link_types[] = {
312 {0x00, "SCO connection (Voice Channels)"},
313 {0x01, "ACL connection (Data Channels)"},
317 static const value_string evt_sync_link_types[] = {
318 {0x00, "SCO connection"},
319 {0x02, "eSCO connection"},
323 static const value_string evt_encryption_modes[] = {
324 {0x00, "Encryption Disabled"},
325 {0x01, "Encryption only for point-to-point packets"},
326 {0x02, "Encryption for both point-to-point and broadcast packets"},
330 static const value_string evt_encryption_enable[] = {
331 {0x00, "Link Level Encryption is OFF"},
332 {0x01, "Link Level Encryption is ON"},
336 static const value_string evt_key_flag[] = {
337 {0x00, "Using Semi-permanent Link Key"},
338 {0x01, "Using Temporary Link Key"},
342 static const value_string evt_lmp_vers_nr[] = {
343 {0x00, "Bluetooth LMP 1.0"},
344 {0x01, "Bluetooth LMP 1.1"},
345 {0x02, "Bluetooth LMP 1.2"},
346 {0x03, "Bluetooth LMP 2.0"},
347 {0x04, "Bluetooth LMP 2.1"},
351 static const value_string evt_hci_vers_nr[] = {
352 {0x00, "Bluetooth HCI Specification 1.0B"},
353 {0x01, "Bluetooth HCI Specification 1.1"},
354 {0x02, "Bluetooth HCI Specification 1.2"},
355 {0x03, "Bluetooth HCI Specification 2.0"},
356 {0x04, "Bluetooth HCI Specification 2.1"},
360 static const value_string evt_comp_id[] = {
361 {0x0000, "Ericsson Mobile Communications"},
362 {0x0001, "Nokia Mobile Phones"},
363 {0x0002, "Intel Corp."},
364 {0x0003, "IBM Corp."},
365 {0x0004, "Toshiba Corp."},
367 {0x0006, "Microsoft"},
369 {0x0008, "Motorola"},
370 {0x0009, "Infineon Technologies AG"},
371 {0x000a, "Cambridge Silicon Radio"},
372 {0x000b, "Silicon Wave"},
373 {0x000c, "Digianswer"},
374 {0x000d, "Texas Instruments Inc."},
375 {0x000e, "Parthus Technologies Inc."},
376 {0x000f, "Broadcom Corporation"},
377 {0x0010, "Mitel Semiconductor"},
378 {0x0011, "Widcomm, Inc."},
379 {0x0012, "Zeevo, Inc."},
380 {0x0013, "Atmel Corporation"},
381 {0x0014, "Mitsubishi Electric Corporation"},
382 {0x0015, "RTX Telecom A/S"},
383 {0x0016, "KC Technology Inc."},
384 {0x0017, "Newlogic"},
385 {0x0018, "Transilica, Inc."},
386 {0x0019, "Rohde & Schwarz GmbH & Co. KG"},
387 {0x001a, "TTPCom Limited"},
388 {0x001b, "Signia Technologies, Inc."},
389 {0x001c, "Conexant Systems Inc."},
390 {0x001d, "Qualcomm"},
391 {0x001e, "Inventel"},
392 {0x001f, "AVM Berlin"},
393 {0x0020, "BandSpeed, Inc."},
394 {0x0021, "Mansella Ltd"},
395 {0x0022, "NEC Corporation"},
396 {0x0023, "WavePlus Technology Co., Ltd"},
398 {0x0025, "Philips Semiconductors"},
399 {0x0026, "C Technologies"},
400 {0x0027, "Open Interface"},
401 {0x0028, "RF Micro Devices"},
402 {0x0029, "Hitachi Ltd"},
403 {0x002a, "Symbol Technologies, Inc."},
405 {0x002c, "Macronix International Co. Ltd."},
406 {0x002d, "GCT Semiconductor"},
407 {0x002e, "Norwood Systems"},
408 {0x002f, "MewTel Technology Inc."},
409 {0x0030, "ST Microelectronics"},
410 {0x0031, "Synopsys"},
411 {0x0032, "Red-M (Communications) Ltd"},
412 {0x0033, "Commil Ltd"},
413 {0x0034, "Computer Access Technology Corporation (CATC)"},
414 {0x0035, "Eclipse (HQ Espana) S.L."},
415 {0x0036, "Renesas Technology Corp."},
416 {0x0037, "Mobilian Corporation"},
418 {0x0039, "Integrated System Solution Corp."},
419 {0x003a, "Matsushita Electric Industrial Co. Ltd."},
420 {0x003b, "Gennum Corporation"},
421 {0x003c, "Research In Motion"},
422 {0x003d, "IPextreme, Inc."},
423 {0x003e, "Systems and Chips, Inc"},
424 {0x003f, "Bluetooth SIG, Inc"},
425 {0x0040, "Seiko Epson Corporation"},
426 {0x0041, "Integrated Silicon Solution Taiwan, Inc."},
427 {0x0042, "CONWISE Technology Corporation Ltd"},
428 {0x0043, "PARROT SA"},
429 {0x0044, "Socket Communications"},
430 {0x0045, "Atheros Communications Inc."},
431 {0x0046, "MediaTek, Inc."},
432 {0x0047, "Bluegiga"},
433 {0x0048, "Marvell Technology Group Ltd."},
434 {0x0049, "3DSP Corporation"},
435 {0x004a, "Accel Semiconductor Ltd."},
436 {0xFFFF, "For use in internal and interoperability tests."},
440 static const value_string evt_service_types[] = {
441 {0x00, "No Traffic Available"},
442 {0x01, "Best Effort Available"},
443 {0x02, "Guaranteed Available"},
447 static const value_string evt_role_vals[] = {
448 {0x00, "Currently the Master for specified BD_ADDR"},
449 {0x01, "Currently the Slave for specified BD_ADDR"},
453 static const value_string evt_role_vals_handle[] = {
454 {0x00, "Currently the Master for this connection handle"},
455 {0x01, "Currently the Slave for this connection handle"},
459 static const value_string evt_modes[] = {
460 {0x00, "Active Mode"},
462 {0x02, "Sniff Mode"},
467 static const value_string evt_key_types[] = {
468 {0x00, "Combination Key"},
469 {0x01, "Local Unit Key"},
470 {0x02, "Remote Unit Key"},
471 {0x03, "Debug Combination Key"},
472 {0x04, "Unauthenticated Combination Key"},
473 {0x05, "Authenticated Combination Key"},
474 {0x06, "Changed Combination Key"},
478 static const value_string evt_page_scan_modes[] = {
479 {0x00, "Mandatory Page Scan Mode"},
480 {0x01, "Optional Page Scan Mode I"},
481 {0x02, "Optional Page Scan Mode II"},
482 {0x03, "Optional Page Scan Mode III"},
486 static const value_string evt_page_scan_repetition_modes[] = {
493 static const value_string evt_page_scan_period_modes[] = {
500 static const value_string evt_scan_types[] = {
501 {0x00, "Standard Scan" },
502 {0x01, "Interlaced Scan" },
506 static const value_string evt_inq_modes[] = {
507 {0x00, "Standard Results" },
508 {0x01, "Results With RSSI" },
509 {0x02, "Results With RSSI or Extended Results" },
513 static const value_string evt_power_level_types[] = {
514 {0x00, "Read Current Transmission Power Level" },
515 {0x01, "Read Maximum Transmission Power Level" },
519 static const value_string evt_boolean[] = {
525 static const value_string evt_pin_types[] = {
526 {0x00, "Variable PIN" },
527 {0x01, "Fixed PIN" },
531 static const value_string evt_scan_enable_values[] = {
532 {0x00, "No Scans enabled" },
533 {0x01, "Inquiry Scan enabled/Page Scan disable" },
534 {0x02, "Inquiry Scan disabled/Page Scan enabled" },
535 {0x03, "Inquiry Scan enabled/Page Scan enabled" },
539 static const value_string evt_auth_enable_values[] = {
541 {0x01, "Enabled for all connections "},
545 static const value_string evt_enable_values[] = {
551 static const value_string evt_input_coding_values[] = {
558 static const value_string evt_input_data_format_values[] = {
559 {0x0, "1's complement" },
560 {0x1, "2's complement" },
561 {0x2, "Sign-Magnitude" },
565 static const value_string evt_input_sample_size_values[] = {
566 {0x0, "8 bit (only for Linear PCM)" },
567 {0x1, "16 bit (only for Linear PCM)" },
571 static const value_string evt_loopback_modes[] = {
572 {0x00, "No Loopback mode enabled" },
573 {0x01, "Enable Local Loopback" },
574 {0x02, "Enable Remote Loopback" },
578 static const value_string evt_country_code_values[] = {
579 {0x0, "North America & Europe (except France) and Japan" },
584 static const value_string evt_air_mode_values[] = {
588 {0x3, "Transparent" },
592 static const value_string evt_flow_direction_values[] = {
593 {0x0, "Outgoing Traffic" },
594 {0x1, "Incoming Traffic" },
598 static const value_string evt_notification_type_vals[] = {
599 {0x0, "Passkey Entry Started" },
600 {0x1, "Passkey Digit Entered" },
601 {0x2, "Passkey Digit Erased" },
602 {0x3, "Passkey Cleared" },
603 {0x4, "Passkey Entry Completed" },
608 dissect_bthci_evt_bd_addr(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
610 guint8 i, bd_addr[6];
611 proto_item *handle_item;
614 bd_addr[6-i] = tvb_get_guint8(tvb, offset+i-1);
616 handle_item = proto_tree_add_item(tree, hf_bthci_evt_bd_addr, tvb, offset, 6, TRUE);
617 proto_item_append_text(handle_item, "%02x%02x:%02x:%02x%02x%02x (%s)",
618 bd_addr[0], bd_addr[1], bd_addr[2], bd_addr[3], bd_addr[4], bd_addr[5],
619 get_ether_name(bd_addr));
627 dissect_bthci_evt_cod(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
632 item = proto_tree_add_item(tree, hf_bthci_evt_class_of_device, tvb, offset, 3, TRUE);
634 cod1 = tvb_get_guint8(tvb, offset+1);
635 cod2 = tvb_get_guint8(tvb, offset+2);
637 if( (cod2 != 0) || (cod1 & 0x20) )
643 proto_item_append_text(item, " (%s - services:", val_to_str(cod1 & 0x1f, bthci_cmd_major_dev_class_vals, "???"));
644 if (cod2 & 0x80) g_strlcat(buf, " Information,", sizeof(buf));
645 if (cod2 & 0x40) g_strlcat(buf, " Telephony,", sizeof(buf));
646 if (cod2 & 0x20) g_strlcat(buf, " Audio,", sizeof(buf));
647 if (cod2 & 0x10) g_strlcat(buf, " Object transfer,", sizeof(buf));
648 if (cod2 & 0x08) g_strlcat(buf, " Capturing,", sizeof(buf));
649 if (cod2 & 0x04) g_strlcat(buf, " Rendering,", sizeof(buf));
650 if (cod2 & 0x02) g_strlcat(buf, " Networking,", sizeof(buf));
651 if (cod2 & 0x01) g_strlcat(buf, " Positioning,", sizeof(buf));
652 if (cod1 & 0x20) g_strlcat(buf, " Limited discoverable mode,", sizeof(buf));
654 buf[strlen(buf)-1] = 0; /* skip last comma */
656 g_strlcat(buf, ")", sizeof(buf));
657 proto_item_append_text(item, "%s", buf);
661 proto_item_append_text(item, " (%s - no major services)", val_to_str(cod1 & 0x1f, bthci_cmd_major_dev_class_vals, "???"));
668 dissect_bthci_evt_inq_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
670 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
677 dissect_bthci_evt_conn_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
679 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
682 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
685 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree);
687 proto_tree_add_item(tree, hf_bthci_evt_link_type, tvb, offset, 1, TRUE);
690 proto_tree_add_item(tree, hf_bthci_evt_encryption_mode, tvb, offset, 1, TRUE);
697 dissect_bthci_evt_conn_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
699 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree);
701 offset = dissect_bthci_evt_cod(tvb, offset, pinfo, tree);
703 proto_tree_add_item(tree, hf_bthci_evt_link_type, tvb, offset, 1, TRUE);
710 dissect_bthci_evt_disconn_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
712 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
715 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
718 proto_tree_add_item(tree, hf_bthci_evt_reason, tvb, offset, 1, TRUE);
725 dissect_bthci_evt_auth_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
727 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
730 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
737 dissect_bthci_evt_lmp_features(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
741 proto_item *ti_lmp_features=NULL;
742 proto_item *ti_lmp_subtree=NULL;
745 ti_lmp_features=proto_tree_add_text(tree, tvb, offset, 8, "LMP_Features");
746 ti_lmp_subtree=proto_item_add_subtree(ti_lmp_features, ett_lmp_subtree);
749 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_00, tvb, offset, 1, TRUE);
750 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_01, tvb, offset, 1, TRUE);
751 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_02, tvb, offset, 1, TRUE);
752 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_03, tvb, offset, 1, TRUE);
753 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_04, tvb, offset, 1, TRUE);
754 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_05, tvb, offset, 1, TRUE);
755 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_06, tvb, offset, 1, TRUE);
756 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_07, tvb, offset, 1, TRUE);
759 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_10, tvb, offset, 1, TRUE);
760 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_11, tvb, offset, 1, TRUE);
761 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_12, tvb, offset, 1, TRUE);
762 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_13, tvb, offset, 1, TRUE);
763 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_14, tvb, offset, 1, TRUE);
764 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_15, tvb, offset, 1, TRUE);
765 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_16, tvb, offset, 1, TRUE);
766 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_17, tvb, offset, 1, TRUE);
769 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_20, tvb, offset, 1, TRUE);
770 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_21, tvb, offset, 1, TRUE);
771 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_22, tvb, offset, 1, TRUE);
772 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_23, tvb, offset, 1, TRUE);
773 item = proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_24, tvb, offset, 1, TRUE);
774 fc_lag = (tvb_get_guint8(tvb, offset) & 0x70)>>4;
775 proto_item_append_text(item, " (%i bytes)", 256*fc_lag);
777 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_27, tvb, offset, 1, TRUE);
780 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_31, tvb, offset, 1, TRUE);
781 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_32, tvb, offset, 1, TRUE);
782 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_33, tvb, offset, 1, TRUE);
783 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_34, tvb, offset, 1, TRUE);
784 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_35, tvb, offset, 1, TRUE);
785 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_36, tvb, offset, 1, TRUE);
786 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_37, tvb, offset, 1, TRUE);
789 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_40, tvb, offset, 1, TRUE);
790 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_41, tvb, offset, 1, TRUE);
791 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_43, tvb, offset, 1, TRUE);
792 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_44, tvb, offset, 1, TRUE);
793 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_47, tvb, offset, 1, TRUE);
796 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_50, tvb, offset, 1, TRUE);
797 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_51, tvb, offset, 1, TRUE);
798 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_52, tvb, offset, 1, TRUE);
799 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_53, tvb, offset, 1, TRUE);
800 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_54, tvb, offset, 1, TRUE);
801 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_55, tvb, offset, 1, TRUE);
802 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_56, tvb, offset, 1, TRUE);
803 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_57, tvb, offset, 1, TRUE);
806 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_60, tvb, offset, 1, TRUE);
807 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_63, tvb, offset, 1, TRUE);
808 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_64, tvb, offset, 1, TRUE);
809 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_65, tvb, offset, 1, TRUE);
810 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_66, tvb, offset, 1, TRUE);
813 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_70, tvb, offset, 1, TRUE);
814 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_71, tvb, offset, 1, TRUE);
815 proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_77, tvb, offset, 1, TRUE);
822 dissect_bthci_evt_pin_code_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
824 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree);
830 dissect_bthci_evt_link_key_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
832 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree);
838 dissect_bthci_evt_link_key_notification(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
840 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree);
842 proto_tree_add_item(tree, hf_bthci_evt_link_key, tvb, offset, 16, TRUE);
845 proto_tree_add_item(tree, hf_bthci_evt_key_type, tvb, offset, 1, TRUE);
852 dissect_bthci_evt_return_link_keys(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
856 evt_num_keys = tvb_get_guint8(tvb, offset);
857 proto_tree_add_item(tree, hf_bthci_evt_num_keys, tvb, offset, 1, TRUE);
860 while(evt_num_keys--){
861 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree);
863 proto_tree_add_item(tree, hf_bthci_evt_link_key, tvb, offset, 16, TRUE);
872 dissect_bthci_evt_read_remote_support_features_complete(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
874 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
877 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
880 offset=dissect_bthci_evt_lmp_features(tvb, offset, pinfo,tree);
886 dissect_bthci_evt_remote_name_req_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
888 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
891 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree);
893 proto_tree_add_item(tree, hf_bthci_evt_remote_name, tvb, offset, 248, FALSE);
900 dissect_bthci_evt_read_remote_version_information_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
902 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
905 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
908 proto_tree_add_item(tree, hf_bthci_evt_vers_nr, tvb, offset, 1, TRUE);
911 proto_tree_add_item(tree, hf_bthci_evt_comp_id, tvb, offset, 2, TRUE);
914 proto_tree_add_item(tree, hf_bthci_evt_sub_vers_nr, tvb, offset, 2, TRUE);
921 dissect_bthci_evt_flush_occured(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
923 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
930 dissect_bthci_evt_number_of_completed_packets(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
932 guint8 evt_num_handles;
934 evt_num_handles = tvb_get_guint8(tvb, offset);
935 proto_tree_add_item(tree, hf_bthci_evt_num_handles, tvb, offset, 1, TRUE);
938 while(evt_num_handles--){
939 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
942 proto_tree_add_item(tree, hf_bthci_evt_num_compl_packets, tvb, offset, 2, TRUE);
951 dissect_bthci_evt_mode_change(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
953 proto_item *handle_item;
955 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
958 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
961 proto_tree_add_item(tree, hf_bthci_evt_curr_mode, tvb, offset, 1, TRUE);
964 handle_item = proto_tree_add_item(tree, hf_bthci_evt_interval, tvb, offset, 2, TRUE);
965 proto_item_append_text(handle_item, " Baseband slots (%f msec)", tvb_get_letohs(tvb, offset)*0.625);
972 dissect_bthci_evt_role_change(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
974 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
977 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree);
979 proto_tree_add_item(tree, hf_bthci_evt_role, tvb, offset, 1, TRUE);
986 dissect_bthci_evt_hardware_error(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
988 proto_tree_add_item(tree, hf_bthci_evt_hardware_code, tvb, offset, 1, TRUE);
995 dissect_bthci_evt_loopback_command(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
999 next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), -1);
1000 if(bthci_com_handle){
1001 call_dissector(bthci_com_handle, next_tvb, pinfo, tree);
1003 offset+=tvb_length_remaining(tvb, offset);
1009 dissect_bthci_evt_data_buffer_overflow(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1011 proto_tree_add_item(tree, hf_bthci_evt_link_type, tvb, offset, 1, TRUE);
1018 dissect_bthci_evt_read_clock_offset_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1020 proto_item *handle_item;
1023 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1026 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
1029 handle_item = proto_tree_add_item(tree, hf_bthci_evt_clock_offset, tvb, offset, 2, TRUE);
1030 clk=tvb_get_letohs(tvb, offset) & 32767; /* only bit0-14 are valid */
1031 proto_item_append_text(handle_item, " (%g ms)", 1.25*clk);
1038 dissect_bthci_evt_max_slots_change(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1040 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
1043 proto_tree_add_item(tree, hf_bthci_evt_max_slots, tvb, offset, 1, TRUE);
1050 dissect_bthci_evt_qos_violation(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1052 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
1059 dissect_bthci_evt_conn_packet_type_changed(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1062 proto_tree *handle_tree=NULL;
1063 proto_item *ti_ptype_subtree=NULL;
1065 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1068 flags=tvb_get_letohs(tvb, offset);
1069 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
1072 handle_tree = proto_tree_add_text(tree, tvb, offset, 2, "Usable packet types: ");
1073 ti_ptype_subtree = proto_item_add_subtree(handle_tree, ett_ptype_subtree);
1076 proto_item_append_text(handle_tree, "DM1 ");
1078 proto_item_append_text(handle_tree, "DH1 ");
1080 proto_item_append_text(handle_tree, "DM3 ");
1082 proto_item_append_text(handle_tree, "DH3 ");
1084 proto_item_append_text(handle_tree, "DM5 ");
1086 proto_item_append_text(handle_tree, "DH5 ");
1088 proto_item_append_text(handle_tree, "HV1 ");
1090 proto_item_append_text(handle_tree, "HV2 ");
1092 proto_item_append_text(handle_tree, "HV3 ");
1094 proto_item_append_text(handle_tree, "2-DH1 ");
1096 proto_item_append_text(handle_tree, "3-DH1 ");
1098 proto_item_append_text(handle_tree, "2-DH3 ");
1100 proto_item_append_text(handle_tree, "3-DH3 ");
1102 proto_item_append_text(handle_tree, "2-DH5 ");
1104 proto_item_append_text(handle_tree, "3-DH5 ");
1106 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_2dh1, tvb, offset, 2, TRUE);
1107 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_3dh1, tvb, offset, 2, TRUE);
1108 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_dm1, tvb, offset, 2, TRUE);
1109 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_dh1, tvb, offset, 2, TRUE);
1110 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_2dh3, tvb, offset, 2, TRUE);
1111 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_3dh3, tvb, offset, 2, TRUE);
1112 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_dm3, tvb, offset, 2, TRUE);
1113 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_dh3, tvb, offset, 2, TRUE);
1114 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_2dh5, tvb, offset, 2, TRUE);
1115 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_3dh5, tvb, offset, 2, TRUE);
1116 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_dm5, tvb, offset, 2, TRUE);
1117 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_dh5, tvb, offset, 2, TRUE);
1118 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_hv1, tvb, offset, 2, TRUE);
1119 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_hv2, tvb, offset, 2, TRUE);
1120 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_hv3, tvb, offset, 2, TRUE);
1127 dissect_bthci_evt_command_status(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1131 status_code = tvb_get_guint8(tvb, offset);
1133 if( status_code != 0) {
1134 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1137 proto_tree_add_item(tree, hf_bthci_evt_status_pending, tvb, offset, 1, TRUE);
1141 proto_tree_add_item(tree, hf_bthci_evt_num_command_packets, tvb, offset, 1, TRUE);
1144 proto_tree_add_item(tree, hf_bthci_evt_com_opcode, tvb, offset, 2, TRUE);
1151 dissect_bthci_evt_page_scan_mode_change(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1153 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree);
1155 proto_tree_add_item(tree, hf_bthci_evt_page_scan_mode, tvb, offset, 1, TRUE);
1162 dissect_bthci_evt_page_scan_repetition_mode_change(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1164 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree);
1166 proto_tree_add_item(tree, hf_bthci_evt_page_scan_repetition_mode, tvb, offset, 1, TRUE);
1173 dissect_bthci_evt_inq_result_with_rssi(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1175 guint8 num, evt_num_responses;
1177 evt_num_responses = tvb_get_guint8(tvb, offset);
1178 proto_tree_add_item(tree, hf_bthci_evt_num_responses, tvb, offset, 1, TRUE);
1181 for(num=0;num<evt_num_responses;num++){
1182 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree);
1184 proto_tree_add_item(tree, hf_bthci_evt_page_scan_repetition_mode, tvb, offset, 1, TRUE);
1190 offset = dissect_bthci_evt_cod(tvb, offset, pinfo, tree);
1192 proto_tree_add_item(tree, hf_bthci_evt_clock_offset, tvb, offset, 2, TRUE);
1195 proto_tree_add_item(tree, hf_bthci_evt_rssi, tvb, offset, 1, TRUE);
1204 dissect_bthci_evt_ext_inquiry_response(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1206 guint8 i, j, length, type;
1207 proto_item *ti_eir=NULL;
1208 proto_item *ti_eir_subtree=NULL;
1211 ti_eir=proto_tree_add_text(tree, tvb, offset, 240, "Extended Inquiry Response Data");
1212 ti_eir_subtree=proto_item_add_subtree(ti_eir, ett_eir_subtree);
1217 length = tvb_get_guint8(tvb, offset+i);
1220 proto_item *ti_eir_struct=NULL;
1221 proto_tree *ti_eir_struct_subtree=NULL;
1223 ti_eir_struct = proto_tree_add_text(ti_eir_subtree, tvb, offset+i, length+1, "%s", "");
1224 ti_eir_struct_subtree = proto_item_add_subtree(ti_eir_struct, ett_eir_struct_subtree);
1226 type = tvb_get_guint8(tvb, offset+i+1);
1228 proto_item_append_text(ti_eir_struct,"%s", val_to_str(type, bthci_cmd_eir_data_type_vals, "Unknown"));
1230 proto_tree_add_item(ti_eir_struct_subtree,hf_bthci_evt_eir_struct_length, tvb, offset+i, 1, TRUE);
1231 proto_tree_add_item(ti_eir_struct_subtree,hf_bthci_evt_eir_struct_type, tvb, offset+i+1, 1, TRUE);
1234 case 0x02: /* 16-bit Service Class UUIDs, incomplete list */
1235 case 0x03: /* 16-bit Service Class UUIDs, complete list */
1239 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_sc_uuid16, tvb, offset+i+j+2, 2, TRUE);
1243 case 0x04: /* 32-bit Service Class UUIDs, incomplete list */
1244 case 0x05: /* 32-bit Service Class UUIDs, complete list */
1248 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_sc_uuid32, tvb, offset+i+j+2, 4, TRUE);
1252 case 0x06: /* 128-bit Service Class UUIDs, incomplete list */
1253 case 0x07: /* 128-bit Service Class UUIDs, complete list */
1257 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_sc_uuid128, tvb, offset+i+j+2, 16, TRUE);
1261 case 0x08: /* Device Name, shortened */
1262 case 0x09: /* Device Name, full */
1263 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_device_name, tvb, offset+i+2, length-1, TRUE);
1264 proto_item_append_text(ti_eir_struct,": %s", tvb_format_text(tvb,offset+i+2,length-1));
1266 case 0x0A: /* Tx Power Level */
1267 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_transmit_power_level, tvb, offset+i+2, 1, TRUE);
1270 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_eir_data, tvb, offset+i+2, length-1, TRUE);
1284 dissect_bthci_evt_io_capability_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1286 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree);
1292 dissect_bthci_evt_io_capability_response(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1294 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree);
1296 proto_tree_add_item(tree, hf_bthci_evt_io_capability, tvb, offset, 1, TRUE);
1299 proto_tree_add_item(tree, hf_bthci_evt_oob_data_present, tvb, offset, 1, TRUE);
1302 proto_tree_add_item(tree, hf_bthci_evt_auth_requirements, tvb, offset, 1, TRUE);
1309 dissect_bthci_evt_user_confirmation_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1311 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree);
1313 proto_tree_add_item(tree, hf_bthci_evt_numeric_value, tvb, offset, 4, TRUE);
1320 dissect_bthci_evt_user_passkey_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1322 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree);
1328 dissect_bthci_evt_remote_oob_data_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1330 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree);
1336 dissect_bthci_evt_simple_pairing_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1338 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1341 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree);
1347 dissect_bthci_evt_user_passkey_notification(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1349 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree);
1351 proto_tree_add_item(tree, hf_bthci_evt_passkey, tvb, offset, 4, TRUE);
1358 dissect_bthci_evt_keypress_notification(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1360 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree);
1362 proto_tree_add_item(tree, hf_bthci_evt_notification_type, tvb, offset, 1, TRUE);
1369 dissect_bthci_evt_remote_host_sup_feat_notification(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1371 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree);
1373 proto_tree_add_item(tree, hf_bthci_evt_ext_lmp_features, tvb, offset, 8, TRUE);
1380 dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1382 proto_item *ti_opcode=NULL;
1383 proto_tree *opcode_tree=NULL;
1390 proto_tree_add_item(tree, hf_bthci_evt_num_command_packets, tvb, offset, 1, TRUE);
1393 com_opcode = tvb_get_letohs(tvb, offset);
1394 ti_opcode = proto_tree_add_item(tree, hf_bthci_evt_com_opcode, tvb, offset, 2, TRUE);
1395 opcode_tree = proto_item_add_subtree(ti_opcode, ett_opcode);
1396 proto_tree_add_item(opcode_tree, hf_bthci_evt_ogf, tvb, offset, 2, TRUE);
1397 proto_tree_add_item(opcode_tree, hf_bthci_evt_ocf, tvb, offset, 2, TRUE);
1401 switch(com_opcode) {
1402 /* This is a list of Commands that all return just the status */
1403 case 0x0402: /* Inquiry Cancel */
1404 case 0x0403: /* Periodic Inquiry Mode */
1405 case 0x0404: /* Exit Periodic Enquiry Mode */
1406 case 0x080f: /* Write Default Link Policy Settings */
1407 case 0x0c01: /* Set Event Mask */
1408 case 0x0c03: /* Reset */
1409 case 0x0c05: /* Set Event Filter */
1410 case 0x0c0a: /* Write PIN Type */
1411 case 0x0c0b: /* Create Unit Key */
1412 case 0x0c13: /* Change Local Name */
1413 case 0x0c16: /* Write Connection Accept Timeout */
1414 case 0x0c18: /* Write Page Timeout */
1415 case 0x0c1a: /* Write Scan Enable */
1416 case 0x0c1c: /* Write Page Scan Activity */
1417 case 0x0c1e: /* Write Inquiry Scan Activity */
1418 case 0x0c20: /* Write Authentication Enable */
1419 case 0x0c22: /* Write Encryption Mode */
1420 case 0x0c24: /* Write Class of Device */
1421 case 0x0c26: /* Write Voice Setting */
1422 case 0x0c2a: /* Write Num Broadcast Retransmissions */
1423 case 0x0c2c: /* Write Hold Mode Activity */
1424 case 0x0c2f: /* Write SCO Flow Control Enable */
1425 case 0x0c31: /* Set Host Controller To Host Flow Control */
1426 case 0x0c33: /* Host Buffer Size */
1427 case 0x0c3a: /* Write Current IAC LAP */
1428 case 0x0c3c: /* Write Page Scan Period Mode */
1429 case 0x0c3e: /* Write Page Scan Mode */
1430 case 0x0c3f: /* Set AFH Host Channel Classification */
1431 case 0x0c43: /* Write Inquiry Scan Type */
1432 case 0x0c45: /* Write Inquiry Mode */
1433 case 0x0c47: /* Write Page Scan Type */
1434 case 0x0c49: /* Write AFH Channel Assessment Mode */
1435 case 0x0c52: /* Write Extended Inquiry Response */
1436 case 0x0c53: /* Refresh Encryption Key */
1437 case 0x0c56: /* Write Simple Pairing Mode */
1438 case 0x0c59: /* Write Inquiry Tx Power Level */
1439 case 0x0c5b: /* Write Default Erroneous Data Reporting */
1440 case 0x0c60: /* Send Keypress Notification */
1441 case 0x1802: /* Write Loopback Mode */
1442 case 0x1803: /* Enable Device Under Test Mode */
1443 case 0x1804: /* Write Simple Pairing Debug Mode */
1444 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1448 /* This is a list of Commands that all return status and BD_ADDR */
1449 case 0x0408: /* Create Connection Cancel */
1450 case 0x040b: /* Link Key Request Reply */
1451 case 0x040c: /* Link Key Request Negative Reply */
1452 case 0x040d: /* PIN Code Request Reply */
1453 case 0x040e: /* PIN Code Request Negative Reply */
1454 case 0x041a: /* Remote Name Request Cancel */
1455 case 0x042b: /* IO Capability Response */
1456 case 0x042c: /* User Confirmation Request Reply */
1457 case 0x042d: /* User Confirmation Request Negative Reply */
1458 case 0x042e: /* User Passkey Request Reply */
1459 case 0x042f: /* User Passkey Request Negative Reply */
1460 case 0x0430: /* Remote OOB Data Request Reply */
1461 case 0x0433: /* Remote OOB Data Request Negative Reply */
1462 case 0x1009: /* Read BD_ADDR */
1463 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1466 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree);
1470 /* This is a list of Commands that all return status and connection_handle */
1471 case 0x080d: /* Write Link Policy Settings */
1472 case 0x0811: /* Sniff Subrating */
1473 case 0x0c08: /* Flush */
1474 case 0x0c28: /* Write Automatic Flush Timeout */
1475 case 0x0c37: /* Write Link Supervision Timeout */
1476 case 0x0c5f: /* Enhanced Flush */
1477 case 0x1402: /* Reset Failed Contact Counter */
1478 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1481 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
1486 /* This is a list of Commands that all return status and timeout */
1487 case 0x0c15: /* Read Connection Accept Timeout */
1488 case 0x0c17: /* Read Page Timeout */
1489 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1492 timeout = tvb_get_letohs(tvb, offset);
1493 item = proto_tree_add_item(tree, hf_bthci_evt_timeout, tvb, offset, 2, TRUE);
1494 proto_item_append_text(item, " slots (%g msec)", timeout*0.625);
1499 /* This is a list of Commands that all return status, connection handle and timeout */
1500 case 0x0c27: /* Read Automatic Flush Timeout */
1501 case 0x0c36: /* Read Link Supervision Timeout */
1502 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1505 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
1508 timeout = tvb_get_letohs(tvb, offset);
1509 item = proto_tree_add_item(tree, hf_bthci_evt_timeout, tvb, offset, 2, TRUE);
1510 proto_item_append_text(item, " slots (%g msec)", timeout*0.625);
1515 /* This is a list of Commands that all return status, interval and window */
1516 case 0x0c1b: /* Read Page Scan Activity */
1517 case 0x0c1d: /* Read Inquiry Scan Activity */
1518 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1521 proto_tree_add_item(tree, hf_bthci_evt_interval, tvb, offset, 2, TRUE);
1524 proto_tree_add_item(tree, hf_bthci_evt_window, tvb, offset, 2, TRUE);
1529 case 0x0420: /* Read LMP Handle */
1530 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1533 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
1536 proto_tree_add_item(tree, hf_bthci_evt_lmp_handle, tvb, offset, 1, TRUE);
1539 /* 4 reserved bytes */
1543 case 0x0809: /* Role Discovery */
1544 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1547 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
1550 proto_tree_add_item(tree, hf_bthci_evt_curr_role, tvb, offset, 1, TRUE);
1555 case 0x080c: /* Read Link Policy Settings */
1556 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1559 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
1562 proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_switch, tvb, offset, 2, TRUE);
1563 proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_hold , tvb, offset, 2, TRUE);
1564 proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_sniff , tvb, offset, 2, TRUE);
1565 proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_park , tvb, offset, 2, TRUE);
1570 case 0x080e: /* Read Default Link Policy Settings */
1571 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1574 proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_switch, tvb, offset, 2, TRUE);
1575 proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_hold , tvb, offset, 2, TRUE);
1576 proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_sniff , tvb, offset, 2, TRUE);
1577 proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_park , tvb, offset, 2, TRUE);
1582 case 0x0c09: /* Read PIN Type */
1583 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1586 proto_tree_add_item(tree, hf_bthci_evt_pin_type, tvb, offset, 1, TRUE);
1591 case 0x0c0d: /* Read Stored Link Key */
1592 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1595 proto_tree_add_item(tree, hf_bthci_evt_max_num_keys, tvb, offset, 2, TRUE);
1598 proto_tree_add_item(tree, hf_bthci_evt_num_keys_read, tvb, offset, 2, TRUE);
1603 case 0x0c11: /* Write Stored Link Key */
1604 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1607 proto_tree_add_item(tree, hf_bthci_evt_num_keys_written, tvb, offset, 1, TRUE);
1612 case 0x0c12: /* Delete Stored Link Key */
1613 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1616 proto_tree_add_item(tree, hf_bthci_evt_num_keys_deleted, tvb, offset, 2, TRUE);
1621 case 0x0c14: /* Read Local Name */
1622 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1625 proto_tree_add_item(tree, hf_bthci_evt_device_name, tvb, offset, 248, FALSE);
1630 case 0x0c19: /* Read Scan Enable */
1631 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1634 proto_tree_add_item(tree, hf_bthci_evt_scan_enable, tvb, offset, 1, TRUE);
1639 case 0x0c1f: /* Read Authentication Enable */
1640 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1643 proto_tree_add_item(tree, hf_bthci_evt_authentication_enable, tvb, offset, 1, TRUE);
1648 case 0x0c21: /* Read Encryption Mode */
1649 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1652 proto_tree_add_item(tree, hf_bthci_evt_encryption_mode, tvb, offset, 1, TRUE);
1657 case 0x0c23: /* Read Class of Device */
1658 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1661 offset = dissect_bthci_evt_cod(tvb, offset, pinfo, tree);
1665 case 0x0c25: /* Read Voice Setting */
1666 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1669 proto_tree_add_item(tree, hf_bthci_evt_input_coding, tvb, offset, 2, TRUE);
1670 proto_tree_add_item(tree, hf_bthci_evt_input_data_format, tvb, offset, 2, TRUE);
1671 proto_tree_add_item(tree, hf_bthci_evt_input_sample_size, tvb, offset, 2, TRUE);
1676 case 0x0c29: /* Read Num Broadcast Retransmissions */
1677 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1680 proto_tree_add_item(tree, hf_bthci_evt_num_broadcast_retransm, tvb, offset, 1, TRUE);
1685 case 0x0c2b: /* Read Hold Mode Activity */
1686 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1689 proto_tree_add_item(tree, hf_bthci_evt_hold_mode_act_page, tvb, offset, 1, TRUE);
1690 proto_tree_add_item(tree, hf_bthci_evt_hold_mode_act_inquiry, tvb, offset, 1, TRUE);
1691 proto_tree_add_item(tree, hf_bthci_evt_hold_mode_act_periodic, tvb, offset, 1, TRUE);
1696 case 0x0c2d: /* Read Transmit Power Level */
1697 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1700 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
1703 proto_tree_add_item(tree, hf_bthci_evt_transmit_power_level, tvb, offset, 1, TRUE);
1708 case 0x0c2e: /* Read SCO Flow Control Enable */
1709 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1712 proto_tree_add_item(tree, hf_bthci_evt_sco_flow_cont_enable, tvb, offset, 1, TRUE);
1718 case 0x0c38: /* Read Number of Supported IAC */
1719 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1722 proto_tree_add_item(tree, hf_bthci_evt_num_supp_iac, tvb, offset, 1, TRUE);
1727 case 0x0c39: /* Read Current IAC LAP */
1728 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1731 num8 = tvb_get_guint8(tvb, offset);
1732 proto_tree_add_item(tree, hf_bthci_evt_num_curr_iac, tvb, offset, 1, TRUE);
1735 for (i=0; i<num8; i++) {
1736 proto_tree_add_item(tree, hf_bthci_evt_iac_lap, tvb, offset, 3, TRUE);
1741 case 0x0c3b: /* Read Page Scan Period Mode */
1742 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1745 proto_tree_add_item(tree, hf_bthci_evt_page_scan_period_mode, tvb, offset, 1, TRUE);
1750 case 0x0c3d: /* Read Page Scan Mode */
1751 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1754 proto_tree_add_item(tree, hf_bthci_evt_page_scan_mode, tvb, offset, 1, TRUE);
1759 case 0x0c42: /* Read Inquiry Scan Type */
1760 case 0x0c46: /* Read Page Scan Type */
1761 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1763 proto_tree_add_item(tree, hf_bthci_evt_scan_type, tvb, offset, 1, TRUE);
1767 case 0x0c44: /* Read Inquiry Mode */
1768 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1770 proto_tree_add_item(tree, hf_bthci_evt_inq_mode, tvb, offset, 1, TRUE);
1774 case 0x0c48: /* Read AFH Channel Assessment Mode */
1775 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1777 proto_tree_add_item(tree, hf_bthci_evt_afh_ch_assessment_mode, tvb, offset, 1, TRUE);
1781 case 0x0c51: /* Read Extended Inquiry Response */
1782 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1785 proto_tree_add_item(tree, hf_bthci_evt_fec_required, tvb, offset, 1, TRUE);
1788 offset=dissect_bthci_evt_ext_inquiry_response(tvb, offset, pinfo, tree);
1791 case 0x0c55: /* Read Simple Pairing Mode */
1792 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1795 proto_tree_add_item(tree, hf_bthci_evt_simple_pairing_mode, tvb, offset, 1, TRUE);
1799 case 0x0c57: /* Read Local OOB Data */
1800 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1802 proto_tree_add_item(tree, hf_bthci_evt_hash_c, tvb, offset, 2, TRUE);
1804 proto_tree_add_item(tree, hf_bthci_evt_randomizer_r, tvb, offset, 2, TRUE);
1808 case 0x0c58: /* Read Inquiry Response Tx Power Level */
1809 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1811 proto_tree_add_item(tree, hf_bthci_evt_power_level_type, tvb, offset, 1, TRUE);
1816 case 0x0c5a: /* Read Default Erroneous Data Reporting */
1817 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1820 proto_tree_add_item(tree, hf_bthci_evt_err_data_reporting, tvb, offset, 1, TRUE);
1825 case 0x1001: /* Read Local Version Information */
1826 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1829 proto_tree_add_item(tree, hf_bthci_evt_hci_vers_nr, tvb, offset, 1, TRUE);
1832 proto_tree_add_item(tree, hf_bthci_evt_hci_revision, tvb, offset, 2, TRUE);
1835 proto_tree_add_item(tree, hf_bthci_evt_vers_nr, tvb, offset, 1, TRUE);
1838 proto_tree_add_item(tree, hf_bthci_evt_comp_id, tvb, offset, 2, TRUE);
1841 proto_tree_add_item(tree, hf_bthci_evt_sub_vers_nr, tvb, offset, 2, TRUE);
1846 case 0x1002: /* Read Local Supported Commands */
1847 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1850 proto_tree_add_item(tree, hf_bthci_evt_local_supported_cmds, tvb, offset, 64, TRUE);
1855 case 0x1003: /* Read Local Supported Features */
1856 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1859 offset=dissect_bthci_evt_lmp_features(tvb, offset, pinfo, tree);
1863 case 0x1004: /* Read Local Extended Features */
1867 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1870 page_number = tvb_get_guint8(tvb, offset);
1871 proto_tree_add_item(tree, hf_bthci_evt_page_number, tvb, offset, 1, TRUE);
1874 proto_tree_add_item(tree, hf_bthci_evt_max_page_number, tvb, offset, 1, TRUE);
1877 if( page_number == 0 ){
1878 offset=dissect_bthci_evt_lmp_features(tvb, offset, pinfo, tree);
1881 proto_tree_add_item(tree, hf_bthci_evt_ext_lmp_features, tvb, offset, 8, TRUE);
1888 case 0x1005: /* Read Buffer Size */
1889 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1892 proto_tree_add_item(tree, hf_bthci_evt_host_data_packet_length_acl, tvb, offset, 2, TRUE);
1895 proto_tree_add_item(tree, hf_bthci_evt_host_data_packet_length_sco, tvb, offset, 1, TRUE);
1898 proto_tree_add_item(tree, hf_bthci_evt_host_total_num_acl_data_packets, tvb, offset, 2, TRUE);
1901 proto_tree_add_item(tree, hf_bthci_evt_host_total_num_sco_data_packets, tvb, offset, 2, TRUE);
1906 case 0x1007: /* Read Country Code */
1907 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1910 proto_tree_add_item(tree, hf_bthci_evt_country_code, tvb, offset, 1, TRUE);
1915 case 0x1401: /* Read Failed Contact Counter */
1916 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1919 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
1922 proto_tree_add_item(tree, hf_bthci_evt_failed_contact_counter, tvb, offset, 2, TRUE);
1927 case 0x1403: /* Get Link Quality */
1928 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1931 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
1934 proto_tree_add_item(tree, hf_bthci_evt_link_quality, tvb, offset, 1, TRUE);
1939 case 0x1405: /* Read RSSI */
1940 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1943 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
1946 proto_tree_add_item(tree, hf_bthci_evt_rssi, tvb, offset, 1, TRUE);
1951 case 0x1406: /* Read AFH Channel Map */
1952 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1955 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
1958 proto_tree_add_item(tree, hf_bthci_evt_afh_mode, tvb, offset, 1, TRUE);
1961 proto_tree_add_item(tree, hf_bthci_evt_afh_channel_map, tvb, offset, 10, TRUE);
1966 case 0x1407: /* Read Clock */
1967 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1970 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
1973 proto_tree_add_item(tree, hf_bthci_evt_clock, tvb, offset, 4, TRUE);
1976 accuracy = tvb_get_letohl(tvb, offset);
1977 item = proto_tree_add_item(tree, hf_bthci_evt_clock_accuracy, tvb, offset, 2, TRUE);
1978 proto_item_append_text(item, " %g msec", accuracy*0.3125);
1983 case 0x1801: /* Read Loopback Mode */
1984 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
1987 proto_tree_add_item(tree, hf_bthci_evt_loopback_mode, tvb, offset, 1, TRUE);
1993 proto_tree_add_item(tree, hf_bthci_evt_ret_params, tvb, offset, -1, TRUE);
1994 offset+=tvb_length_remaining(tvb, offset);
2002 dissect_bthci_evt_qos_setup_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2004 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
2007 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
2010 proto_tree_add_item(tree, hf_bthci_evt_flags, tvb, offset, 1, TRUE);
2013 proto_tree_add_item(tree, hf_bthci_evt_service_type, tvb, offset, 1, TRUE);
2016 proto_tree_add_item(tree, hf_bthci_evt_token_rate, tvb, offset, 4, TRUE);
2019 proto_tree_add_item(tree, hf_bthci_evt_peak_bandwidth, tvb, offset, 4, TRUE);
2022 proto_tree_add_item(tree, hf_bthci_evt_latency, tvb, offset, 4, TRUE);
2025 proto_tree_add_item(tree, hf_bthci_evt_delay_variation, tvb, offset, 4, TRUE);
2032 dissect_bthci_evt_change_conn_link_key_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2034 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
2037 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
2044 dissect_bthci_evt_master_link_key_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2046 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
2049 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
2052 proto_tree_add_item(tree, hf_bthci_evt_key_flag, tvb, offset, 1, TRUE);
2059 dissect_bthci_evt_encryption_change(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2061 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
2064 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
2067 proto_tree_add_item(tree, hf_bthci_evt_encryption_enable, tvb, offset, 1, TRUE);
2074 dissect_bthci_evt_read_remote_ext_features_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2078 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
2081 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
2084 page_number = tvb_get_guint8(tvb, offset);
2085 proto_tree_add_item(tree, hf_bthci_evt_page_number, tvb, offset, 1, TRUE);
2088 proto_tree_add_item(tree, hf_bthci_evt_max_page_number, tvb, offset, 1, TRUE);
2091 if( page_number == 0 ){
2092 offset=dissect_bthci_evt_lmp_features(tvb, offset, pinfo, tree);
2095 proto_tree_add_item(tree, hf_bthci_evt_ext_lmp_features, tvb, offset, 8, TRUE);
2103 dissect_bthci_evt_sync_connection_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2107 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
2110 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
2113 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree);
2115 proto_tree_add_item(tree, hf_bthci_evt_sync_link_type, tvb, offset, 1, TRUE);
2118 item = proto_tree_add_item(tree, hf_bthci_evt_sync_tx_interval, tvb, offset, 1, TRUE);
2119 proto_item_append_text(item, " slots (%g msec)", tvb_get_guint8(tvb, offset)*0.625);
2122 item = proto_tree_add_item(tree, hf_bthci_evt_sync_rtx_window, tvb, offset, 1, TRUE);
2123 proto_item_append_text(item, " slots (%g msec)", tvb_get_guint8(tvb, offset)*0.625);
2126 proto_tree_add_item(tree, hf_bthci_evt_sync_rx_packet_length, tvb, offset, 2, TRUE);
2129 proto_tree_add_item(tree, hf_bthci_evt_sync_tx_packet_length, tvb, offset, 2, TRUE);
2132 proto_tree_add_item(tree, hf_bthci_evt_air_mode, tvb, offset, 1, TRUE);
2139 dissect_bthci_evt_sync_connection_changed(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2143 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
2146 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
2149 item = proto_tree_add_item(tree, hf_bthci_evt_sync_tx_interval, tvb, offset, 1, TRUE);
2150 proto_item_append_text(item, " slots (%g msec)", tvb_get_guint8(tvb, offset)*0.625);
2153 item = proto_tree_add_item(tree, hf_bthci_evt_sync_rtx_window, tvb, offset, 1, TRUE);
2154 proto_item_append_text(item, " slots (%g msec)", tvb_get_guint8(tvb, offset)*0.625);
2157 proto_tree_add_item(tree, hf_bthci_evt_sync_rx_packet_length, tvb, offset, 2, TRUE);
2160 proto_tree_add_item(tree, hf_bthci_evt_sync_tx_packet_length, tvb, offset, 2, TRUE);
2167 dissect_bthci_evt_sniff_subrating(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2171 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
2174 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
2177 item = proto_tree_add_item(tree, hf_bthci_evt_max_tx_latency, tvb, offset, 2, TRUE);
2178 proto_item_append_text(item, " slots (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
2181 item = proto_tree_add_item(tree, hf_bthci_evt_max_rx_latency, tvb, offset, 2, TRUE);
2182 proto_item_append_text(item, " slots (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
2185 item = proto_tree_add_item(tree, hf_bthci_evt_min_remote_timeout, tvb, offset, 2, TRUE);
2186 proto_item_append_text(item, " slots (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
2189 item = proto_tree_add_item(tree, hf_bthci_evt_min_local_timeout, tvb, offset, 2, TRUE);
2190 proto_item_append_text(item, " slots (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
2197 dissect_bthci_evt_flow_specification_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2199 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
2202 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
2205 proto_tree_add_item(tree, hf_bthci_evt_flags, tvb, offset, 1, TRUE);
2208 proto_tree_add_item(tree, hf_bthci_evt_flow_direction, tvb, offset, 1, TRUE);
2211 proto_tree_add_item(tree, hf_bthci_evt_service_type, tvb, offset, 1, TRUE);
2214 proto_tree_add_item(tree, hf_bthci_evt_token_rate, tvb, offset, 4, TRUE);
2217 proto_tree_add_item(tree, hf_bthci_evt_token_bucket_size, tvb, offset, 4, TRUE);
2220 proto_tree_add_item(tree, hf_bthci_evt_peak_bandwidth, tvb, offset, 4, TRUE);
2223 proto_tree_add_item(tree, hf_bthci_evt_latency, tvb, offset, 4, TRUE);
2230 dissect_bthci_evt_enhanced_flush_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2232 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
2239 dissect_bthci_evt_encryption_key_refresh_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2241 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, TRUE);
2244 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
2251 dissect_bthci_evt_link_supervision_timeout_changed(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2255 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, TRUE);
2258 item = proto_tree_add_item(tree, hf_bthci_evt_link_supervision_timeout, tvb, offset, 2, TRUE);
2259 proto_item_append_text(item, " slots (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
2266 dissect_bthci_evt_inq_result(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2268 guint8 num, evt_num_responses;
2270 evt_num_responses = tvb_get_guint8(tvb, offset);
2271 proto_tree_add_item(tree, hf_bthci_evt_num_responses, tvb, offset, 1, TRUE);
2274 for(num=0;num<evt_num_responses;num++){
2275 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree);
2277 proto_tree_add_item(tree, hf_bthci_evt_page_scan_repetition_mode, tvb, offset, 1, TRUE);
2280 proto_tree_add_item(tree, hf_bthci_evt_page_scan_period_mode, tvb, offset, 1, TRUE);
2283 proto_tree_add_item(tree, hf_bthci_evt_page_scan_mode, tvb, offset, 1, TRUE);
2286 offset = dissect_bthci_evt_cod(tvb, offset, pinfo, tree);
2288 proto_tree_add_item(tree, hf_bthci_evt_clock_offset, tvb, offset, 2, TRUE);
2296 /* Code to actually dissect the packets */
2298 dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2301 proto_tree *bthci_evt_tree=NULL;
2302 guint8 param_length, evt_code;
2306 ti=proto_tree_add_item(tree, proto_bthci_evt, tvb, offset, -1, FALSE);
2307 bthci_evt_tree=proto_item_add_subtree(ti, ett_bthci_evt);
2310 evt_code = tvb_get_guint8(tvb, offset);
2311 proto_tree_add_item(bthci_evt_tree, hf_bthci_evt_code, tvb, offset, 1, TRUE);
2312 proto_item_append_text(bthci_evt_tree, " - %s", val_to_str(evt_code, evt_code_vals, "Unknown 0x%08x"));
2315 param_length = tvb_get_guint8(tvb, offset);
2316 proto_tree_add_item(bthci_evt_tree, hf_bthci_evt_param_length, tvb, offset, 1, TRUE);
2320 if(check_col(pinfo->cinfo, COL_PROTOCOL)){
2321 col_set_str(pinfo->cinfo, COL_PROTOCOL, "HCI_EVT");
2324 if((check_col(pinfo->cinfo, COL_INFO))){
2325 col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(evt_code, evt_code_vals, "Unknown 0x%08x"));
2329 if (param_length > 0) {
2331 case 0x01: /* Inquiry Complete */
2332 offset=dissect_bthci_evt_inq_complete(tvb, offset, pinfo, bthci_evt_tree);
2335 case 0x02: /* Inquiry result event */
2336 offset=dissect_bthci_evt_inq_result(tvb, offset, pinfo, bthci_evt_tree);
2339 case 0x03: /* Connection Complete */
2340 offset=dissect_bthci_evt_conn_complete(tvb, offset, pinfo, bthci_evt_tree);
2343 case 0x04: /* Connection Request */
2344 offset=dissect_bthci_evt_conn_request(tvb, offset, pinfo, bthci_evt_tree);
2347 case 0x05: /* Disconnection Complete */
2348 offset=dissect_bthci_evt_disconn_complete(tvb, offset, pinfo, bthci_evt_tree);
2351 case 0x06: /* Authentication Complete */
2352 offset=dissect_bthci_evt_auth_complete(tvb, offset, pinfo, bthci_evt_tree);
2355 case 0x07: /* Remote Name Request Complete */
2356 offset=dissect_bthci_evt_remote_name_req_complete(tvb, offset, pinfo, bthci_evt_tree);
2359 case 0x08: /* Encryption Change */
2360 offset=dissect_bthci_evt_encryption_change(tvb, offset, pinfo, bthci_evt_tree);
2363 case 0x09: /* Change Connection Link Key Complete */
2364 offset=dissect_bthci_evt_change_conn_link_key_complete(tvb, offset, pinfo, bthci_evt_tree);
2367 case 0x0a: /* Master Link Key Complete */
2368 offset=dissect_bthci_evt_master_link_key_complete(tvb, offset, pinfo, bthci_evt_tree);
2371 case 0x0b: /* Read Remote Support Features Complete */
2372 offset=dissect_bthci_evt_read_remote_support_features_complete(tvb, offset, pinfo, bthci_evt_tree);
2375 case 0x0c: /* Read Remote Version Information Complete */
2376 offset=dissect_bthci_evt_read_remote_version_information_complete(tvb, offset, pinfo, bthci_evt_tree);
2379 case 0x0d: /* QoS Setup Complete */
2380 offset=dissect_bthci_evt_qos_setup_complete(tvb, offset, pinfo, bthci_evt_tree);
2383 case 0x0e: /* Command Complete */
2384 offset=dissect_bthci_evt_command_complete(tvb, offset, pinfo, bthci_evt_tree);
2387 case 0x0f: /* Command Status */
2388 offset=dissect_bthci_evt_command_status(tvb, offset, pinfo, bthci_evt_tree);
2391 case 0x10: /* Hardware Error */
2392 offset=dissect_bthci_evt_hardware_error(tvb, offset, pinfo, bthci_evt_tree);
2395 case 0x11: /* Flush Occurred */
2396 offset=dissect_bthci_evt_flush_occured(tvb, offset, pinfo, bthci_evt_tree);
2399 case 0x12: /* Role Change */
2400 offset=dissect_bthci_evt_role_change(tvb, offset, pinfo, bthci_evt_tree);
2403 case 0x13: /* Number Of Completed Packets */
2404 offset=dissect_bthci_evt_number_of_completed_packets(tvb, offset, pinfo, bthci_evt_tree);
2407 case 0x14: /* Mode Change */
2408 offset=dissect_bthci_evt_mode_change(tvb, offset, pinfo, bthci_evt_tree);
2411 case 0x15: /* Return Link Keys */
2412 offset=dissect_bthci_evt_return_link_keys(tvb, offset, pinfo, bthci_evt_tree);
2415 case 0x16: /* PIN Code Request */
2416 offset=dissect_bthci_evt_pin_code_request(tvb, offset, pinfo, bthci_evt_tree);
2419 case 0x17: /* Link Key Request */
2420 offset=dissect_bthci_evt_link_key_request(tvb, offset, pinfo, bthci_evt_tree);
2423 case 0x18: /* Link Key Notification */
2424 offset=dissect_bthci_evt_link_key_notification(tvb, offset, pinfo, bthci_evt_tree);
2427 case 0x19: /* Loopback Command */
2428 offset=dissect_bthci_evt_loopback_command(tvb, offset, pinfo, bthci_evt_tree);
2431 case 0x1a: /* Data Buffer Overflow */
2432 offset=dissect_bthci_evt_data_buffer_overflow(tvb, offset, pinfo, bthci_evt_tree);
2435 case 0x1b: /* Max Slots Change */
2436 offset=dissect_bthci_evt_max_slots_change(tvb, offset, pinfo, bthci_evt_tree);
2439 case 0x1c: /* Read Clock Offset Complete */
2440 offset=dissect_bthci_evt_read_clock_offset_complete(tvb, offset, pinfo, bthci_evt_tree);
2443 case 0x1d: /* Connection Packet Type Changed */
2444 offset=dissect_bthci_evt_conn_packet_type_changed(tvb, offset, pinfo, bthci_evt_tree);
2447 case 0x1e: /* QoS Violation */
2448 offset=dissect_bthci_evt_qos_violation(tvb, offset, pinfo, bthci_evt_tree);
2451 case 0x1f: /* Page Scan Mode Change */
2452 offset=dissect_bthci_evt_page_scan_mode_change(tvb, offset, pinfo, bthci_evt_tree);
2455 case 0x20: /* Page Scan Repetition Mode Change */
2456 offset=dissect_bthci_evt_page_scan_repetition_mode_change(tvb, offset, pinfo, bthci_evt_tree);
2459 case 0x21: /* Flow Specification Complete */
2460 offset=dissect_bthci_evt_flow_specification_complete(tvb, offset, pinfo, bthci_evt_tree);
2463 case 0x22: /* Inquiry Result with RSSI */
2464 offset=dissect_bthci_evt_inq_result_with_rssi(tvb, offset, pinfo, bthci_evt_tree);
2467 case 0x23: /* Read Remote Extended Features Complete */
2468 offset=dissect_bthci_evt_read_remote_ext_features_complete(tvb, offset, pinfo, bthci_evt_tree);
2471 case 0x2c: /* Synchronous Connection Complete */
2472 offset=dissect_bthci_evt_sync_connection_complete(tvb, offset, pinfo, bthci_evt_tree);
2475 case 0x2d: /* Synchronous Connection Changed */
2476 offset=dissect_bthci_evt_sync_connection_changed(tvb, offset, pinfo, bthci_evt_tree);
2479 case 0x2e: /* Sniff Subrating */
2480 offset=dissect_bthci_evt_sniff_subrating(tvb, offset, pinfo, bthci_evt_tree);
2483 case 0x2f: /* Extended Inquiry Result */
2484 offset=dissect_bthci_evt_inq_result_with_rssi(tvb, offset, pinfo, bthci_evt_tree);
2485 offset=dissect_bthci_evt_ext_inquiry_response(tvb, offset, pinfo, bthci_evt_tree);
2488 case 0x30: /* Encryption Key Refresh Complete */
2489 offset=dissect_bthci_evt_encryption_key_refresh_complete(tvb, offset, pinfo, bthci_evt_tree);
2492 case 0x31: /* IO Capability Request */
2493 offset=dissect_bthci_evt_io_capability_request(tvb, offset, pinfo, bthci_evt_tree);
2496 case 0x32: /* IO Capability Response */
2497 offset=dissect_bthci_evt_io_capability_response(tvb, offset, pinfo, bthci_evt_tree);
2500 case 0x33: /* User Confirmation Request */
2501 offset=dissect_bthci_evt_user_confirmation_request(tvb, offset, pinfo, bthci_evt_tree);
2504 case 0x34: /* User Passkey Request */
2505 offset=dissect_bthci_evt_user_passkey_request(tvb, offset, pinfo, bthci_evt_tree);
2508 case 0x35: /* Remote OOB Data Request */
2509 offset=dissect_bthci_evt_remote_oob_data_request(tvb, offset, pinfo, bthci_evt_tree);
2512 case 0x36: /* Simple Pairing Complete */
2513 offset=dissect_bthci_evt_simple_pairing_complete(tvb, offset, pinfo, bthci_evt_tree);
2516 case 0x38: /* Link Supervision Timeout Changed */
2517 offset=dissect_bthci_evt_link_supervision_timeout_changed(tvb, offset, pinfo, bthci_evt_tree);
2520 case 0x39: /* Enhanced Flush Complete */
2521 offset=dissect_bthci_evt_enhanced_flush_complete(tvb, offset, pinfo, bthci_evt_tree);
2524 case 0x3b: /* Enhanced Flush Complete */
2525 offset=dissect_bthci_evt_user_passkey_notification(tvb, offset, pinfo, bthci_evt_tree);
2528 case 0x3c: /* Enhanced Flush Complete */
2529 offset=dissect_bthci_evt_keypress_notification(tvb, offset, pinfo, bthci_evt_tree);
2532 case 0x3d: /* Remote Host Supported Features Notification */
2533 offset=dissect_bthci_evt_remote_host_sup_feat_notification(tvb, offset, pinfo, bthci_evt_tree);
2537 proto_tree_add_item(bthci_evt_tree, hf_bthci_evt_params, tvb, 2, -1, TRUE);
2545 /* Register the protocol with Wireshark */
2547 /* this format is require because a script is used to build the C function
2548 that calls all the protocol registration.
2552 proto_register_bthci_evt(void)
2555 /* Setup list of header fields See Section 1.6.1 for details*/
2556 static hf_register_info hf[] = {
2557 { &hf_bthci_evt_code,
2558 { "Event Code", "bthci_evt.code",
2559 FT_UINT8, BASE_HEX, VALS(evt_code_vals), 0x0,
2562 { &hf_bthci_evt_param_length,
2563 { "Parameter Total Length", "bthci_evt.param_length",
2564 FT_UINT8, BASE_DEC, NULL, 0x0,
2567 { &hf_bthci_evt_params,
2568 { "Event Parameter", "bthci_evt.params",
2569 FT_NONE, BASE_NONE, NULL, 0x0,
2572 { &hf_bthci_evt_num_command_packets,
2573 { "Number of Allowed Command Packets", "bthci_evt.num_command_packets",
2574 FT_UINT8, BASE_DEC, NULL, 0x0,
2577 { &hf_bthci_evt_num_handles,
2578 { "Number of Connection Handles", "bthci_evt.num_handles",
2579 FT_UINT8, BASE_DEC, NULL, 0x0,
2580 "Number of Connection Handles and Num_HCI_Data_Packets parameter pairs", HFILL }
2582 { &hf_bthci_evt_connection_handle,
2583 { "Connection Handle", "bthci_evt.connection_handle",
2584 FT_UINT16, BASE_HEX, NULL, 0x0,
2588 { &hf_bthci_evt_num_compl_packets,
2589 { "Number of Completed Packets", "bthci_evt.num_compl_packets",
2590 FT_UINT16, BASE_DEC, NULL, 0x0,
2591 "The number of HCI Data Packets that have been completed", HFILL }
2594 { &hf_bthci_evt_com_opcode,
2595 { "Command Opcode", "bthci_evt.com_opcode",
2596 FT_UINT16, BASE_HEX, VALS(bthci_cmd_opcode_vals), 0x0,
2599 { &hf_bthci_evt_ogf,
2600 { "ogf", "bthci_evt.ogf",
2601 FT_UINT16, BASE_HEX, VALS(bthci_ogf_vals), 0xfc00,
2602 "Opcode Group Field", HFILL }
2604 { &hf_bthci_evt_ocf,
2605 { "ocf", "bthci_evt.ocf",
2606 FT_UINT16, BASE_HEX, NULL, 0x03ff,
2607 "Opcode Command Field", HFILL }
2609 { &hf_bthci_evt_ret_params,
2610 { "Return Parameter", "bthci_evt.ret_params",
2611 FT_NONE, BASE_NONE, NULL, 0x0,
2614 { &hf_bthci_evt_status,
2615 { "Status", "bthci_evt.status",
2616 FT_UINT8, BASE_HEX, VALS(bthci_cmd_status_vals), 0x0,
2619 { &hf_bthci_evt_status_pending,
2620 { "Status", "bthci_evt.status",
2621 FT_UINT8, BASE_HEX, VALS(bthci_cmd_status_pending_vals), 0x0,
2624 { &hf_bthci_evt_bd_addr,
2625 { "BD_ADDR:", "bthci_evt.bd_addr",
2626 FT_NONE, BASE_NONE, NULL, 0x0,
2627 "Bluetooth Device Address", HFILL}
2629 { &hf_bthci_evt_class_of_device,
2630 { "Class of Device", "bthci_evt.class_of_device",
2631 FT_UINT24, BASE_HEX, NULL, 0x0,
2634 { &hf_bthci_evt_link_type,
2635 { "Link Type", "bthci_evt.link_type",
2636 FT_UINT8, BASE_HEX, VALS(evt_link_types), 0x0,
2639 { &hf_bthci_evt_encryption_mode,
2640 { "Encryption Mode", "bthci_evt.encryption_mode",
2641 FT_UINT8, BASE_HEX, VALS(evt_encryption_modes), 0x0,
2644 { &hf_bthci_evt_reason,
2645 { "Reason", "bthci_evt.reason",
2646 FT_UINT8, BASE_HEX, VALS(bthci_cmd_status_vals), 0x0,
2649 { &hf_bthci_evt_remote_name,
2650 { "Remote Name", "bthci_evt.remote_name",
2651 FT_STRINGZ, BASE_NONE, NULL, 0x0,
2652 "Userfriendly descriptive name for the remote device", HFILL }
2654 { &hf_bthci_evt_encryption_enable,
2655 { "Encryption Enable", "bthci_evt.encryption_enable",
2656 FT_UINT8, BASE_HEX, VALS(evt_encryption_enable), 0x0,
2659 { &hf_bthci_evt_key_flag,
2660 { "Key Flag", "bthci_evt.key_flag",
2661 FT_UINT8, BASE_HEX, VALS(evt_key_flag), 0x0,
2664 { &hf_bthci_evt_vers_nr,
2665 { "LMP Version", "bthci_evt.lmp_vers_nr",
2666 FT_UINT8, BASE_HEX, VALS(evt_lmp_vers_nr), 0x0,
2667 "Version of the Current LMP", HFILL }
2669 { &hf_bthci_evt_hci_vers_nr,
2670 { "HCI Version", "bthci_evt.hci_vers_nr",
2671 FT_UINT8, BASE_HEX, VALS(evt_hci_vers_nr), 0x0,
2672 "Version of the Current HCI", HFILL }
2674 { &hf_bthci_evt_hci_revision,
2675 { "HCI Revision", "bthci_evt.hci_vers_nr",
2676 FT_UINT16, BASE_DEC, NULL, 0x0,
2677 "Revision of the Current HCI", HFILL }
2679 { &hf_bthci_evt_comp_id,
2680 { "Manufacturer Name", "bthci_evt.comp_id",
2681 FT_UINT16, BASE_HEX, VALS(evt_comp_id), 0x0,
2682 "Manufacturer Name of Bluetooth Hardware", HFILL }
2684 { &hf_bthci_evt_sub_vers_nr,
2685 { "LMP Subversion", "bthci_evt.lmp_sub_vers_nr",
2686 FT_UINT16, BASE_DEC, NULL, 0x0,
2687 "Subversion of the Current LMP", HFILL }
2689 { &hf_bthci_evt_flags,
2690 { "Flags", "bthci_evt.flags",
2691 FT_UINT8, BASE_HEX, NULL, 0x0,
2694 { &hf_bthci_evt_service_type,
2695 { "Service Type", "bthci_evt.service_type",
2696 FT_UINT8, BASE_HEX, VALS(evt_service_types), 0x0,
2699 { &hf_bthci_evt_token_rate,
2700 { "Available Token Rate", "bthci_evt.token_rate",
2701 FT_UINT32, BASE_DEC, NULL, 0x0,
2702 "Available Token Rate, in bytes per second", HFILL }
2704 { &hf_bthci_evt_peak_bandwidth,
2705 { "Available Peak Bandwidth", "bthci_evt.peak_bandwidth",
2706 FT_UINT32, BASE_DEC, NULL, 0x0,
2707 "Available Peak Bandwidth, in bytes per second", HFILL }
2709 { &hf_bthci_evt_latency,
2710 { "Available Latency", "bthci_evt.latency",
2711 FT_UINT32, BASE_DEC, NULL, 0x0,
2712 "Available Latency, in microseconds", HFILL }
2714 { &hf_bthci_evt_delay_variation,
2715 { "Available Delay Variation", "bthci_evt.delay_variation",
2716 FT_UINT32, BASE_DEC, NULL, 0x0,
2717 "Available Delay Variation, in microseconds", HFILL }
2719 { &hf_bthci_evt_hardware_code,
2720 { "Hardware Code", "bthci_evt.hardware_code",
2721 FT_UINT8, BASE_HEX, NULL, 0x0,
2722 "Hardware Code (implementation specific)", HFILL }
2724 { &hf_bthci_evt_role,
2725 { "Role", "bthci_evt.role",
2726 FT_UINT8, BASE_HEX, VALS(evt_role_vals), 0x0,
2729 { &hf_bthci_evt_curr_mode,
2730 { "Current Mode", "bthci_evt.current_mode",
2731 FT_UINT8, BASE_HEX, VALS(evt_modes), 0x0,
2734 { &hf_bthci_evt_interval,
2735 { "Interval", "bthci_evt.interval",
2736 FT_UINT16, BASE_DEC, NULL, 0x0,
2737 "Interval - Number of Baseband slots", HFILL }
2739 { &hf_bthci_evt_link_key,
2740 { "Link Key", "bthci_evt.link_key",
2741 FT_BYTES, BASE_NONE, NULL, 0x0,
2742 "Link Key for the associated BD_ADDR", HFILL }
2744 { &hf_bthci_evt_key_type,
2745 { "Key Type", "bthci_evt.key_type",
2746 FT_UINT8, BASE_HEX, VALS(evt_key_types), 0x0,
2749 { &hf_bthci_evt_max_slots,
2750 { "Maximum Number of Slots", "bthci_evt.max_slots",
2751 FT_UINT8, BASE_DEC, NULL, 0x0,
2752 "Maximum Number of slots allowed for baseband packets", HFILL }
2754 { &hf_bthci_evt_clock_offset,
2755 { "Clock Offset", "bthci_evt.clock_offset",
2756 FT_UINT16, BASE_HEX, NULL, 0x7FFF,
2757 "Bit 2-16 of the Clock Offset between CLKmaster-CLKslave", HFILL }
2759 { &hf_bthci_evt_page_scan_mode,
2760 { "Page Scan Mode", "bthci_evt.page_scan_mode",
2761 FT_UINT8, BASE_HEX, VALS(evt_page_scan_modes), 0x0,
2764 { &hf_bthci_evt_page_scan_repetition_mode,
2765 { "Page Scan Repetition Mode", "bthci_evt.page_scan_repetition_mode",
2766 FT_UINT8, BASE_HEX, VALS(evt_page_scan_repetition_modes), 0x0,
2769 { &hf_bthci_evt_page_scan_period_mode,
2770 { "Page Scan Period Mode", "bthci_evt.page_scan_period_mode",
2771 FT_UINT8, BASE_HEX, VALS(evt_page_scan_period_modes), 0x0,
2774 { &hf_bthci_evt_link_type_2dh1,
2775 { "ACL Link Type 2-DH1", "bthci_evt.link_type_2dh1",
2776 FT_UINT16, BASE_DEC, VALS(evt_boolean), 0x0002,
2779 { &hf_bthci_evt_link_type_3dh1,
2780 { "ACL Link Type 3-DH1", "bthci_evt.link_type_3dh1",
2781 FT_UINT16, BASE_DEC, VALS(evt_boolean), 0x0004,
2784 { &hf_bthci_evt_link_type_dm1,
2785 { "ACL Link Type DM1", "bthci_evt.link_type_dm1",
2786 FT_UINT16, BASE_DEC, VALS(evt_boolean), 0x0008,
2789 { &hf_bthci_evt_link_type_dh1,
2790 { "ACL Link Type DH1", "bthci_evt.link_type_dh1",
2791 FT_UINT16, BASE_DEC, VALS(evt_boolean), 0x0010,
2794 { &hf_bthci_evt_link_type_2dh3,
2795 { "ACL Link Type 2-DH3", "bthci_evt.link_type_2dh3",
2796 FT_UINT16, BASE_DEC, VALS(evt_boolean), 0x0100,
2799 { &hf_bthci_evt_link_type_3dh3,
2800 { "ACL Link Type 3-DH3", "bthci_evt.link_type_3dh3",
2801 FT_UINT16, BASE_DEC, VALS(evt_boolean), 0x0200,
2804 { &hf_bthci_evt_link_type_dm3,
2805 { "ACL Link Type DM3", "bthci_evt.link_type_dm3",
2806 FT_UINT16, BASE_DEC, VALS(evt_boolean), 0x0400,
2809 { &hf_bthci_evt_link_type_dh3,
2810 { "ACL Link Type DH3", "bthci_evt.link_type_dh3",
2811 FT_UINT16, BASE_DEC, VALS(evt_boolean), 0x0800,
2814 { &hf_bthci_evt_link_type_2dh5,
2815 { "ACL Link Type 2-DH5", "bthci_evt.link_type_2dh5",
2816 FT_UINT16, BASE_DEC, VALS(evt_boolean), 0x1000,
2819 { &hf_bthci_evt_link_type_3dh5,
2820 { "ACL Link Type 3-DH5", "bthci_evt.link_type_3dh5",
2821 FT_UINT16, BASE_DEC, VALS(evt_boolean), 0x2000,
2824 { &hf_bthci_evt_link_type_dm5,
2825 { "ACL Link Type DM5", "bthci_evt.link_type_dm5",
2826 FT_UINT16, BASE_DEC, VALS(evt_boolean), 0x4000,
2829 { &hf_bthci_evt_link_type_dh5,
2830 { "ACL Link Type DH5", "bthci_evt.link_type_dh5",
2831 FT_UINT16, BASE_DEC, VALS(evt_boolean), 0x8000,
2834 { &hf_bthci_evt_link_type_hv1,
2835 { "SCO Link Type HV1", "bthci_evt.link_type_hv1",
2836 FT_UINT16, BASE_DEC, VALS(evt_boolean), 0x0020,
2839 { &hf_bthci_evt_link_type_hv2,
2840 { "SCO Link Type HV2", "bthci_evt.link_type_hv2",
2841 FT_UINT16, BASE_DEC, VALS(evt_boolean), 0x0040,
2844 { &hf_bthci_evt_link_type_hv3,
2845 { "SCO Link Type HV3", "bthci_evt.link_type_hv3",
2846 FT_UINT16, BASE_DEC, VALS(evt_boolean), 0x0080,
2849 { &hf_bthci_evt_lmp_feature_00,
2850 { "3-slot packets", "bthci_evt.lmp_feature",
2851 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x01,
2854 { &hf_bthci_evt_lmp_feature_01,
2855 { "5-slot packets", "bthci_evt.lmp_feature",
2856 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x02,
2859 { &hf_bthci_evt_lmp_feature_02,
2860 { "encryption", "bthci_evt.lmp_feature",
2861 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x04,
2864 { &hf_bthci_evt_lmp_feature_03,
2865 { "slot offset", "bthci_evt.lmp_feature",
2866 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x08,
2869 { &hf_bthci_evt_lmp_feature_04,
2870 { "timing accuracy", "bthci_evt.lmp_feature",
2871 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x10,
2874 { &hf_bthci_evt_lmp_feature_05,
2875 { "master/slave switch", "bthci_evt.lmp_feature",
2876 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x20,
2879 { &hf_bthci_evt_lmp_feature_06,
2880 { "hold mode", "bthci_evt.lmp_feature",
2881 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x40,
2884 { &hf_bthci_evt_lmp_feature_07,
2885 { "sniff mode", "bthci_evt.lmp_feature",
2886 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x80,
2889 { &hf_bthci_evt_lmp_feature_10,
2890 { "park mode", "bthci_evt.lmp_feature",
2891 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x01,
2894 { &hf_bthci_evt_lmp_feature_11,
2895 { "RSSI", "bthci_evt.lmp_feature",
2896 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x02,
2899 { &hf_bthci_evt_lmp_feature_12,
2900 { "channel quality driven data rate", "bthci_evt.lmp_feature",
2901 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x04,
2904 { &hf_bthci_evt_lmp_feature_13,
2905 { "SCO link", "bthci_evt.lmp_feature",
2906 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x08,
2909 { &hf_bthci_evt_lmp_feature_14,
2910 { "HV2 packets", "bthci_evt.lmp_feature",
2911 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x10,
2914 { &hf_bthci_evt_lmp_feature_15,
2915 { "HV3 packets", "bthci_evt.lmp_feature",
2916 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x20,
2919 { &hf_bthci_evt_lmp_feature_16,
2920 { "u-law log", "bthci_evt.lmp_feature",
2921 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x40,
2924 { &hf_bthci_evt_lmp_feature_17,
2925 { "A-law log", "bthci_evt.lmp_feature",
2926 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x80,
2929 { &hf_bthci_evt_lmp_feature_20,
2930 { "CVSD", "bthci_evt.lmp_feature",
2931 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x01,
2934 { &hf_bthci_evt_lmp_feature_21,
2935 { "paging scheme", "bthci_evt.lmp_feature",
2936 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x02,
2939 { &hf_bthci_evt_lmp_feature_22,
2940 { "power control", "bthci_evt.lmp_feature",
2941 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x04,
2944 { &hf_bthci_evt_lmp_feature_23,
2945 { "transparent SCO data", "bthci_evt.lmp_feature",
2946 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x08,
2949 { &hf_bthci_evt_lmp_feature_24,
2950 { "Flow control lag", "bthci_evt.lmp_feature",
2951 FT_UINT8, BASE_DEC, NULL, 0x70,
2954 { &hf_bthci_evt_lmp_feature_27,
2955 { "broadband encryption", "bthci_evt.lmp_feature",
2956 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x80,
2959 { &hf_bthci_evt_lmp_feature_31,
2960 { "EDR ACL 2 Mbps mode", "bthci_evt.lmp_feature",
2961 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x02,
2964 { &hf_bthci_evt_lmp_feature_32,
2965 { "EDR ACL 3 Mbps mode", "bthci_evt.lmp_feature",
2966 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x04,
2969 { &hf_bthci_evt_lmp_feature_33,
2970 { "enhanced inquiry scan", "bthci_evt.lmp_feature",
2971 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x08,
2974 { &hf_bthci_evt_lmp_feature_34,
2975 { "interlaced inquiry scan", "bthci_evt.lmp_feature",
2976 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x10,
2979 { &hf_bthci_evt_lmp_feature_35,
2980 { "interlaced page scan", "bthci_evt.lmp_feature",
2981 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x20,
2984 { &hf_bthci_evt_lmp_feature_36,
2985 { "RSSI with inquiry results", "bthci_evt.lmp_feature",
2986 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x40,
2989 { &hf_bthci_evt_lmp_feature_37,
2990 { "eSCO EV3 packets", "bthci_evt.lmp_feature",
2991 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x80,
2994 { &hf_bthci_evt_lmp_feature_40,
2995 { "eSCO EV4 packets", "bthci_evt.lmp_feature",
2996 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x01,
2999 { &hf_bthci_evt_lmp_feature_41,
3000 { "eSCO EV5 packets", "bthci_evt.lmp_feature",
3001 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x02,
3004 { &hf_bthci_evt_lmp_feature_43,
3005 { "AFH capable slave", "bthci_evt.lmp_feature",
3006 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x08,
3009 { &hf_bthci_evt_lmp_feature_44,
3010 { "AFH classification slave", "bthci_evt.lmp_feature",
3011 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x10,
3014 { &hf_bthci_evt_lmp_feature_47,
3015 { "3-slot EDR ACL packets", "bthci_evt.lmp_feature",
3016 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x80,
3019 { &hf_bthci_evt_lmp_feature_50,
3020 { "5-slot EDR ACL packets", "bthci_evt.lmp_feature",
3021 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x01,
3024 { &hf_bthci_evt_lmp_feature_51,
3025 { "sniff subrating", "bthci_evt.lmp_feature",
3026 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x02,
3029 { &hf_bthci_evt_lmp_feature_52,
3030 { "pause encryption", "bthci_evt.lmp_feature",
3031 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x04,
3034 { &hf_bthci_evt_lmp_feature_53,
3035 { "AFH capable master", "bthci_evt.lmp_feature",
3036 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x08,
3039 { &hf_bthci_evt_lmp_feature_54,
3040 { "AFH classification master", "bthci_evt.lmp_feature",
3041 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x10,
3044 { &hf_bthci_evt_lmp_feature_55,
3045 { "EDR eSCO 2 Mbps mode", "bthci_evt.lmp_feature",
3046 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x20,
3049 { &hf_bthci_evt_lmp_feature_56,
3050 { "EDR eSCO 3 Mbps mode", "bthci_evt.lmp_feature",
3051 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x40,
3054 { &hf_bthci_evt_lmp_feature_57,
3055 { "3-slot EDR eSCO packets", "bthci_evt.lmp_feature",
3056 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x80,
3059 { &hf_bthci_evt_lmp_feature_60,
3060 { "extended inquiry response", "bthci_evt.lmp_feature",
3061 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x01,
3064 { &hf_bthci_evt_lmp_feature_63,
3065 { "secure simple pairing", "bthci_evt.lmp_feature",
3066 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x08,
3069 { &hf_bthci_evt_lmp_feature_64,
3070 { "encapsulated PDU", "bthci_evt.lmp_feature",
3071 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x10,
3074 { &hf_bthci_evt_lmp_feature_65,
3075 { "erroneous data reporting", "bthci_evt.lmp_feature",
3076 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x20,
3079 { &hf_bthci_evt_lmp_feature_66,
3080 { "non-flushable packet boundary flag", "bthci_evt.lmp_feature",
3081 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x40,
3084 { &hf_bthci_evt_lmp_feature_70,
3085 { "link supervision timeout changed event", "bthci_evt.lmp_feature",
3086 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x01,
3089 { &hf_bthci_evt_lmp_feature_71,
3090 { "inquiry response TX power level", "bthci_evt.lmp_feature",
3091 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x02,
3094 { &hf_bthci_evt_lmp_feature_77,
3095 { "extended features", "bthci_evt.lmp_feature",
3096 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x80,
3099 { &hf_bthci_evt_num_keys,
3100 { "Number of Link Keys", "bthci_evt.num_keys",
3101 FT_UINT8, BASE_DEC, NULL, 0x0,
3102 "Number of Link Keys contained", HFILL }
3104 { &hf_bthci_evt_num_keys_read,
3105 { "Number of Link Keys Read", "bthci_evt.num_keys_read",
3106 FT_UINT16, BASE_DEC, NULL, 0x0,
3109 { &hf_bthci_evt_num_keys_deleted,
3110 { "Number of Link Keys Deleted", "bthci_evt.num_keys_deleted",
3111 FT_UINT16, BASE_DEC, NULL, 0x0,
3114 { &hf_bthci_evt_num_keys_written,
3115 { "Number of Link Keys Written", "bthci_evt.num_keys_written",
3116 FT_UINT8, BASE_DEC, NULL, 0x0,
3119 { &hf_bthci_evt_max_num_keys,
3120 { "Max Num Keys", "bthci_evt.max_num_keys",
3121 FT_UINT16, BASE_DEC, NULL, 0x0,
3122 "Total Number of Link Keys that the Host Controller can store", HFILL }
3124 { &hf_bthci_evt_num_responses,
3125 { "Number of responses", "bthci_evt.num_responses",
3126 FT_UINT8, BASE_DEC, NULL, 0x0,
3127 "Number of Responses from Inquiry", HFILL }
3129 { &hf_bthci_evt_link_policy_setting_switch,
3130 { "Enable Master Slave Switch", "bthci_evt.link_policy_switch",
3131 FT_UINT16, BASE_DEC, VALS(evt_boolean), 0x0001,
3134 { &hf_bthci_evt_link_policy_setting_hold,
3135 { "Enable Hold Mode", "bthci_evt.link_policy_hold",
3136 FT_UINT16, BASE_DEC, VALS(evt_boolean), 0x0002,
3139 { &hf_bthci_evt_link_policy_setting_sniff,
3140 { "Enable Sniff Mode", "bthci_evt.link_policy_sniff",
3141 FT_UINT16, BASE_DEC, VALS(evt_boolean), 0x0004,
3144 { &hf_bthci_evt_link_policy_setting_park,
3145 { "Enable Park Mode", "bthci_evt.link_policy_park",
3146 FT_UINT16, BASE_DEC, VALS(evt_boolean), 0x0008,
3149 { &hf_bthci_evt_curr_role,
3150 { "Current Role", "bthci_evt_curr_role",
3151 FT_UINT8, BASE_HEX, VALS(evt_role_vals_handle), 0x0,
3152 "Current role for this connection handle", HFILL }
3154 { &hf_bthci_evt_pin_type,
3155 { "PIN Type", "bthci_evt.pin_type",
3156 FT_UINT8, BASE_HEX, VALS(evt_pin_types), 0x0,
3157 "PIN Types", HFILL }
3159 { &hf_bthci_evt_device_name,
3160 { "Device Name", "bthci_evt.device_name",
3161 FT_STRINGZ, BASE_NONE, NULL, 0x0,
3162 "Userfriendly descriptive name for the device", HFILL }
3164 { &hf_bthci_evt_timeout,
3165 { "Timeout", "bthci_evt.timeout",
3166 FT_UINT16, BASE_DEC, NULL, 0x0,
3167 "Number of Baseband slots for timeout.", HFILL }
3169 { &hf_bthci_evt_scan_enable,
3170 { "Scan", "bthci_evt.scan_enable",
3171 FT_UINT8, BASE_HEX, VALS(evt_scan_enable_values), 0x0,
3172 "Scan Enable", HFILL }
3174 { &hf_bthci_evt_authentication_enable,
3175 { "Authentication", "bthci_evt.auth_enable",
3176 FT_UINT8, BASE_HEX, VALS(evt_auth_enable_values), 0x0,
3177 "Authentication Enable", HFILL }
3179 { &hf_bthci_evt_sco_flow_cont_enable,
3180 { "SCO Flow Control", "bthci_evt.sco_flow_cont_enable",
3181 FT_UINT8, BASE_HEX, VALS(evt_enable_values), 0x0,
3182 "SCO Flow Control Enable", HFILL }
3184 { &hf_bthci_evt_window,
3185 { "Interval", "bthci_evt.window",
3186 FT_UINT16, BASE_DEC, NULL, 0x0,
3189 { &hf_bthci_evt_input_coding,
3190 { "Input Coding", "bthci_evt.input_coding",
3191 FT_UINT16, BASE_DEC, VALS(evt_input_coding_values), 0x0300,
3192 "Authentication Enable", HFILL }
3194 { &hf_bthci_evt_input_data_format,
3195 { "Input Data Format", "bthci_evt.input_data_format",
3196 FT_UINT16, BASE_DEC, VALS(evt_input_data_format_values), 0x00c0,
3199 { &hf_bthci_evt_input_sample_size,
3200 { "Input Sample Size", "bthci_evt.input_sample_size",
3201 FT_UINT16, BASE_DEC, VALS(evt_input_sample_size_values), 0x0020,
3204 { &hf_bthci_evt_num_broadcast_retransm,
3205 { "Num Broadcast Retran", "bthci_evt.num_broad_retran",
3206 FT_UINT8, BASE_DEC, NULL, 0x0,
3207 "Number of Broadcast Retransmissions", HFILL }
3209 { &hf_bthci_evt_hold_mode_act_page,
3210 { "Suspend Page Scan", "bthci_evt.hold_mode_page",
3211 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x1,
3212 "Device can enter low power state", HFILL }
3214 { &hf_bthci_evt_hold_mode_act_inquiry,
3215 { "Suspend Inquiry Scan", "bthci_evt.hold_mode_inquiry",
3216 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x2,
3217 "Device can enter low power state", HFILL }
3219 { &hf_bthci_evt_hold_mode_act_periodic,
3220 { "Suspend Periodic Inquiries", "bthci_evt.hold_mode_periodic",
3221 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x4,
3222 "Device can enter low power state", HFILL }
3224 { &hf_bthci_evt_transmit_power_level,
3225 { "Transmit Power Level (dBm)", "bthci_evt.transmit_power_level",
3226 FT_INT8, BASE_DEC, NULL, 0x0,
3229 { &hf_bthci_evt_num_supp_iac,
3230 {"Num Support IAC", "bthci_evt.num_supp_iac",
3231 FT_UINT8, BASE_DEC, NULL, 0x0,
3232 "Num of supported IAC the device can simultaneously listen", HFILL }
3234 { &hf_bthci_evt_num_curr_iac,
3235 {"Num Current IAC", "bthci_evt.num_curr_iac",
3236 FT_UINT8, BASE_DEC, NULL, 0x0,
3237 "Num of IACs currently in use to simultaneously listen", HFILL }
3239 { &hf_bthci_evt_iac_lap,
3240 { "IAC LAP", "bthci_evt.num_curr_iac",
3241 FT_UINT24, BASE_HEX, NULL, 0x0,
3242 "LAP(s)used to create IAC", HFILL }
3244 { &hf_bthci_evt_loopback_mode,
3245 {"Loopback Mode", "bthci_evt.loopback_mode",
3246 FT_UINT8, BASE_HEX, VALS(evt_loopback_modes), 0x0,
3249 { &hf_bthci_evt_country_code,
3250 {"Country Code", "bthci_evt.country_code",
3251 FT_UINT8, BASE_HEX, VALS(evt_country_code_values), 0x0,
3254 { &hf_bthci_evt_failed_contact_counter,
3255 {"Failed Contact Counter", "bthci_evt.failed_contact_counter",
3256 FT_UINT16, BASE_DEC, NULL, 0x0,
3259 { &hf_bthci_evt_link_quality,
3260 {"Link Quality", "bthci_evt.link_quality",
3261 FT_UINT8, BASE_DEC, NULL, 0x0,
3262 "Link Quality (0x00 - 0xFF Higher Value = Better Link)", HFILL }
3264 { &hf_bthci_evt_rssi,
3265 { "RSSI (dB)", "bthci_evt.rssi",
3266 FT_INT8, BASE_DEC, NULL, 0x0,
3269 { &hf_bthci_evt_host_data_packet_length_acl,
3270 {"Host ACL Data Packet Length (bytes)", "bthci_evt.max_data_length_acl",
3271 FT_UINT16, BASE_DEC, NULL, 0x0,
3272 "Max Host ACL Data Packet length of data portion host is able to accept", HFILL }
3274 { &hf_bthci_evt_host_data_packet_length_sco,
3275 {"Host SCO Data Packet Length (bytes)", "bthci_evt.max_data_length_sco",
3276 FT_UINT8, BASE_DEC, NULL, 0x0,
3277 "Max Host SCO Data Packet length of data portion host is able to accept", HFILL }
3279 { &hf_bthci_evt_host_total_num_acl_data_packets,
3280 {"Host Total Num ACL Data Packets", "bthci_evt.max_data_num_acl",
3281 FT_UINT16, BASE_DEC, NULL, 0x0,
3282 "Total Number of HCI ACL Data Packets that can be stored in the data buffers of the Host", HFILL }
3284 { &hf_bthci_evt_host_total_num_sco_data_packets,
3285 {"Host Total Num SCO Data Packets", "bthci_evt.max_data_num_sco",
3286 FT_UINT16, BASE_DEC, NULL, 0x0,
3287 "Total Number of HCI SCO Data Packets that can be stored in the data buffers of the Host", HFILL }
3289 { &hf_bthci_evt_page_number,
3290 {"Page Number", "bthci_evt.page_number",
3291 FT_UINT8, BASE_DEC, NULL, 0x0,
3294 { &hf_bthci_evt_max_page_number,
3295 {"Max. Page Number", "bthci_evt.max_page_number",
3296 FT_UINT8, BASE_DEC, NULL, 0x0,
3299 { &hf_bthci_evt_local_supported_cmds,
3300 { "Local Supported Commands", "bthci_evt.local_supported_cmds",
3301 FT_BYTES, BASE_NONE, NULL, 0x0,
3304 { &hf_bthci_evt_fec_required,
3305 {"FEC Required", "bthci_evt.fec_required",
3306 FT_UINT8, BASE_DEC, VALS(evt_boolean), 0x0,
3309 { &hf_bthci_evt_err_data_reporting,
3310 {"Erroneous Data Reporting", "bthci_evt.err_data_reporting",
3311 FT_UINT8, BASE_DEC, VALS(evt_enable_values), 0x0,
3314 { &hf_bthci_evt_scan_type,
3315 {"Scan Type", "bthci_evt.inq_scan_type",
3316 FT_UINT8, BASE_DEC, VALS(evt_scan_types), 0x0,
3319 { &hf_bthci_evt_inq_mode,
3320 {"Inquiry Mode", "bthci_evt.inq_scan_type",
3321 FT_UINT8, BASE_DEC, VALS(evt_inq_modes), 0x0,
3324 { &hf_bthci_evt_power_level_type,
3325 {"Type", "bthci_evt.power_level_type",
3326 FT_UINT8, BASE_HEX, VALS(evt_power_level_types), 0x0,
3329 { &hf_bthci_evt_ext_lmp_features,
3330 {"Ext. LMP Features", "bthci_evt.page_number",
3331 FT_UINT64, BASE_HEX, NULL, 0x0,
3332 "Extended LMP Features", HFILL}
3334 { &hf_bthci_evt_sync_link_type,
3335 {"Link Type", "bthci_evt.sync_link_type",
3336 FT_UINT8, BASE_HEX, VALS(evt_sync_link_types), 0x0,
3339 { &hf_bthci_evt_sync_tx_interval,
3340 {"Transmit Interval", "bthci_evt.sync_tx_interval",
3341 FT_UINT8, BASE_DEC, NULL, 0x0,
3344 { &hf_bthci_evt_sync_rtx_window,
3345 {"Retransmit Window", "bthci_evt.sync_rtx_window",
3346 FT_UINT8, BASE_DEC, NULL, 0x0,
3349 { &hf_bthci_evt_sync_rx_packet_length,
3350 {"Rx Packet Length", "bthci_evt.sync_rx_pkt_len",
3351 FT_UINT16, BASE_DEC, NULL, 0x0,
3354 { &hf_bthci_evt_sync_tx_packet_length,
3355 {"Tx Packet Length", "bthci_evt.sync_tx_pkt_len",
3356 FT_UINT16, BASE_DEC, NULL, 0x0,
3359 { &hf_bthci_evt_air_mode,
3360 {"Air Mode", "bthci_evt.air_mode",
3361 FT_UINT8, BASE_DEC, VALS(evt_air_mode_values), 0x0,
3364 { &hf_bthci_evt_max_tx_latency,
3365 {"Max. Tx Latency", "bthci_evt.max_tx_latency",
3366 FT_UINT16, BASE_DEC, NULL, 0x0,
3369 { &hf_bthci_evt_max_rx_latency,
3370 {"Max. Rx Latency", "bthci_evt.max_rx_latency",
3371 FT_UINT16, BASE_DEC, NULL, 0x0,
3374 { &hf_bthci_evt_min_remote_timeout,
3375 {"Min. Remote Timeout", "bthci_evt.min_remote_timeout",
3376 FT_UINT16, BASE_DEC, NULL, 0x0,
3379 { &hf_bthci_evt_min_local_timeout,
3380 {"Min. Local Timeout", "bthci_evt.min_local_timeout",
3381 FT_UINT16, BASE_DEC, NULL, 0x0,
3384 { &hf_bthci_evt_link_supervision_timeout,
3385 {"Link Supervision Timeout", "bthci_evt.link_supervision_timeout",
3386 FT_UINT16, BASE_DEC, NULL, 0x0,
3389 { &hf_bthci_evt_token_bucket_size,
3390 { "Token Bucket Size", "bthci_evt.token_bucket_size",
3391 FT_UINT32, BASE_DEC, NULL, 0x0,
3392 "Token Bucket Size (bytes)", HFILL }
3394 { &hf_bthci_evt_flow_direction,
3395 {"Flow Direction", "bthci_evt.flow_direction",
3396 FT_UINT8, BASE_DEC, VALS(evt_flow_direction_values), 0x0,
3399 { &hf_bthci_evt_afh_ch_assessment_mode,
3400 {"AFH Channel Assessment Mode", "bthci_evt.afh_ch_assessment_mode",
3401 FT_UINT8, BASE_DEC, VALS(evt_enable_values), 0x0,
3404 { &hf_bthci_evt_lmp_handle,
3405 { "LMP Handle", "bthci_evt.lmp_handle",
3406 FT_UINT16, BASE_HEX, NULL, 0x0,
3409 { &hf_bthci_evt_clock,
3410 { "Clock", "bthci_evt.clock",
3411 FT_UINT32, BASE_HEX, NULL, 0x0,
3414 { &hf_bthci_evt_clock_accuracy,
3415 { "Clock", "bthci_evt.clock_accuracy",
3416 FT_UINT16, BASE_HEX, NULL, 0x0,
3419 { &hf_bthci_evt_afh_mode,
3420 {"AFH Mode", "bthci_evt.afh_mode",
3421 FT_UINT8, BASE_DEC, VALS(evt_enable_values), 0x0,
3424 { &hf_bthci_evt_afh_channel_map,
3425 {"AFH Channel Map", "bthci_evt.afh_channel_map",
3426 FT_UINT_BYTES, BASE_NONE, NULL, 0x0,
3429 { &hf_bthci_evt_simple_pairing_mode,
3430 {"Simple Pairing Mode", "bthci_evt.simple_pairing_mode",
3431 FT_UINT8, BASE_DEC, VALS(evt_enable_values), 0x0,
3434 { &hf_bthci_evt_hash_c,
3435 {"Hash C", "bthci_evt.hash_c",
3436 FT_UINT16, BASE_DEC, NULL, 0x0,
3439 { &hf_bthci_evt_randomizer_r,
3440 {"Randomizer R", "bthci_evt.randomizer_r",
3441 FT_UINT16, BASE_DEC, NULL, 0x0,
3444 { &hf_bthci_evt_io_capability,
3445 {"IO Capability", "bthci_evt.io_capability",
3446 FT_UINT8, BASE_HEX, VALS(bthci_cmd_io_capability_vals), 0x0,
3449 { &hf_bthci_evt_oob_data_present,
3450 {"OOB Data Present", "bthci_evt.oob_data_present",
3451 FT_UINT8, BASE_DEC, VALS(bthci_cmd_oob_data_present_vals), 0x0,
3454 { &hf_bthci_evt_auth_requirements,
3455 {"Authentication Requirements", "bthci_evt.auth_requirements",
3456 FT_UINT8, BASE_DEC, VALS(bthci_cmd_auth_req_vals), 0x0,
3459 { &hf_bthci_evt_numeric_value,
3460 {"Numeric Value", "bthci_evt.numeric_value",
3461 FT_UINT32, BASE_DEC, NULL, 0x0,
3464 { &hf_bthci_evt_passkey,
3465 {"Passkey", "bthci_evt.passkey",
3466 FT_UINT32, BASE_DEC, NULL, 0x0,
3469 { &hf_bthci_evt_notification_type,
3470 {"Notification Type", "bthci_evt.notification_type",
3471 FT_UINT8, BASE_DEC, VALS(evt_notification_type_vals), 0x0,
3474 { &hf_bthci_evt_eir_data,
3475 {"Data", "bthci_cmd.eir_data",
3476 FT_BYTES, BASE_NONE, NULL, 0x0,
3479 { &hf_bthci_evt_eir_struct_length,
3480 { "Length", "bthci_cmd.eir_struct_length",
3481 FT_UINT8, BASE_DEC, NULL, 0x0,
3482 "Structure Length", HFILL }
3484 { &hf_bthci_evt_eir_struct_type,
3485 { "Type", "bthci_cmd.eir_data_type",
3486 FT_UINT8, BASE_HEX, VALS(bthci_cmd_eir_data_type_vals), 0x0,
3487 "Data Type", HFILL }
3489 { &hf_bthci_evt_sc_uuid16,
3490 { "UUID", "bthci_cmd.service_class_uuid16",
3491 FT_UINT16, BASE_HEX, VALS(bthci_cmd_service_class_type_vals), 0x0,
3492 "16-bit Service Class UUID", HFILL }
3494 { &hf_bthci_evt_sc_uuid32,
3495 { "UUID", "bthci_cmd.service_class_uuid32",
3496 FT_UINT32, BASE_HEX, NULL, 0x0,
3497 "32-bit Service Class UUID", HFILL }
3499 { &hf_bthci_evt_sc_uuid128,
3500 { "UUID", "bthci_cmd.service_class_uuid128",
3501 FT_BYTES, BASE_NONE, NULL, 0x0,
3502 "128-bit Service Class UUID", HFILL }
3506 /* Setup protocol subtree array */
3507 static gint *ett[] = {
3513 &ett_eir_struct_subtree
3516 /* Register the protocol name and description */
3517 proto_bthci_evt = proto_register_protocol("Bluetooth HCI Event",
3518 "HCI_EVT", "bthci_evt");
3520 register_dissector("bthci_evt", dissect_bthci_evt, proto_bthci_evt);
3524 /* Required function calls to register the header fields and subtrees used */
3525 proto_register_field_array(proto_bthci_evt, hf, array_length(hf));
3526 proto_register_subtree_array(ett, array_length(ett));
3530 /* If this dissector uses sub-dissector registration add a registration routine.
3531 This format is required because a script is used to find these routines and
3532 create the code that calls these routines.
3535 proto_reg_handoff_bthci_evt(void)
3537 dissector_handle_t bthci_evt_handle;
3539 bthci_evt_handle = find_dissector("bthci_evt");
3540 dissector_add("hci_h4.type", HCI_H4_TYPE_EVT, bthci_evt_handle);
3541 dissector_add("hci_h1.type", BTHCI_CHANNEL_EVENT, bthci_evt_handle);
3543 bthci_com_handle = find_dissector("bthci_cmd");