HACK: pinfo->private_data points to smb_info again
[wireshark-wip.git] / epan / dissectors / packet-bthci_evt.c
blob9f5dfec7b8b9cdb652384b38b7ac791e6ead38af
1 /* packet-bthci_evt.c
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
7 * Ronnie Sahlberg 2006
9 * Updated to HCI specification 2.1 + EDR
10 * Allan M. Madsen 2007
11 * Updated to HCI specification 3.0+HS & 4.0
12 * Allan M. Madsen 2012
14 * $Id$
16 * Wireshark - Network traffic analyzer
17 * By Gerald Combs <gerald@wireshark.org>
18 * Copyright 1998 Gerald Combs
20 * This program is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU General Public License
22 * as published by the Free Software Foundation; either version 2
23 * of the License, or (at your option) any later version.
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
30 * You should have received a copy of the GNU General Public License
31 * along with this program; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
35 #include "config.h"
37 #include <epan/packet.h>
38 #include <epan/addr_resolv.h>
39 #include <epan/wmem/wmem.h>
40 #include <epan/expert.h>
41 #include <epan/prefs.h>
43 #include "packet-bluetooth-hci.h"
44 #include "packet-sdp.h"
46 static dissector_handle_t bthci_cmd_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_num_command_packets = -1;
53 static int hf_bthci_evt_num_handles = -1;
54 static int hf_bthci_evt_connection_handle = -1;
55 static int hf_bthci_evt_num_compl_packets = -1;
56 static int hf_bthci_evt_ret_params = -1;
57 static int hf_bthci_evt_status = -1;
58 static int hf_bthci_evt_status_pending = -1;
59 static int hf_bthci_evt_opcode = -1;
60 static int hf_bthci_evt_ogf = -1;
61 static int hf_bthci_evt_ocf = -1;
62 static int hf_bthci_evt_ocf_link_control = -1;
63 static int hf_bthci_evt_ocf_link_policy = -1;
64 static int hf_bthci_evt_ocf_host_controller_and_baseband = -1;
65 static int hf_bthci_evt_ocf_informational = -1;
66 static int hf_bthci_evt_ocf_status = -1;
67 static int hf_bthci_evt_ocf_testing = -1;
68 static int hf_bthci_evt_ocf_logo_testing = -1;
69 static int hf_bthci_evt_ocf_low_energy = -1;
70 static int hf_bthci_evt_bd_addr = -1;
71 static int hf_bthci_evt_class_of_device = -1;
72 static int hf_bthci_evt_cod_format_type = -1;
73 static int hf_bthci_evt_cod_major_service_class_information = -1;
74 static int hf_bthci_evt_cod_major_service_class_telephony = -1;
75 static int hf_bthci_evt_cod_major_service_class_audio = -1;
76 static int hf_bthci_evt_cod_major_service_class_object_transfer = -1;
77 static int hf_bthci_evt_cod_major_service_class_capturing = -1;
78 static int hf_bthci_evt_cod_major_service_class_rendering = -1;
79 static int hf_bthci_evt_cod_major_service_class_networking = -1;
80 static int hf_bthci_evt_cod_major_service_class_positioning = -1;
81 static int hf_bthci_evt_cod_major_service_class_reserved = -1;
82 static int hf_bthci_evt_cod_major_service_class_limited_discoverable_mode = -1;
83 static int hf_bthci_evt_cod_major_device_class = -1;
84 static int hf_bthci_evt_cod_minor_device_class_computer = -1;
85 static int hf_bthci_evt_cod_minor_device_class_phone = -1;
86 static int hf_bthci_evt_cod_minor_device_class_lan_net_load_factor = -1;
87 static int hf_bthci_evt_cod_minor_device_class_lan_net_type = -1;
88 static int hf_bthci_evt_cod_minor_device_class_audio_video = -1;
89 static int hf_bthci_evt_cod_minor_device_class_peripheral_class = -1;
90 static int hf_bthci_evt_cod_minor_device_class_peripheral_type = -1;
91 static int hf_bthci_evt_cod_minor_device_class_imaging_class_printer = -1;
92 static int hf_bthci_evt_cod_minor_device_class_imaging_class_scanner = -1;
93 static int hf_bthci_evt_cod_minor_device_class_imaging_class_camera = -1;
94 static int hf_bthci_evt_cod_minor_device_class_imaging_class_display = -1;
95 static int hf_bthci_evt_cod_minor_device_class_imaging_type = -1;
96 static int hf_bthci_evt_cod_minor_device_class_wearable = -1;
97 static int hf_bthci_evt_cod_minor_device_class_toy = -1;
98 static int hf_bthci_evt_cod_minor_device_class_health = -1;
99 static int hf_bthci_evt_cod_minor_device_class_unknown = -1;
100 static int hf_bthci_evt_link_type = -1;
101 static int hf_bthci_evt_encryption_mode = -1;
102 static int hf_bthci_evt_reason = -1;
103 static int hf_bthci_evt_remote_name = -1;
104 static int hf_bthci_evt_encryption_enable = -1;
105 static int hf_bthci_evt_key_flag = -1;
106 static int hf_bthci_evt_vers_nr = -1;
107 static int hf_bthci_evt_hci_vers_nr = -1;
108 static int hf_bthci_evt_hci_revision = -1;
109 static int hf_bthci_evt_comp_id = -1;
110 static int hf_bthci_evt_sub_vers_nr = -1;
111 static int hf_bthci_evt_flags = -1;
112 static int hf_bthci_evt_service_type = -1;
113 static int hf_bthci_evt_token_rate = -1;
114 static int hf_bthci_evt_peak_bandwidth = -1;
115 static int hf_bthci_evt_latency = -1;
116 static int hf_bthci_evt_delay_variation = -1;
117 static int hf_bthci_evt_hardware_code = -1;
118 static int hf_bthci_evt_role = -1;
119 static int hf_bthci_evt_curr_role = -1;
120 static int hf_bthci_evt_curr_mode = -1;
121 static int hf_bthci_evt_interval = -1;
122 static int hf_bthci_evt_link_key = -1;
123 static int hf_bthci_evt_key_type = -1;
124 static int hf_bthci_evt_max_slots = -1;
125 static int hf_bthci_evt_clock_offset = -1;
126 static int hf_bthci_evt_link_type_2dh1 = -1;
127 static int hf_bthci_evt_link_type_3dh1 = -1;
128 static int hf_bthci_evt_link_type_dm1 = -1;
129 static int hf_bthci_evt_link_type_dh1 = -1;
130 static int hf_bthci_evt_link_type_2dh3 = -1;
131 static int hf_bthci_evt_link_type_3dh3 = -1;
132 static int hf_bthci_evt_link_type_dm3 = -1;
133 static int hf_bthci_evt_link_type_dh3 = -1;
134 static int hf_bthci_evt_link_type_2dh5 = -1;
135 static int hf_bthci_evt_link_type_3dh5 = -1;
136 static int hf_bthci_evt_link_type_dm5 = -1;
137 static int hf_bthci_evt_link_type_dh5 = -1;
138 static int hf_bthci_evt_link_type_hv1 = -1;
139 static int hf_bthci_evt_link_type_hv2 = -1;
140 static int hf_bthci_evt_link_type_hv3 = -1;
141 static int hf_bthci_evt_page_scan_mode = -1;
142 static int hf_bthci_evt_page_scan_repetition_mode = -1;
143 static int hf_bthci_evt_page_scan_period_mode = -1;
144 static int hf_bthci_evt_num_keys = -1;
145 static int hf_bthci_evt_num_keys_read = -1;
146 static int hf_bthci_evt_max_num_keys = -1;
147 static int hf_bthci_evt_num_responses = -1;
148 static int hf_bthci_evt_num_keys_written = -1;
149 static int hf_bthci_evt_num_keys_deleted = -1;
150 static int hf_bthci_evt_link_policy_setting_switch = -1;
151 static int hf_bthci_evt_link_policy_setting_hold = -1;
152 static int hf_bthci_evt_link_policy_setting_sniff = -1;
153 static int hf_bthci_evt_link_policy_setting_park = -1;
154 static int hf_bthci_evt_pin_type = -1;
155 static int hf_bthci_evt_device_name = -1;
156 static int hf_bthci_evt_timeout = -1;
157 static int hf_bthci_evt_scan_enable = -1;
158 static int hf_bthci_evt_authentication_enable = -1;
159 static int hf_bthci_evt_sco_flow_cont_enable = -1;
160 static int hf_bthci_evt_window = -1;
161 static int hf_bthci_evt_input_unused = -1;
162 static int hf_bthci_evt_input_coding = -1;
163 static int hf_bthci_evt_input_data_format = -1;
164 static int hf_bthci_evt_input_sample_size = -1;
165 static int hf_bthci_evt_linear_pcm_bit_pos = -1;
166 static int hf_bthci_evt_air_coding_format = -1;
167 static int hf_bthci_evt_num_broadcast_retransm = -1;
168 static int hf_bthci_evt_hold_mode_act_page = -1;
169 static int hf_bthci_evt_hold_mode_act_inquiry = -1;
170 static int hf_bthci_evt_hold_mode_act_periodic = -1;
171 static int hf_bthci_evt_transmit_power_level = -1;
172 static int hf_bthci_evt_transmit_power_level_gfsk = -1;
173 static int hf_bthci_evt_transmit_power_level_dqpsk = -1;
174 static int hf_bthci_evt_transmit_power_level_8dpsk = -1;
175 static int hf_bthci_evt_flush_to_us = -1;
176 static int hf_bthci_evt_num_supp_iac = -1;
177 static int hf_bthci_evt_num_curr_iac = -1;
178 static int hf_bthci_evt_iac_lap = -1;
179 static int hf_bthci_evt_loopback_mode = -1;
180 static int hf_bthci_evt_country_code = -1;
181 static int hf_bthci_evt_failed_contact_counter = -1;
182 static int hf_bthci_evt_link_quality = -1;
183 static int hf_bthci_evt_rssi = -1;
184 static int hf_bthci_evt_host_data_packet_length_acl = -1;
185 static int hf_bthci_evt_host_data_packet_length_sco = -1;
186 static int hf_bthci_evt_host_total_num_acl_data_packets = -1;
187 static int hf_bthci_evt_host_total_num_sco_data_packets = -1;
188 static int hf_bthci_evt_page_number = -1;
189 static int hf_bthci_evt_max_page_number = -1;
190 static int hf_bthci_evt_local_supported_cmds = -1;
191 static int hf_bthci_evt_fec_required = -1;
192 static int hf_bthci_evt_err_data_reporting = -1;
193 static int hf_bthci_evt_scan_type = -1;
194 static int hf_bthci_evt_inq_mode = -1;
195 static int hf_bthci_evt_power_level_type = -1;
196 static int hf_lmp_features = -1;
197 static int hf_lmp_feature_3slot_packets = -1;
198 static int hf_lmp_feature_5slot_packets = -1;
199 static int hf_lmp_feature_encryption = -1;
200 static int hf_lmp_feature_slot_offset = -1;
201 static int hf_lmp_feature_timing_accuracy = -1;
202 static int hf_lmp_feature_role_switch = -1;
203 static int hf_lmp_feature_hold_mode = -1;
204 static int hf_lmp_feature_sniff_mode = -1;
205 static int hf_lmp_feature_park_state = -1;
206 static int hf_lmp_feature_power_control_requests = -1;
207 static int hf_lmp_feature_channel_quality_driven_data_rate = -1;
208 static int hf_lmp_feature_sco_link = -1;
209 static int hf_lmp_feature_hv2_packets = -1;
210 static int hf_lmp_feature_hv3_packets = -1;
211 static int hf_lmp_feature_u_law_log_synchronous_data = -1;
212 static int hf_lmp_feature_a_law_log_synchronous_data = -1;
213 static int hf_lmp_feature_cvsd_synchronous_data = -1;
214 static int hf_lmp_feature_paging_parameter_negotiation = -1;
215 static int hf_lmp_feature_power_control = -1;
216 static int hf_lmp_feature_transparent_synchronous_data = -1;
217 static int hf_lmp_feature_flow_control_lag = -1;
218 static int hf_lmp_feature_broadcast_encryption = -1;
219 static int hf_lmp_feature_reserved_24 = -1;
220 static int hf_lmp_feature_edr_acl_2mbps_mode = -1;
221 static int hf_lmp_feature_edr_acl_3mbps_mode = -1;
222 static int hf_lmp_feature_enhanced_inquiry_scan = -1;
223 static int hf_lmp_feature_interlaced_inquiry_scan = -1;
224 static int hf_lmp_feature_interlaced_page_scan = -1;
225 static int hf_lmp_feature_rssi_with_inquiry_results = -1;
226 static int hf_lmp_feature_ev3_packets = -1;
227 static int hf_lmp_feature_ev4_packets = -1;
228 static int hf_lmp_feature_ev5_packets = -1;
229 static int hf_lmp_feature_reserved_34 = -1;
230 static int hf_lmp_feature_afh_capable_slave = -1;
231 static int hf_lmp_feature_afh_classification_slave = -1;
232 static int hf_lmp_feature_br_edr_not_supported = -1;
233 static int hf_lmp_feature_le_supported_controller = -1;
234 static int hf_lmp_feature_3slot_edr_acl_packets = -1;
235 static int hf_lmp_feature_5slot_edr_acl_packets = -1;
236 static int hf_lmp_feature_sniff_subrating = -1;
237 static int hf_lmp_feature_pause_encryption = -1;
238 static int hf_lmp_feature_afh_capable_master = -1;
239 static int hf_lmp_feature_afh_classification_master = -1;
240 static int hf_lmp_feature_edr_esco_2mbps_mode = -1;
241 static int hf_lmp_feature_edr_esco_3mbps_mode = -1;
242 static int hf_lmp_feature_3slot_edr_esco_packets = -1;
243 static int hf_lmp_feature_extended_inquiry_response = -1;
244 static int hf_lmp_feature_simultaneous_le_and_br_edr_controller = -1;
245 static int hf_lmp_feature_reserved_50 = -1;
246 static int hf_lmp_feature_secure_simple_pairing = -1;
247 static int hf_lmp_feature_encapsulated_pdu = -1;
248 static int hf_lmp_feature_erroneous_data_reporting = -1;
249 static int hf_lmp_feature_non_flushable_packet_boundary_flag = -1;
250 static int hf_lmp_feature_reserved_55 = -1;
251 static int hf_lmp_feature_link_supervision_timeout_changed_event = -1;
252 static int hf_lmp_feature_inquiry_tx_power_level = -1;
253 static int hf_lmp_feature_enhanced_power_control = -1;
254 static int hf_lmp_feature_reserved_59_62 = -1;
255 static int hf_lmp_feature_extended_features = -1;
256 static int hf_lmp_feature_secure_simple_pairing_host = -1;
257 static int hf_lmp_feature_le_supported_host = -1;
258 static int hf_lmp_feature_simultaneous_le_and_br_edr_host = -1;
259 static int hf_lmp_feature_reserved_67_71 = -1;
260 static int hf_lmp_feature_reserved = -1;
261 static int hf_bthci_evt_sync_link_type = -1;
262 static int hf_bthci_evt_sync_tx_interval = -1;
263 static int hf_bthci_evt_sync_rtx_window = -1;
264 static int hf_bthci_evt_sync_rx_packet_length = -1;
265 static int hf_bthci_evt_sync_tx_packet_length = -1;
266 static int hf_bthci_evt_air_mode = -1;
267 static int hf_bthci_evt_max_tx_latency = -1;
268 static int hf_bthci_evt_max_rx_latency = -1;
269 static int hf_bthci_evt_min_remote_timeout = -1;
270 static int hf_bthci_evt_min_local_timeout = -1;
271 static int hf_bthci_evt_link_supervision_timeout = -1;
272 static int hf_bthci_evt_token_bucket_size = -1;
273 static int hf_bthci_evt_flow_direction = -1;
274 static int hf_bthci_evt_afh_ch_assessment_mode = -1;
275 static int hf_bthci_evt_lmp_handle = -1;
276 static int hf_bthci_evt_clock = -1;
277 static int hf_bthci_evt_clock_accuracy = -1;
278 static int hf_bthci_evt_afh_mode = -1;
279 static int hf_bthci_evt_afh_channel_map = -1;
280 static int hf_bthci_evt_simple_pairing_mode = -1;
281 static int hf_bthci_evt_randomizer_r = -1;
282 static int hf_bthci_evt_hash_c = -1;
283 static int hf_bthci_evt_io_capability = -1;
284 static int hf_bthci_evt_oob_data_present = -1;
285 static int hf_bthci_evt_auth_requirements = -1;
286 static int hf_bthci_evt_numeric_value = -1;
287 static int hf_bthci_evt_passkey = -1;
288 static int hf_bthci_evt_notification_type = -1;
289 static int hf_bthci_evt_data = -1;
290 static int hf_bthci_evt_eir_struct_length = -1;
291 static int hf_bthci_evt_eir_struct_type = -1;
292 static int hf_bthci_evt_sc_uuid16 = -1;
293 static int hf_bthci_evt_sc_uuid32 = -1;
294 static int hf_bthci_evt_sc_uuid128 = -1;
295 static int hf_bthci_evt_data_length = -1;
297 static int hf_bthci_evt_location_domain_aware = -1;
298 static int hf_bthci_evt_location_domain = -1;
299 static int hf_bthci_evt_location_domain_options = -1;
300 static int hf_bthci_evt_location_options = -1;
301 static int hf_bthci_evt_flow_control_mode = -1;
302 static int hf_bthci_evt_physical_link_handle = -1;
303 static int hf_bthci_evt_flow_spec_identifier = -1;
304 static int hf_bthci_evt_logical_link_handle = -1;
305 static int hf_bthci_evt_max_acl_data_packet_length = -1;
306 static int hf_bthci_evt_data_block_length = -1;
307 static int hf_bthci_evt_total_num_data_blocks = -1;
308 static int hf_bthci_evt_enc_key_size = -1;
309 static int hf_bthci_evt_amp_remaining_assoc_length = -1;
310 static int hf_bthci_evt_amp_assoc_fragment = -1;
311 static int hf_bthci_evt_amp_status = -1;
312 static int hf_bthci_evt_total_bandwidth = -1;
313 static int hf_bthci_evt_max_guaranteed_bandwidth = -1;
314 static int hf_bthci_evt_min_latency = -1;
315 static int hf_bthci_evt_max_pdu_size = -1;
316 static int hf_bthci_evt_amp_controller_type = -1;
317 static int hf_bthci_evt_pal_capabilities_00 = -1;
318 static int hf_bthci_evt_max_amp_assoc_length = -1;
319 static int hf_bthci_evt_max_flush_to_us = -1;
320 static int hf_bthci_evt_best_effort_flush_to_us = -1;
321 static int hf_bthci_evt_link_loss_reason = -1;
322 static int hf_bthci_evt_num_compl_blocks = -1;
323 static int hf_bthci_evt_test_scenario = -1;
324 static int hf_bthci_evt_report_reason = -1;
325 static int hf_bthci_evt_report_event_type = -1;
326 static int hf_bthci_evt_num_frames = -1;
327 static int hf_bthci_evt_num_error_frames = -1;
328 static int hf_bthci_evt_num_bits = -1;
329 static int hf_bthci_evt_num_error_bits = -1;
330 static int hf_bthci_evt_short_range_mode_state = -1;
331 static int hf_bthci_evt_le_supported_host = -1;
332 static int hf_bthci_evt_le_simultaneous_host = -1;
333 static int hf_bthci_evt_le_acl_data_pkt_len = -1;
334 static int hf_bthci_evt_total_num_le_acl_data_pkts = -1;
335 static int hf_bthci_evt_le_features = -1;
336 static int hf_bthci_evt_le_feature_00 = -1;
337 static int hf_bthci_evt_white_list_size = -1;
338 static int hf_bthci_evt_le_channel_map = -1;
339 static int hf_bthci_evt_encrypted_data = -1;
340 static int hf_bthci_evt_random_number = -1;
341 static int hf_bthci_evt_le_num_packets = -1;
342 static int hf_bthci_evt_le_meta_subevent = -1;
343 static int hf_bthci_evt_le_peer_address_type = -1;
344 static int hf_bthci_evt_le_con_interval = -1;
345 static int hf_bthci_evt_le_con_latency = -1;
346 static int hf_bthci_evt_le_supervision_timeout = -1;
347 static int hf_bthci_evt_encrypted_diversifier = -1;
348 static int hf_bthci_evt_le_master_clock_accuracy = -1;
349 static int hf_bthci_evt_num_reports = -1;
350 static int hf_bthci_evt_advts_event_type = -1;
351 static int hf_bthci_evt_appearance = -1;
352 static int hf_bthci_evt_flags_limited_disc_mode = -1;
353 static int hf_bthci_evt_flags_general_disc_mode = -1;
354 static int hf_bthci_evt_flags_bredr_not_support = -1;
355 static int hf_bthci_evt_flags_le_bredr_support_ctrl = -1;
356 static int hf_bthci_evt_flags_le_bredr_support_host = -1;
357 static int hf_bthci_evt_flags_reserved = -1;
358 static int hf_bthci_evt_oob_flags_oob_data_present = -1;
359 static int hf_bthci_evt_oob_flags_le_supported_host = -1;
360 static int hf_bthci_evt_oob_flags_simultaneous_le_and_br_edr_host = -1;
361 static int hf_bthci_evt_oob_flags_address_type = -1;
362 static int hf_bthci_evt_le_states = -1;
363 static int hf_bthci_evt_le_states_00 = -1;
364 static int hf_bthci_evt_le_states_01 = -1;
365 static int hf_bthci_evt_le_states_02 = -1;
366 static int hf_bthci_evt_le_states_03 = -1;
367 static int hf_bthci_evt_le_states_04 = -1;
368 static int hf_bthci_evt_le_states_05 = -1;
369 static int hf_bthci_evt_le_states_06 = -1;
370 static int hf_bthci_evt_le_states_07 = -1;
371 static int hf_bthci_evt_le_states_10 = -1;
372 static int hf_bthci_evt_le_states_11 = -1;
373 static int hf_bthci_evt_le_states_12 = -1;
374 static int hf_bthci_evt_le_states_13 = -1;
375 static int hf_bthci_evt_le_states_14 = -1;
376 static int hf_bthci_evt_le_states_15 = -1;
377 static int hf_bthci_evt_le_states_16 = -1;
378 static int hf_bthci_evt_le_states_17 = -1;
379 static int hf_bthci_evt_le_states_20 = -1;
380 static int hf_bthci_evt_le_states_21 = -1;
381 static int hf_bthci_evt_le_states_22 = -1;
382 static int hf_bthci_evt_le_states_23 = -1;
383 static int hf_bthci_evt_le_states_24 = -1;
384 static int hf_bthci_evt_le_states_25 = -1;
385 static int hf_bthci_evt_le_states_26 = -1;
386 static int hf_bthci_evt_le_states_27 = -1;
387 static int hf_bthci_evt_le_states_30 = -1;
388 static int hf_bthci_evt_le_states_31 = -1;
389 static int hf_bthci_evt_le_states_32 = -1;
390 static int hf_bthci_evt_le_states_33 = -1;
391 static int hf_bthci_evt_le_states_34 = -1;
392 static int hf_bthci_evt_eir_ad_ssp_oob_length = -1;
393 static int hf_bthci_evt_eir_ad_advertising_interval = -1;
394 static int hf_bthci_evt_eir_ad_company_id = -1;
395 static int hf_eir_ad_item = -1;
396 static int hf_extended_inquiry_response_data = -1;
397 static int hf_advertising_data = -1;
398 static int hf_usable_packet_types = -1;
399 static int hf_3ds_association_notification = -1;
400 static int hf_3ds_battery_level_reporting = -1;
401 static int hf_3ds_send_battery_level_report_on_startup = -1;
402 static int hf_3ds_reserved = -1;
403 static int hf_3ds_factory_test_mode = -1;
404 static int hf_3ds_path_loss_threshold = -1;
405 static int hf_3ds_legacy_fixed = -1;
406 static int hf_3ds_legacy_3d_capable_tv = -1;
407 static int hf_3ds_legacy_ignored_1_3 = -1;
408 static int hf_3ds_legacy_fixed_4 = -1;
409 static int hf_3ds_legacy_ignored_5 = -1;
410 static int hf_3ds_legacy_fixed_6 = -1;
411 static int hf_3ds_legacy_test_mode = -1;
412 static int hf_3ds_legacy_path_loss_threshold = -1;
413 static int hf_did_vendor_id = -1;
414 static int hf_did_vendor_id_bluetooth_sig = -1;
415 static int hf_did_vendor_id_usb_forum = -1;
416 static int hf_did_product_id = -1;
417 static int hf_did_version = -1;
418 static int hf_did_vendor_id_source = -1;
420 static expert_field ei_eir_undecoded = EI_INIT;
421 static expert_field ei_eir_unknown = EI_INIT;
422 static expert_field ei_event_undecoded = EI_INIT;
423 static expert_field ei_event_unknown = EI_INIT;
425 /* Initialize the subtree pointers */
426 static gint ett_bthci_evt = -1;
427 static gint ett_opcode = -1;
428 static gint ett_cod = -1;
429 static gint ett_lmp_subtree = -1;
430 static gint ett_ptype_subtree = -1;
431 static gint ett_eir_subtree = -1;
432 static gint ett_eir_struct_subtree = -1;
433 static gint ett_le_state_subtree = -1;
435 extern value_string_ext ext_usb_vendors_vals;
436 extern value_string_ext ext_usb_products_vals;
437 extern value_string_ext did_vendor_id_source_vals_ext;
439 static const value_string evt_code_vals[] = {
440 {0x01, "Inquiry Complete"},
441 {0x02, "Inquiry Result"},
442 {0x03, "Connect Complete"},
443 {0x04, "Connect Request"},
444 {0x05, "Disconnect Complete"},
445 {0x06, "Auth Complete"},
446 {0x07, "Remote Name Req Complete"},
447 {0x08, "Encrypt Change"},
448 {0x09, "Change Connection Link Key Complete"},
449 {0x0a, "Master Link Key Complete"},
450 {0x0b, "Read Remote Supported Features"},
451 {0x0c, "Read Remote Ver Info Complete"},
452 {0x0d, "QoS Setup Complete"},
453 {0x0e, "Command Complete"},
454 {0x0f, "Command Status"},
455 {0x10, "Hardware Error"},
456 {0x11, "Flush Occurred"},
457 {0x12, "Role Change"},
458 {0x13, "Number of Completed Packets"},
459 {0x14, "Mode Change"},
460 {0x15, "Return Link Keys"},
461 {0x16, "PIN Code Request"},
462 {0x17, "Link Key Request"},
463 {0x18, "Link Key Notification"},
464 {0x19, "Loopback Command"},
465 {0x1a, "Data Buffer Overflow"},
466 {0x1b, "Max Slots Change"},
467 {0x1c, "Read Clock Offset Complete"},
468 {0x1d, "Connection Packet Type Changed"},
469 {0x1e, "QoS Violation"},
470 {0x1f, "Page Scan Mode Change"},
471 {0x20, "Page Scan Repetition Mode Change"},
472 {0x21, "Flow Specification Complete"},
473 {0x22, "Inquiry Result With RSSI"},
474 {0x23, "Read Remote Extended Features Complete"},
475 {0x2c, "Synchronous Connection Complete"},
476 {0x2d, "Synchronous Connection Changed"},
477 {0x2e, "Sniff Subrating"},
478 {0x2f, "Extended Inquiry Result"},
479 {0x30, "Encryption Key Refresh Complete"},
480 {0x31, "IO Capability Request"},
481 {0x32, "IO Capability Response"},
482 {0x33, "User Confirmation Request"},
483 {0x34, "User Passkey Request"},
484 {0x35, "Remote OOB Data Request"},
485 {0x36, "Simple Pairing Complete"},
486 {0x38, "Link Supervision Timeout Changed"},
487 {0x39, "Enhanced Flush Complete"},
488 {0x3b, "User Passkey Notification"},
489 {0x3c, "Keypress Notification"},
490 {0x3d, "Remote Host Supported Features Notification"},
491 {0x3e, "LE Meta"},
492 {0x40, "Physical Link Complete"},
493 {0x41, "Channel Selected"},
494 {0x42, "Disconnect Physical Link Complete"},
495 {0x43, "Physical Link Loss Early Warning"},
496 {0x44, "Physical Link Recovery"},
497 {0x45, "Logical Link Complete"},
498 {0x46, "Disconnect Logical Link Complete"},
499 {0x47, "Flow Spec Modify Complete"},
500 {0x48, "Number Of Completed Data Blocks"},
501 {0x49, "AMP Start Test"},
502 {0x4a, "AMP Test End"},
503 {0x4b, "AMP Receiver Report"},
504 {0x4c, "Short Range Mode Change Complete"},
505 {0x4d, "AMP Status Change"},
506 /* From "Bluetooth Core Specification Addendum 4 */
507 {0x4e, "Triggered Clock Capture"},
508 {0x4f, "Synchronization Train Complete"},
509 {0x50, "Synchronization Train Received"},
510 {0x51, "Connectionless Slave Broadcast Receive"},
511 {0x52, "Connectionless Slave Broadcast Timeout"},
512 {0x53, "Truncated Page Complete"},
513 {0x54, "Slave Page Response Timeout"},
514 {0x55, "Connectionless Slave Broadcast Channel Map Change"},
515 {0x56, "Inquiry Response Notification"},
516 /* Other */
517 {0xfe, "Bluetooth Logo Testing"},
518 {0xff, "Vendor-Specific"},
519 {0, NULL}
522 static const value_string bthci_cmd_status_pending_vals[] = {
523 {0x00, "Pending"},
524 {0, NULL }
527 static const value_string evt_link_types[] = {
528 {0x00, "SCO connection (Voice Channels)"},
529 {0x01, "ACL connection (Data Channels)"},
530 {0x02, "eSCO connection (Voice Channels)"},
531 {0, NULL }
534 static const value_string evt_sync_link_types[] = {
535 {0x00, "SCO connection"},
536 {0x02, "eSCO connection"},
537 {0, NULL }
540 static const value_string evt_encryption_modes[] = {
541 {0x00, "Encryption Disabled"},
542 {0x01, "Encryption only for point-to-point packets"},
543 {0x02, "Encryption for both point-to-point and broadcast packets"},
544 {0, NULL }
547 static const value_string evt_encryption_enable[] = {
548 {0x00, "Link Level Encryption is OFF"},
549 {0x01, "Link Level Encryption is ON"},
550 {0, NULL }
553 static const value_string evt_key_flag[] = {
554 {0x00, "Using Semi-permanent Link Key"},
555 {0x01, "Using Temporary Link Key"},
556 {0, NULL }
559 /* Taken from https://www.bluetooth.org/Technical/AssignedNumbers/link_manager.htm */
560 static const value_string evt_lmp_vers_nr[] = {
561 {0x00, "1.0b"},
562 {0x01, "1.1"},
563 {0x02, "1.2"},
564 {0x03, "2.0 + EDR"},
565 {0x04, "2.1 + EDR"},
566 {0x05, "3.0 + HS"},
567 {0x06, "4.0"},
568 {0, NULL }
571 /* Taken from https://www.bluetooth.org/Technical/AssignedNumbers/hci.htm
572 * (requires a login/password)
574 static const value_string evt_hci_vers_nr[] = {
575 {0x00, "1.0b"},
576 {0x01, "1.1"},
577 {0x02, "1.2"},
578 {0x03, "2.0 + EDR"},
579 {0x04, "2.1 + EDR"},
580 {0x05, "3.0 + HS"},
581 {0x06, "4.0"},
582 {0, NULL }
585 /* Taken from https://www.bluetooth.org/technical/assignednumbers/identifiers.htm */
586 static const value_string bthci_evt_comp_id[] = {
587 {0x0000, "Ericsson Technology Licensing"},
588 {0x0001, "Nokia Mobile Phones"},
589 {0x0002, "Intel Corp."},
590 {0x0003, "IBM Corp."},
591 {0x0004, "Toshiba Corp."},
592 {0x0005, "3Com"},
593 {0x0006, "Microsoft"},
594 {0x0007, "Lucent"},
595 {0x0008, "Motorola"},
596 {0x0009, "Infineon Technologies AG"},
597 {0x000A, "Cambridge Silicon Radio"},
598 {0x000B, "Silicon Wave"},
599 {0x000C, "Digianswer A/S"},
600 {0x000D, "Texas Instruments Inc."},
601 {0x000E, "Ceva, Inc. (formerly Parthus Technologies, Inc.)"},
602 {0x000F, "Broadcom Corporation"},
603 {0x0010, "Mitel Semiconductor"},
604 {0x0011, "Widcomm, Inc."},
605 {0x0012, "Zeevo, Inc."},
606 {0x0013, "Atmel Corporation"},
607 {0x0014, "Mitsubishi Electric Corporation"},
608 {0x0015, "RTX Telecom A/S"},
609 {0x0016, "KC Technology Inc."},
610 {0x0017, "Newlogic"},
611 {0x0018, "Transilica, Inc."},
612 {0x0019, "Rohde & Schwarz GmbH & Co. KG"},
613 {0x001A, "TTPCom Limited"},
614 {0x001B, "Signia Technologies, Inc."},
615 {0x001C, "Conexant Systems Inc."},
616 {0x001D, "Qualcomm"},
617 {0x001E, "Inventel"},
618 {0x001F, "AVM Berlin"},
619 {0x0020, "BandSpeed, Inc."},
620 {0x0021, "Mansella Ltd"},
621 {0x0022, "NEC Corporation"},
622 {0x0023, "WavePlus Technology Co., Ltd."},
623 {0x0024, "Alcatel"},
624 {0x0025, "Philips Semiconductors"},
625 {0x0026, "C Technologies"},
626 {0x0027, "Open Interface"},
627 {0x0028, "R F Micro Devices"},
628 {0x0029, "Hitachi Ltd"},
629 {0x002A, "Symbol Technologies, Inc."},
630 {0x002B, "Tenovis"},
631 {0x002C, "Macronix International Co. Ltd."},
632 {0x002D, "GCT Semiconductor"},
633 {0x002E, "Norwood Systems"},
634 {0x002F, "MewTel Technology Inc."},
635 {0x0030, "ST Microelectronics"},
636 {0x0031, "Synopsys"},
637 {0x0032, "Red-M (Communications) Ltd"},
638 {0x0033, "Commil Ltd"},
639 {0x0034, "Computer Access Technology Corporation (CATC)"},
640 {0x0035, "Eclipse (HQ Espana) S.L."},
641 {0x0036, "Renesas Technology Corp."},
642 {0x0037, "Mobilian Corporation"},
643 {0x0038, "Terax"},
644 {0x0039, "Integrated System Solution Corp."},
645 {0x003A, "Matsushita Electric Industrial Co., Ltd."},
646 {0x003B, "Gennum Corporation"},
647 {0x003C, "Research In Motion"},
648 {0x003D, "IPextreme, Inc."},
649 {0x003E, "Systems and Chips, Inc"},
650 {0x003F, "Bluetooth SIG, Inc"},
651 {0x0040, "Seiko Epson Corporation"},
652 {0x0041, "Integrated Silicon Solution Taiwan, Inc."},
653 {0x0042, "CONWISE Technology Corporation Ltd"},
654 {0x0043, "PARROT SA"},
655 {0x0044, "Socket Mobile"},
656 {0x0045, "Atheros Communications, Inc."},
657 {0x0046, "MediaTek, Inc."},
658 {0x0047, "Bluegiga"},
659 {0x0048, "Marvell Technology Group Ltd."},
660 {0x0049, "3DSP Corporation"},
661 {0x004A, "Accel Semiconductor Ltd."},
662 {0x004B, "Continental Automotive Systems"},
663 {0x004C, "Apple, Inc."},
664 {0x004D, "Staccato Communications, Inc."},
665 {0x004E, "Avago Technologies"},
666 {0x004F, "APT Licensing Ltd."},
667 {0x0050, "SiRF Technology, Inc."},
668 {0x0051, "Tzero Technologies, Inc."},
669 {0x0052, "J&M Corporation"},
670 {0x0053, "Free2move AB"},
671 {0x0054, "3DiJoy Corporation"},
672 {0x0055, "Plantronics, Inc."},
673 {0x0056, "Sony Ericsson Mobile Communications"},
674 {0x0057, "Harman International Industries, Inc."},
675 {0x0058, "Vizio, Inc."},
676 {0x0059, "Nordic Semiconductor ASA"},
677 {0x005A, "EM Microelectronic-Marin SA"},
678 {0x005B, "Ralink Technology Corporation"},
679 {0x005C, "Belkin International, Inc."},
680 {0x005D, "Realtek Semiconductor Corporation"},
681 {0x005E, "Stonestreet One, LLC"},
682 {0x005F, "Wicentric, Inc."},
683 {0x0060, "RivieraWaves S.A.S"},
684 {0x0061, "RDA Microelectronics"},
685 {0x0062, "Gibson Guitars"},
686 {0x0063, "MiCommand Inc."},
687 {0x0064, "Band XI International, LLC"},
688 {0x0065, "Hewlett-Packard Company"},
689 {0x0066, "9Solutions Oy"},
690 {0x0067, "GN Netcom A/S"},
691 {0x0068, "General Motors"},
692 {0x0069, "A&D Engineering, Inc."},
693 {0x006A, "MindTree Ltd."},
694 {0x006B, "Polar Electro OY"},
695 {0x006C, "Beautiful Enterprise Co., Ltd."},
696 {0x006D, "BriarTek, Inc."},
697 {0x006E, "Summit Data Communications, Inc."},
698 {0x006F, "Sound ID"},
699 {0x0070, "Monster, LLC"},
700 {0x0071, "connectBlue AB"},
701 {0x0072, "ShangHai Super Smart Electronics Co. Ltd."},
702 {0x0073, "Group Sense Ltd."},
703 {0x0074, "Zomm, LLC"},
704 {0x0075, "Samsung Electronics Co. Ltd."},
705 {0x0076, "Creative Technology Ltd."},
706 {0x0077, "Laird Technologies"},
707 {0x0078, "Nike, Inc."},
708 {0x0079, "lesswire AG"},
709 {0x007A, "MStar Semiconductor, Inc."},
710 {0x007B, "Hanlynn Technologies"},
711 {0x007C, "A & R Cambridge"},
712 {0x007D, "Seers Technology Co. Ltd."},
713 {0x007E, "Sports Tracking Technologies Ltd."},
714 {0x007F, "Autonet Mobile"},
715 {0x0080, "DeLorme Publishing Company, Inc."},
716 {0x0081, "WuXi Vimicro"},
717 {0x0082, "Sennheiser Communications A/S"},
718 {0x0083, "TimeKeeping Systems, Inc."},
719 {0x0084, "Ludus Helsinki Ltd."},
720 {0x0085, "BlueRadios, Inc."},
721 {0x0086, "equinux AG"},
722 {0x0087, "Garmin International, Inc."},
723 {0x0088, "Ecotest"},
724 {0x0089, "GN ReSound A/S"},
725 {0x008A, "Jawbone"},
726 {0x008B, "Topcon Positioning Systems, LLC"},
727 {0x008C, "Qualcomm Labs, Inc."},
728 {0x008D, "Zscan Software"},
729 {0x008E, "Quintic Corp."},
730 {0x008F, "Stollmann E+V GmbH"},
731 {0x0090, "Funai Electric Co., Ltd."},
732 {0x0091, "Advanced PANMOBIL systems GmbH & Co. KG"},
733 {0x0092, "ThinkOptics, Inc."},
734 {0x0093, "Universal Electronics, Inc."},
735 {0x0094, "Airoha Technology Corp."},
736 {0x0095, "NEC Lighting, Ltd."},
737 {0x0096, "ODM Technology, Inc."},
738 {0x0097, "Bluetrek Technologies Limited"},
739 {0x0098, "zero1.tv GmbH"},
740 {0x0099, "i.Tech Dynamic Global Distribution Ltd."},
741 {0x009A, "Alpwise"},
742 {0x009B, "Jiangsu Toppower Automotive Electronics Co., Ltd."},
743 {0x009C, "Colorfy, Inc."},
744 {0x009D, "Geoforce Inc."},
745 {0x009E, "Bose Corporation"},
746 {0x009F, "Suunto Oy"},
747 {0x00A0, "Kensington Computer Products Group"},
748 {0x00A1, "SR-Medizinelektronik"},
749 {0x00A2, "Vertu Corporation Limited"},
750 {0x00A3, "Meta Watch Ltd."},
751 {0x00A4, "LINAK A/S"},
752 {0x00A5, "OTL Dynamics LLC"},
753 {0x00A6, "Panda Ocean Inc."},
754 {0x00A7, "Visteon Corporation"},
755 {0x00A8, "ARP Devices Limited"},
756 {0x00A9, "Magneti Marelli S.p.A."},
757 {0x00AA, "CAEN RFID srl"},
758 {0x00AB, "Ingenieur-Systemgruppe Zahn GmbH"},
759 {0x00AC, "Green Throttle Games"},
760 {0x00AD, "Peter Systemtechnik GmbH"},
761 {0x00AE, "Omegawave Oy"},
762 {0x00AF, "Cinetix"},
763 {0x00B0, "Passif Semiconductor Corp"},
764 {0x00B1, "Saris Cycling Group, Inc"},
765 {0x00B2, "Bekey A/S"},
766 {0x00B3, "Clarinox Technologies Pty. Ltd."},
767 {0x00B4, "BDE Technology Co., Ltd."},
768 {0x00B5, "Swirl Networks"},
769 {0x00B6, "Meso international"},
770 {0x00B7, "TreLab Ltd"},
771 {0x00B8, "Qualcomm Innovation Center, Inc. (QuIC)"},
772 {0x00B9, "Johnson Controls, Inc."},
773 {0x00BA, "Starkey Laboratories Inc."},
774 {0x00BB, "S-Power Electronics Limited"},
775 {0xFFFF, "For use in internal and interoperability tests."},
776 {0, NULL }
778 value_string_ext bthci_evt_comp_id_ext = VALUE_STRING_EXT_INIT(bthci_evt_comp_id);
780 static const value_string evt_service_types[] = {
781 {0x00, "No Traffic Available"},
782 {0x01, "Best Effort Available"},
783 {0x02, "Guaranteed Available"},
784 {0, NULL }
787 static const value_string evt_role_vals[] = {
788 {0x00, "Currently the Master for specified BD_ADDR"},
789 {0x01, "Currently the Slave for specified BD_ADDR"},
790 {0, NULL }
793 static const value_string evt_role_vals_handle[] = {
794 {0x00, "Currently the Master for this connection handle"},
795 {0x01, "Currently the Slave for this connection handle"},
796 {0, NULL }
799 static const value_string evt_modes[] = {
800 {0x00, "Active Mode"},
801 {0x01, "Hold Mode"},
802 {0x02, "Sniff Mode"},
803 {0x03, "Park Mode"},
804 {0, NULL }
807 static const value_string evt_key_types[] = {
808 {0x00, "Combination Key"},
809 {0x01, "Local Unit Key"},
810 {0x02, "Remote Unit Key"},
811 {0x03, "Debug Combination Key"},
812 {0x04, "Unauthenticated Combination Key"},
813 {0x05, "Authenticated Combination Key"},
814 {0x06, "Changed Combination Key"},
815 {0, NULL }
818 static const value_string evt_scan_types[] = {
819 {0x00, "Standard Scan" },
820 {0x01, "Interlaced Scan" },
821 {0, NULL }
824 static const value_string evt_inq_modes[] = {
825 {0x00, "Standard Results" },
826 {0x01, "Results With RSSI" },
827 {0x02, "Results With RSSI or Extended Results" },
828 {0, NULL }
831 static const value_string evt_power_level_types[] = {
832 {0x00, "Read Current Transmission Power Level" },
833 {0x01, "Read Maximum Transmission Power Level" },
834 {0, NULL }
837 static const value_string evt_pin_types[] = {
838 {0x00, "Variable PIN" },
839 {0x01, "Fixed PIN" },
840 {0, NULL }
843 static const value_string evt_auth_enable_values[] = {
844 {0x00, "Disabled" },
845 {0x01, "Enabled for all connections "},
846 {0, NULL }
849 static const value_string evt_enable_values[] = {
850 {0x00, "Disabled" },
851 {0x01, "Enabled"},
852 {0, NULL }
855 static const value_string evt_loopback_modes[] = {
856 {0x00, "No Loopback mode enabled" },
857 {0x01, "Enable Local Loopback" },
858 {0x02, "Enable Remote Loopback" },
859 {0, NULL }
862 static const value_string evt_country_code_values[] = {
863 {0x0, "North America & Europe (except France) and Japan" },
864 {0x1, "France" },
865 {0, NULL }
868 static const value_string evt_flow_direction_values[] = {
869 {0x0, "Outgoing Traffic" },
870 {0x1, "Incoming Traffic" },
871 {0, NULL }
874 static const value_string evt_flow_ctrl_mode[] = {
875 { 0x00, "Packet based" },
876 { 0x01, "Data Block based" },
877 { 0, NULL }
880 static const value_string evt_amp_status[] = {
881 { 0x00, "Controller available but currently physically powered down" },
882 { 0x01, "Controller available exclusively for Bluetooth" },
883 { 0x02, "No capacity available for Bluetooth operation" },
884 { 0x03, "Low capacity available for Bluetooth operation" },
885 { 0x04, "Medium capacity available for Bluetooth operation" },
886 { 0x05, "High capacity available for Bluetooth operation" },
887 { 0x06, "Full capacity available for Bluetooth operation" },
888 { 0, NULL }
891 static const value_string evt_controller_types[] = {
892 { 0x00, "Primary BR/EDR" },
893 { 0x01, "802.11 AMP" },
894 { 0, NULL }
897 static const value_string evt_link_loss_reasons[] = {
898 { 0x00, "Unknown" },
899 { 0x01, "Range related" },
900 { 0x02, "Bandwidth related" },
901 { 0x03, "Resolving Conflict" },
902 { 0x04, "Interference" },
903 { 0, NULL }
906 static const value_string evt_report_reasons[] = {
907 { 0x00, "Configured Interval" },
908 { 0x01, "Test Ended" },
909 { 0, NULL }
912 static const value_string evt_report_event_types[] = {
913 { 0x00, "Frames Received" },
914 { 0x01, "Frames Received & Bits in Error" },
915 { 0, NULL }
918 static const value_string evt_le_meta_subevent[] = {
919 { 0x01, "LE Connection Complete" },
920 { 0x02, "LE Advertising Report" },
921 { 0x03, "LE Connection Update Complete" },
922 { 0x04, "LE Read Remote Used Features Complete" },
923 { 0x05, "LE Long Term Key Request" },
924 { 0, NULL }
927 static const value_string evt_le_advertising_evt_types[] = {
928 { 0x00, "Connectable Unidirected Advertising" },
929 { 0x01, "Connectable Directed Advertising" },
930 { 0x02, "Scannable Unidirected Advertising" },
931 { 0x03, "Non-Connectable Unidirected Advertising" },
932 { 0x04, "Scan Response" },
933 { 0, NULL }
936 static const value_string evt_master_clock_accuray[] = {
937 { 0x00, "500 ppm" },
938 { 0x01, "250 ppm" },
939 { 0x02, "150 ppm" },
940 { 0x03, "100 ppm" },
941 { 0x04, "75 ppm" },
942 { 0x05, "50 ppm" },
943 { 0x06, "30 ppm" },
944 { 0x07, "20 ppm" },
945 { 0, NULL }
948 static const value_string evt_air_mode_vals[] = {
949 { 0x00, "\xb5-law log" },
950 { 0x01, "A-law log" },
951 { 0x02, "CVSD" },
952 { 0x03, "Transparent Data" },
953 { 0, NULL }
956 void proto_register_bthci_evt(void);
957 void proto_reg_handoff_bthci_evt(void);
959 static int
960 dissect_bthci_evt_bd_addr(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
961 proto_tree *tree, guint8 *bdaddr)
963 guint8 bd_addr[6];
965 bd_addr[5] = tvb_get_guint8(tvb, offset);
966 bd_addr[4] = tvb_get_guint8(tvb, offset + 1);
967 bd_addr[3] = tvb_get_guint8(tvb, offset + 2);
968 bd_addr[2] = tvb_get_guint8(tvb, offset + 3);
969 bd_addr[1] = tvb_get_guint8(tvb, offset + 4);
970 bd_addr[0] = tvb_get_guint8(tvb, offset + 5);
972 if (bdaddr)
973 memcpy(bdaddr, bd_addr, 6);
975 proto_tree_add_ether(tree, hf_bthci_evt_bd_addr, tvb, offset, 6, bd_addr);
976 offset += 6;
978 return offset;
981 static int
982 dissect_bthci_evt_cod(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
984 guint16 major_service_classes;
985 guint8 major_device_class;
986 guint8 minor_device_class;
987 const gchar *minor_device_class_name;
988 proto_item *cod_item;
989 proto_item *cod_tree;
991 cod_item = proto_tree_add_item(tree, hf_bthci_evt_class_of_device, tvb, offset, 3, ENC_LITTLE_ENDIAN);
992 cod_tree = proto_item_add_subtree(cod_item, ett_cod);
994 major_device_class = tvb_get_guint8(tvb, offset + 1) & 0x1F;
995 minor_device_class = tvb_get_guint8(tvb, offset) >> 2;
997 switch(major_device_class) {
998 case 0x01: /* Computer */
999 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_minor_device_class_computer, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1000 minor_device_class_name = val_to_str_ext_const(minor_device_class, &bthci_cmd_cod_minor_device_class_computer_vals_ext, "Unknown");
1001 break;
1002 case 0x02: /* Phone */
1003 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_minor_device_class_phone, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1004 minor_device_class_name = val_to_str_ext_const(minor_device_class, &bthci_cmd_cod_minor_device_class_phone_vals_ext, "Unknown");
1005 break;
1006 case 0x03: /* LAN/Network Access Point */
1007 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_minor_device_class_lan_net_load_factor, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1008 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_minor_device_class_lan_net_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1009 minor_device_class_name = val_to_str_ext_const(minor_device_class, &bthci_cmd_cod_minor_device_class_lan_net_load_factor_vals_ext, "Unknown");
1010 break;
1011 case 0x04: /* Audio/Video */
1012 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_minor_device_class_audio_video, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1013 minor_device_class_name = val_to_str_ext_const(minor_device_class, &bthci_cmd_cod_minor_device_class_audio_video_vals_ext, "Unknown");
1014 break;
1015 case 0x05: /* Peripheral */
1016 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_minor_device_class_peripheral_class, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1017 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_minor_device_class_peripheral_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1018 minor_device_class_name = val_to_str_ext_const(minor_device_class, &bthci_cmd_cod_minor_device_class_peripheral_class_vals_ext, "Unknown");
1019 break;
1020 case 0x06: /* Imaging */
1021 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_minor_device_class_imaging_class_printer, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1022 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_minor_device_class_imaging_class_scanner, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1023 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_minor_device_class_imaging_class_camera, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1024 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_minor_device_class_imaging_class_display, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1026 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_minor_device_class_imaging_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1027 minor_device_class_name = val_to_str_ext_const(minor_device_class, &bthci_cmd_cod_minor_device_class_imaging_type_vals_ext, "Unknown");
1028 break;
1029 case 0x07: /* Wearable */
1030 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_minor_device_class_wearable, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1031 minor_device_class_name = val_to_str_ext_const(minor_device_class, &bthci_cmd_cod_minor_device_class_wearable_vals_ext, "Unknown");
1032 break;
1033 case 0x08: /* Toy */
1034 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_minor_device_class_toy, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1035 minor_device_class_name = val_to_str_ext_const(minor_device_class, &bthci_cmd_cod_minor_device_class_toy_vals_ext, "Unknown");
1036 break;
1037 case 0x09: /* Health */
1038 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_minor_device_class_health, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1039 minor_device_class_name = val_to_str_ext_const(minor_device_class, &bthci_cmd_cod_minor_device_class_health_vals_ext, "Unknown");
1040 break;
1041 default:
1042 minor_device_class_name = "Unknown";
1043 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_minor_device_class_unknown, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1046 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_format_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1047 offset += 1;
1049 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_major_service_class_information, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1050 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_major_service_class_telephony, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1051 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_major_service_class_audio, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1052 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_major_service_class_object_transfer, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1053 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_major_service_class_capturing, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1054 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_major_service_class_rendering, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1055 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_major_service_class_networking, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1056 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_major_service_class_positioning, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1057 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_major_service_class_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1058 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_major_service_class_limited_discoverable_mode, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1059 major_service_classes = tvb_get_letohs(tvb, offset) >> 5;
1061 proto_tree_add_item(cod_tree, hf_bthci_evt_cod_major_device_class, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1062 offset += 2;
1064 proto_item_append_text(cod_item, " (%s:%s - services:",
1065 val_to_str_ext_const(major_device_class, &bthci_cmd_cod_major_device_class_vals_ext, "Unknown"),
1066 minor_device_class_name);
1068 if (major_service_classes & 0x001) proto_item_append_text(cod_item, " LimitedDiscoverableMode");
1069 if (major_service_classes & 0x008) proto_item_append_text(cod_item, " Positioning");
1070 if (major_service_classes & 0x010) proto_item_append_text(cod_item, " Networking");
1072 if (major_service_classes & 0x020) proto_item_append_text(cod_item, " Rendering");
1073 if (major_service_classes & 0x040) proto_item_append_text(cod_item, " Capturing");
1074 if (major_service_classes & 0x080) proto_item_append_text(cod_item, " ObjectTransfer");
1075 if (major_service_classes & 0x100) proto_item_append_text(cod_item, " Audio");
1076 if (major_service_classes & 0x200) proto_item_append_text(cod_item, " Telephony");
1077 if (major_service_classes & 0x400) proto_item_append_text(cod_item, " Information");
1079 proto_item_append_text(cod_item, ")");
1081 return offset;
1084 static int
1085 dissect_bthci_evt_inq_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1087 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1088 offset++;
1090 return offset;
1093 static int
1094 dissect_bthci_evt_conn_complete(tvbuff_t *tvb, int offset, packet_info *pinfo,
1095 proto_tree *tree, hci_data_t *hci_data)
1097 guint16 connection_handle;
1098 guint8 bd_addr[6];
1099 guint8 status;
1101 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1102 status = tvb_get_guint8(tvb, offset);
1103 offset++;
1105 connection_handle = tvb_get_letohs(tvb, offset) & 0x0FFF;
1106 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1107 offset+=2;
1109 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, bd_addr);
1110 if (!pinfo->fd->flags.visited && hci_data != NULL && status == 0x00) {
1111 wmem_tree_key_t key[5];
1112 guint32 k_interface_id;
1113 guint32 k_adapter_id;
1114 guint32 k_connection_handle;
1115 guint32 k_frame_number;
1116 remote_bdaddr_t *remote_bdaddr;
1118 k_interface_id = hci_data->interface_id;
1119 k_adapter_id = hci_data->adapter_id;
1120 k_connection_handle = connection_handle;
1121 k_frame_number = pinfo->fd->num;
1123 key[0].length = 1;
1124 key[0].key = &k_interface_id;
1125 key[1].length = 1;
1126 key[1].key = &k_adapter_id;
1127 key[2].length = 1;
1128 key[2].key = &k_connection_handle;
1129 key[3].length = 1;
1130 key[3].key = &k_frame_number;
1131 key[4].length = 0;
1132 key[4].key = NULL;
1134 remote_bdaddr = (remote_bdaddr_t *) wmem_new(wmem_file_scope(), remote_bdaddr_t);
1135 remote_bdaddr->interface_id = hci_data->interface_id;
1136 remote_bdaddr->adapter_id = hci_data->adapter_id;
1137 remote_bdaddr->chandle = connection_handle;
1138 memcpy(remote_bdaddr->bd_addr, bd_addr, 6);
1140 wmem_tree_insert32_array(hci_data->chandle_to_bdaddr_table, key, remote_bdaddr);
1144 proto_tree_add_item(tree, hf_bthci_evt_link_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1145 offset++;
1147 proto_tree_add_item(tree, hf_bthci_evt_encryption_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1148 offset++;
1150 return offset;
1153 static int
1154 dissect_bthci_evt_conn_request(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
1156 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, NULL);
1158 offset = dissect_bthci_evt_cod(tvb, offset, pinfo, tree);
1160 proto_tree_add_item(tree, hf_bthci_evt_link_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1161 offset++;
1163 return offset;
1166 static int
1167 dissect_bthci_evt_disconn_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1169 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1170 offset++;
1172 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1173 offset+=2;
1175 proto_tree_add_item(tree, hf_bthci_evt_reason, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1176 offset++;
1178 return offset;
1181 static int
1182 dissect_bthci_evt_auth_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1184 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1185 offset++;
1187 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1188 offset+=2;
1190 return offset;
1193 static int
1194 dissect_bthci_evt_lmp_features(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, guint8 page_numer)
1196 guint8 fc_lag;
1197 proto_item *fl_lag_item;
1198 proto_tree *lmp_tree = NULL;
1200 if (tree) {
1201 proto_item *lmp_item;
1203 lmp_item = proto_tree_add_item(tree, hf_lmp_features, tvb, offset, 8, ENC_NA);
1204 lmp_tree = proto_item_add_subtree(lmp_item, ett_lmp_subtree);
1207 switch (page_numer) {
1208 case 0:
1209 proto_tree_add_item(lmp_tree, hf_lmp_feature_3slot_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1210 proto_tree_add_item(lmp_tree, hf_lmp_feature_5slot_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1211 proto_tree_add_item(lmp_tree, hf_lmp_feature_encryption, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1212 proto_tree_add_item(lmp_tree, hf_lmp_feature_slot_offset, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1213 proto_tree_add_item(lmp_tree, hf_lmp_feature_timing_accuracy, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1214 proto_tree_add_item(lmp_tree, hf_lmp_feature_role_switch, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1215 proto_tree_add_item(lmp_tree, hf_lmp_feature_hold_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1216 proto_tree_add_item(lmp_tree, hf_lmp_feature_sniff_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1217 offset++;
1219 proto_tree_add_item(lmp_tree, hf_lmp_feature_park_state, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1220 proto_tree_add_item(lmp_tree, hf_lmp_feature_power_control_requests, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1221 proto_tree_add_item(lmp_tree, hf_lmp_feature_channel_quality_driven_data_rate, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1222 proto_tree_add_item(lmp_tree, hf_lmp_feature_sco_link, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1223 proto_tree_add_item(lmp_tree, hf_lmp_feature_hv2_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1224 proto_tree_add_item(lmp_tree, hf_lmp_feature_hv3_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1225 proto_tree_add_item(lmp_tree, hf_lmp_feature_u_law_log_synchronous_data, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1226 proto_tree_add_item(lmp_tree, hf_lmp_feature_a_law_log_synchronous_data, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1227 offset++;
1229 proto_tree_add_item(lmp_tree, hf_lmp_feature_cvsd_synchronous_data, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1230 proto_tree_add_item(lmp_tree, hf_lmp_feature_paging_parameter_negotiation, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1231 proto_tree_add_item(lmp_tree, hf_lmp_feature_power_control, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1232 proto_tree_add_item(lmp_tree, hf_lmp_feature_transparent_synchronous_data, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1233 fl_lag_item = proto_tree_add_item(lmp_tree,hf_lmp_feature_flow_control_lag, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1234 fc_lag = (tvb_get_guint8(tvb, offset) & 0x70) >> 4;
1235 proto_item_append_text(fl_lag_item, " (%i bytes)", 256 * fc_lag);
1237 proto_tree_add_item(lmp_tree,hf_lmp_feature_broadcast_encryption, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1238 offset++;
1240 proto_tree_add_item(lmp_tree, hf_lmp_feature_reserved_24, tvb, offset, 1, ENC_NA);
1241 proto_tree_add_item(lmp_tree, hf_lmp_feature_edr_acl_2mbps_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1242 proto_tree_add_item(lmp_tree, hf_lmp_feature_edr_acl_3mbps_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1243 proto_tree_add_item(lmp_tree, hf_lmp_feature_enhanced_inquiry_scan, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1244 proto_tree_add_item(lmp_tree, hf_lmp_feature_interlaced_inquiry_scan, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1245 proto_tree_add_item(lmp_tree, hf_lmp_feature_interlaced_page_scan, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1246 proto_tree_add_item(lmp_tree, hf_lmp_feature_rssi_with_inquiry_results, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1247 proto_tree_add_item(lmp_tree, hf_lmp_feature_ev3_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1248 offset++;
1250 proto_tree_add_item(lmp_tree, hf_lmp_feature_ev4_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1251 proto_tree_add_item(lmp_tree, hf_lmp_feature_ev5_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1252 proto_tree_add_item(lmp_tree, hf_lmp_feature_reserved_34, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1253 proto_tree_add_item(lmp_tree, hf_lmp_feature_afh_capable_slave, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1254 proto_tree_add_item(lmp_tree, hf_lmp_feature_afh_classification_slave, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1255 proto_tree_add_item(lmp_tree, hf_lmp_feature_br_edr_not_supported, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1256 proto_tree_add_item(lmp_tree, hf_lmp_feature_le_supported_controller, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1257 proto_tree_add_item(lmp_tree, hf_lmp_feature_3slot_edr_acl_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1258 offset++;
1260 proto_tree_add_item(lmp_tree, hf_lmp_feature_5slot_edr_acl_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1261 proto_tree_add_item(lmp_tree, hf_lmp_feature_sniff_subrating, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1262 proto_tree_add_item(lmp_tree, hf_lmp_feature_pause_encryption, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1263 proto_tree_add_item(lmp_tree, hf_lmp_feature_afh_capable_master, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1264 proto_tree_add_item(lmp_tree, hf_lmp_feature_afh_classification_master, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1265 proto_tree_add_item(lmp_tree, hf_lmp_feature_edr_esco_2mbps_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1266 proto_tree_add_item(lmp_tree, hf_lmp_feature_edr_esco_3mbps_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1267 proto_tree_add_item(lmp_tree, hf_lmp_feature_3slot_edr_esco_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1268 offset++;
1270 proto_tree_add_item(lmp_tree, hf_lmp_feature_extended_inquiry_response, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1271 proto_tree_add_item(lmp_tree, hf_lmp_feature_simultaneous_le_and_br_edr_controller, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1272 proto_tree_add_item(lmp_tree, hf_lmp_feature_reserved_50, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1273 proto_tree_add_item(lmp_tree, hf_lmp_feature_secure_simple_pairing, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1274 proto_tree_add_item(lmp_tree, hf_lmp_feature_encapsulated_pdu, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1275 proto_tree_add_item(lmp_tree, hf_lmp_feature_erroneous_data_reporting, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1276 proto_tree_add_item(lmp_tree, hf_lmp_feature_non_flushable_packet_boundary_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1277 proto_tree_add_item(lmp_tree, hf_lmp_feature_reserved_55, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1278 offset++;
1280 proto_tree_add_item(lmp_tree, hf_lmp_feature_link_supervision_timeout_changed_event, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1281 proto_tree_add_item(lmp_tree, hf_lmp_feature_inquiry_tx_power_level, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1282 proto_tree_add_item(lmp_tree, hf_lmp_feature_enhanced_power_control, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1283 proto_tree_add_item(lmp_tree, hf_lmp_feature_reserved_59_62, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1284 proto_tree_add_item(lmp_tree, hf_lmp_feature_extended_features, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1285 offset++;
1287 break;
1288 case 1:
1289 proto_tree_add_item(lmp_tree, hf_lmp_feature_secure_simple_pairing_host, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1290 proto_tree_add_item(lmp_tree, hf_lmp_feature_le_supported_host, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1291 proto_tree_add_item(lmp_tree, hf_lmp_feature_simultaneous_le_and_br_edr_host, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1292 proto_tree_add_item(lmp_tree, hf_lmp_feature_reserved_67_71, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1293 offset += 1;
1295 proto_tree_add_item(lmp_tree, hf_lmp_feature_reserved, tvb, offset, 7, ENC_NA);
1296 offset+=7;
1298 break;
1299 default:
1300 proto_tree_add_item(lmp_tree, hf_lmp_feature_reserved, tvb, offset, 8, ENC_NA);
1301 offset += 8;
1304 return offset;
1307 static int
1308 dissect_bthci_evt_pin_code_request(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
1310 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, NULL);
1312 return offset;
1315 static int
1316 dissect_bthci_evt_link_key_request(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
1318 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, NULL);
1320 return offset;
1323 static int
1324 dissect_bthci_evt_link_key_notification(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
1326 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, NULL);
1328 proto_tree_add_item(tree, hf_bthci_evt_link_key, tvb, offset, 16, ENC_NA);
1329 offset+=16;
1331 proto_tree_add_item(tree, hf_bthci_evt_key_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1332 offset+=1;
1334 return offset;
1337 static int
1338 dissect_bthci_evt_return_link_keys(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
1340 guint8 evt_num_keys;
1342 evt_num_keys = tvb_get_guint8(tvb, offset);
1343 proto_tree_add_item(tree, hf_bthci_evt_num_keys, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1344 offset++;
1346 while(evt_num_keys--){
1347 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, NULL);
1349 proto_tree_add_item(tree, hf_bthci_evt_link_key, tvb, offset, 16, ENC_NA);
1350 offset+=16;
1354 return offset;
1357 static int
1358 dissect_bthci_evt_read_remote_support_features_complete(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
1360 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1361 offset++;
1363 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1364 offset+=2;
1366 offset = dissect_bthci_evt_lmp_features(tvb, offset, pinfo, tree, 0);
1368 return offset;
1371 static int
1372 dissect_bthci_evt_remote_name_req_complete(tvbuff_t *tvb, int offset,
1373 packet_info *pinfo, proto_tree *tree, hci_data_t *hci_data)
1375 guint8 bd_addr[6];
1377 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1378 offset++;
1380 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, bd_addr);
1382 proto_tree_add_item(tree, hf_bthci_evt_remote_name, tvb, offset, 248, ENC_ASCII|ENC_NA);
1383 if (!pinfo->fd->flags.visited && hci_data != NULL) {
1385 wmem_tree_key_t key[4];
1386 guint32 k_bd_addr_oui;
1387 guint32 k_bd_addr_id;
1388 guint32 k_frame_number;
1389 gchar *name;
1390 device_name_t *device_name;
1392 name = tvb_get_string(wmem_packet_scope(), tvb, offset, 248);
1394 k_frame_number = pinfo->fd->num;
1395 k_bd_addr_oui = bd_addr[0] << 16 | bd_addr[1] << 8 | bd_addr[2];
1396 k_bd_addr_id = bd_addr[3] << 16 | bd_addr[4] << 8 | bd_addr[5];
1398 key[0].length = 1;
1399 key[0].key = &k_bd_addr_id;
1400 key[1].length = 1;
1401 key[1].key = &k_bd_addr_oui;
1402 key[2].length = 1;
1403 key[2].key = &k_frame_number;
1404 key[3].length = 0;
1405 key[3].key = NULL;
1407 device_name = (device_name_t *) wmem_new(wmem_file_scope(), device_name_t);
1408 device_name->bd_addr_oui = bd_addr[0] << 16 | bd_addr[1] << 8 | bd_addr[2];
1409 device_name->bd_addr_id = bd_addr[3] << 16 | bd_addr[4] << 8 | bd_addr[5];
1410 device_name->name = wmem_strdup(wmem_file_scope(), name);
1412 wmem_tree_insert32_array(hci_data->bdaddr_to_name_table, key, device_name);
1414 offset += 248;
1416 return offset;
1419 static int
1420 dissect_bthci_evt_read_remote_version_information_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1422 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1423 offset++;
1425 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1426 offset+=2;
1428 proto_tree_add_item(tree, hf_bthci_evt_vers_nr, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1429 offset++;
1431 proto_tree_add_item(tree, hf_bthci_evt_comp_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1432 offset+=2;
1434 proto_tree_add_item(tree, hf_bthci_evt_sub_vers_nr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1435 offset+=2;
1437 return offset;
1440 static int
1441 dissect_bthci_evt_flush_occured(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1443 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1444 offset+=2;
1446 return offset;
1449 static int
1450 dissect_bthci_evt_number_of_completed_packets(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1452 guint8 evt_num_handles;
1454 evt_num_handles = tvb_get_guint8(tvb, offset);
1455 proto_tree_add_item(tree, hf_bthci_evt_num_handles, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1456 offset++;
1458 while(evt_num_handles--){
1459 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1460 offset+=2;
1462 proto_tree_add_item(tree, hf_bthci_evt_num_compl_packets, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1463 offset+=2;
1467 return offset;
1470 static int
1471 dissect_bthci_evt_mode_change(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1473 proto_item *handle_item;
1475 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1476 offset++;
1478 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1479 offset+=2;
1481 proto_tree_add_item(tree, hf_bthci_evt_curr_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1482 offset++;
1484 handle_item = proto_tree_add_item(tree, hf_bthci_evt_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1485 proto_item_append_text(handle_item, " Baseband slots (%f msec)", tvb_get_letohs(tvb, offset)*0.625);
1486 offset+=2;
1488 return offset;
1491 static int
1492 dissect_bthci_evt_role_change(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
1494 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1495 offset++;
1497 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, NULL);
1499 proto_tree_add_item(tree, hf_bthci_evt_role, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1500 offset++;
1502 return offset;
1505 static int
1506 dissect_bthci_evt_hardware_error(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1508 proto_tree_add_item(tree, hf_bthci_evt_hardware_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1509 offset++;
1511 return offset;
1514 static int
1515 dissect_bthci_evt_loopback_command(tvbuff_t *tvb, int offset,
1516 packet_info *pinfo, proto_tree *tree, hci_data_t *hci_data)
1518 tvbuff_t *next_tvb;
1520 next_tvb = tvb_new_subset_remaining(tvb, offset);
1521 call_dissector_with_data(bthci_cmd_handle, next_tvb, pinfo, tree, hci_data);
1523 offset+=tvb_length_remaining(tvb, offset);
1525 return offset;
1528 static int
1529 dissect_bthci_evt_data_buffer_overflow(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1531 proto_tree_add_item(tree, hf_bthci_evt_link_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1532 offset++;
1534 return offset;
1537 static int
1538 dissect_bthci_evt_read_clock_offset_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1540 proto_item *handle_item;
1541 gint16 clk;
1543 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1544 offset++;
1546 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1547 offset+=2;
1549 handle_item = proto_tree_add_item(tree, hf_bthci_evt_clock_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1550 clk=tvb_get_letohs(tvb, offset) & 32767; /* only bit0-14 are valid */
1551 proto_item_append_text(handle_item, " (%g ms)", 1.25*clk);
1552 offset+=2;
1554 return offset;
1557 static int
1558 dissect_bthci_evt_max_slots_change(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1560 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1561 offset+=2;
1563 proto_tree_add_item(tree, hf_bthci_evt_max_slots, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1564 offset++;
1566 return offset;
1569 static int
1570 dissect_bthci_evt_qos_violation(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1572 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1573 offset+=2;
1575 return offset;
1578 static int
1579 dissect_bthci_evt_conn_packet_type_changed(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
1581 guint16 flags;
1582 proto_tree *handle_tree;
1583 proto_item *ti_ptype_subtree;
1585 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1586 offset++;
1588 flags=tvb_get_letohs(tvb, offset);
1589 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1590 offset+=2;
1592 handle_tree = proto_tree_add_item(tree, hf_usable_packet_types, tvb, offset, 2, ENC_NA);
1593 ti_ptype_subtree = proto_item_add_subtree(handle_tree, ett_ptype_subtree);
1595 if (flags & 0x0008)
1596 proto_item_append_text(handle_tree, "DM1 ");
1597 if (flags & 0x0010)
1598 proto_item_append_text(handle_tree, "DH1 ");
1599 if (flags & 0x0400)
1600 proto_item_append_text(handle_tree, "DM3 ");
1601 if (flags & 0x0800)
1602 proto_item_append_text(handle_tree, "DH3 ");
1603 if (flags & 0x4000)
1604 proto_item_append_text(handle_tree, "DM5 ");
1605 if (flags & 0x8000)
1606 proto_item_append_text(handle_tree, "DH5 ");
1607 if (flags & 0x0020)
1608 proto_item_append_text(handle_tree, "HV1 ");
1609 if (flags & 0x0040)
1610 proto_item_append_text(handle_tree, "HV2 ");
1611 if (flags & 0x0080)
1612 proto_item_append_text(handle_tree, "HV3 ");
1613 if (flags & 0x0002)
1614 proto_item_append_text(handle_tree, "2-DH1 ");
1615 if (flags & 0x0004)
1616 proto_item_append_text(handle_tree, "3-DH1 ");
1617 if (flags & 0x0100)
1618 proto_item_append_text(handle_tree, "2-DH3 ");
1619 if (flags & 0x0200)
1620 proto_item_append_text(handle_tree, "3-DH3 ");
1621 if (flags & 0x1000)
1622 proto_item_append_text(handle_tree, "2-DH5 ");
1623 if (flags & 0x2000)
1624 proto_item_append_text(handle_tree, "3-DH5 ");
1626 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_2dh1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1627 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_3dh1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1628 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_dm1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1629 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_dh1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1630 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_2dh3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1631 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_3dh3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1632 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_dm3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1633 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_dh3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1634 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_2dh5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1635 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_3dh5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1636 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_dm5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1637 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_dh5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1638 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_hv1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1639 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_hv2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1640 proto_tree_add_item(ti_ptype_subtree, hf_bthci_evt_link_type_hv3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1641 offset+=2;
1643 return offset;
1646 static int
1647 dissect_bthci_evt_command_status(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
1649 proto_item *ti_opcode;
1650 proto_tree *opcode_tree;
1651 guint8 status_code;
1652 guint16 opcode;
1653 guint8 ogf;
1654 gint hfx;
1656 status_code = tvb_get_guint8(tvb, offset);
1658 if (status_code != 0) {
1659 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1661 else {
1662 proto_tree_add_item(tree, hf_bthci_evt_status_pending, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1664 offset++;
1666 proto_tree_add_item(tree, hf_bthci_evt_num_command_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1667 offset++;
1669 opcode = tvb_get_letohs(tvb, offset);
1670 ogf = opcode >> 10;
1672 ti_opcode = proto_tree_add_item(tree, hf_bthci_evt_opcode, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1673 opcode_tree = proto_item_add_subtree(ti_opcode, ett_opcode);
1674 proto_tree_add_item(opcode_tree, hf_bthci_evt_ogf, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1676 if (ogf == HCI_OGF_LINK_CONTROL)
1677 hfx = hf_bthci_evt_ocf_link_control;
1678 else if (ogf == HCI_OGF_LINK_POLICY)
1679 hfx = hf_bthci_evt_ocf_link_policy;
1680 else if (ogf == HCI_OGF_HOST_CONTROLLER)
1681 hfx = hf_bthci_evt_ocf_host_controller_and_baseband;
1682 else if (ogf == HCI_OGF_INFORMATIONAL)
1683 hfx = hf_bthci_evt_ocf_informational;
1684 else if (ogf == HCI_OGF_STATUS)
1685 hfx = hf_bthci_evt_ocf_status;
1686 else if (ogf == HCI_OGF_TESTING)
1687 hfx = hf_bthci_evt_ocf_testing;
1688 else if (ogf == HCI_OGF_LOW_ENERGY)
1689 hfx = hf_bthci_evt_ocf_low_energy;
1690 else if (ogf == HCI_OGF_LOGO_TESTING)
1691 hfx = hf_bthci_evt_ocf_logo_testing;
1692 else
1693 hfx = hf_bthci_evt_ocf;
1694 proto_tree_add_item(opcode_tree, hfx, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1695 offset+=2;
1697 col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)",
1698 val_to_str_ext(opcode, &bthci_cmd_opcode_vals_ext, "Unknown 0x%08x"));
1700 return offset;
1703 static int
1704 dissect_bthci_evt_page_scan_mode_change(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
1706 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, NULL);
1708 proto_tree_add_item(tree, hf_bthci_evt_page_scan_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1709 offset++;
1711 return offset;
1714 static int
1715 dissect_bthci_evt_page_scan_repetition_mode_change(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
1717 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, NULL);
1719 proto_tree_add_item(tree, hf_bthci_evt_page_scan_repetition_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1720 offset++;
1722 return offset;
1725 static int
1726 dissect_bthci_evt_inq_result_with_rssi(tvbuff_t *tvb, int offset,
1727 packet_info *pinfo, proto_tree *tree, guint8 *bd_addr)
1729 guint8 num, evt_num_responses;
1731 evt_num_responses = tvb_get_guint8(tvb, offset);
1732 proto_tree_add_item(tree, hf_bthci_evt_num_responses, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1733 offset++;
1735 for(num = 0; num < evt_num_responses; num++) {
1736 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, (num == 0) ? bd_addr : NULL);
1738 proto_tree_add_item(tree, hf_bthci_evt_page_scan_repetition_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1739 offset++;
1741 /* reserved byte */
1742 offset++;
1744 offset = dissect_bthci_evt_cod(tvb, offset, pinfo, tree);
1746 proto_tree_add_item(tree, hf_bthci_evt_clock_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1747 offset += 2;
1749 proto_tree_add_item(tree, hf_bthci_evt_rssi, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1750 offset++;
1754 return offset;
1757 static int
1758 dissect_bthci_evt_eir_ad_data(tvbuff_t *tvb, int offset, packet_info *pinfo,
1759 proto_tree *tree, guint8 size, guint8 *bd_addr, hci_data_t *hci_data)
1761 guint16 i, j;
1762 guint8 length, type;
1763 proto_item *ti_eir = NULL;
1764 proto_item *ti_eir_subtree = NULL;
1765 proto_item *sub_item;
1767 if(tree){
1768 ti_eir = proto_tree_add_item(tree, (size == 240) ? hf_extended_inquiry_response_data : hf_advertising_data,
1769 tvb, offset, size, ENC_NA);
1770 ti_eir_subtree=proto_item_add_subtree(ti_eir, ett_eir_subtree);
1773 i=0;
1774 while (i < size) {
1775 length = tvb_get_guint8(tvb, offset+i);
1776 if (length != 0) {
1778 proto_item *ti_eir_struct;
1779 proto_tree *ti_eir_struct_subtree;
1781 type = tvb_get_guint8(tvb, offset + i + 1);
1783 ti_eir_struct = proto_tree_add_none_format(ti_eir_subtree, hf_eir_ad_item, tvb, offset + i, length + 1, "%s",
1784 val_to_str_ext_const(type, &bthci_cmd_eir_data_type_vals_ext, "Unknown"));
1785 ti_eir_struct_subtree = proto_item_add_subtree(ti_eir_struct, ett_eir_struct_subtree);
1787 proto_item_append_text(ti_eir_struct,"%s", val_to_str_ext_const(type, &bthci_cmd_eir_data_type_vals_ext, "Unknown"));
1789 proto_tree_add_item(ti_eir_struct_subtree,hf_bthci_evt_eir_struct_length, tvb, offset + i, 1, ENC_LITTLE_ENDIAN);
1790 proto_tree_add_item(ti_eir_struct_subtree,hf_bthci_evt_eir_struct_type, tvb, offset + i + 1, 1, ENC_LITTLE_ENDIAN);
1792 switch(type) {
1793 case 0x01: /* Flags */
1794 if (length > 1)
1796 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_flags_limited_disc_mode, tvb, offset+i+2, 1, ENC_LITTLE_ENDIAN);
1797 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_flags_general_disc_mode, tvb, offset+i+2, 1, ENC_LITTLE_ENDIAN);
1798 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_flags_bredr_not_support, tvb, offset+i+2, 1, ENC_LITTLE_ENDIAN);
1799 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_flags_le_bredr_support_ctrl, tvb, offset+i+2, 1, ENC_LITTLE_ENDIAN);
1800 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_flags_le_bredr_support_host, tvb, offset+i+2, 1, ENC_LITTLE_ENDIAN);
1801 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_flags_reserved, tvb, offset+i+2, 1, ENC_LITTLE_ENDIAN);
1804 break;
1805 case 0x02: /* 16-bit Service Class UUIDs, incomplete list */
1806 case 0x03: /* 16-bit Service Class UUIDs, complete list */
1807 case 0x14: /* 16-bit Service Solicitation UUIDs */
1808 j=0;
1809 while(j<(guint8)(length-1))
1811 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_sc_uuid16, tvb, offset+i+j+2, 2, ENC_LITTLE_ENDIAN);
1812 j+=2;
1814 break;
1815 case 0x04: /* 32-bit Service Class UUIDs, incomplete list */
1816 case 0x05: /* 32-bit Service Class UUIDs, complete list */
1817 j=0;
1818 while(j<(guint8)(length-1))
1820 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_sc_uuid32, tvb, offset+i+j+2, 4, ENC_LITTLE_ENDIAN);
1821 j+=4;
1823 break;
1824 case 0x06: /* 128-bit Service Class UUIDs, incomplete list */
1825 case 0x07: /* 128-bit Service Class UUIDs, complete list */
1826 case 0x15: /* 128-bit Service Solicitation UUIDs */
1827 j=0;
1828 while(j<(guint8)(length-1))
1830 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_sc_uuid128, tvb, offset+i+j+2, 16, ENC_NA);
1831 j+=16;
1833 break;
1834 case 0x08: /* Device Name, shortened */
1835 case 0x09: /* Device Name, full */
1836 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_device_name, tvb, offset+i+2, length-1, ENC_ASCII|ENC_NA);
1837 proto_item_append_text(ti_eir_struct,": %s", tvb_format_text(tvb,offset+i+2,length-1));
1838 if (!pinfo->fd->flags.visited && hci_data != NULL &&bd_addr) {
1839 wmem_tree_key_t key[4];
1840 guint32 k_bd_addr_oui;
1841 guint32 k_bd_addr_id;
1842 guint32 k_frame_number;
1843 gchar *name;
1844 device_name_t *device_name;
1846 name = tvb_get_string(wmem_packet_scope(), tvb, offset+i+2, length-1);
1848 k_frame_number = pinfo->fd->num;
1849 k_bd_addr_oui = bd_addr[0] << 16 | bd_addr[1] << 8 | bd_addr[2];
1850 k_bd_addr_id = bd_addr[3] << 16 | bd_addr[4] << 8 | bd_addr[5];
1852 key[0].length = 1;
1853 key[0].key = &k_bd_addr_id;
1854 key[1].length = 1;
1855 key[1].key = &k_bd_addr_oui;
1856 key[2].length = 1;
1857 key[2].key = &k_frame_number;
1858 key[3].length = 0;
1859 key[3].key = NULL;
1861 device_name = (device_name_t *) wmem_new(wmem_file_scope(), device_name_t);
1862 device_name->bd_addr_oui = bd_addr[0] << 16 | bd_addr[1] << 8 | bd_addr[2];
1863 device_name->bd_addr_id = bd_addr[3] << 16 | bd_addr[4] << 8 | bd_addr[5];
1864 device_name->name = wmem_strdup(wmem_file_scope(), name);
1866 wmem_tree_insert32_array(hci_data->bdaddr_to_name_table, key, device_name);
1868 break;
1869 case 0x0A: /* Tx Power Level */
1870 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_transmit_power_level, tvb, offset+i+2, 1, ENC_LITTLE_ENDIAN);
1871 break;
1872 case 0x0B: /* Secure Simple Pairing OOB Length */
1873 /* From CSS v3.pdf */
1874 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_eir_ad_ssp_oob_length, tvb, offset + i + 2, 2, ENC_LITTLE_ENDIAN);
1875 break;
1876 case 0x0C: /* BD_ADDR */
1877 /* From CSS v3.pdf */
1878 dissect_bthci_evt_bd_addr(tvb, offset + i + 2, pinfo, tree, NULL);
1879 break;
1880 case 0x0D: /* Class of Device */
1881 dissect_bthci_evt_cod(tvb, offset+i+2, pinfo, ti_eir_struct_subtree);
1882 break;
1883 case 0x0E: /* Simple Pairing Hash C */
1884 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_hash_c, tvb, offset+i+2, 16, ENC_NA);
1885 break;
1886 case 0x0F: /* Simple Pairing Randomizer R */
1887 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_randomizer_r, tvb, offset+i+2, 16, ENC_NA);
1888 break;
1889 case 0x10: /* Device ID / Security Manager TK Value */
1890 #if 0
1891 /* XXX: Need to know how to check (or is it possible) that is le_physical_channel or not */
1892 if (le_physical_channel) { /* Security Manager TK Value - Value as used in pairing over LE Physical channel. */
1893 sub_item = proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_data, tvb, offset + i + 2, 16, ENC_NA);
1894 expert_add_info(pinfo, sub_item, &ei_eir_undecoded);
1896 break;
1897 #endif
1899 /* DID */
1900 guint16 vendor_id_source;
1901 guint16 vendor_id;
1902 guint16 product_id;
1903 const gchar *str_val;
1905 proto_tree_add_item(ti_eir_struct_subtree, hf_did_vendor_id_source, tvb, offset + i + 2, 2, ENC_LITTLE_ENDIAN);
1906 vendor_id_source = tvb_get_letohs(tvb, offset + i + 2);
1908 if (vendor_id_source == DID_VENDOR_ID_SOURCE_BLUETOOTH_SIG) {
1909 proto_tree_add_item(ti_eir_struct_subtree, hf_did_vendor_id_bluetooth_sig, tvb, offset + i + 2 + 2, 2, ENC_LITTLE_ENDIAN);
1910 } else if (vendor_id_source == DID_VENDOR_ID_SOURCE_USB_FORUM) {
1911 proto_tree_add_item(ti_eir_struct_subtree, hf_did_vendor_id_usb_forum, tvb, offset + i + 2 + 2, 2, ENC_LITTLE_ENDIAN);
1912 } else {
1913 proto_tree_add_item(ti_eir_struct_subtree, hf_did_vendor_id, tvb, offset + i + 2 + 2, 2, ENC_LITTLE_ENDIAN);
1915 vendor_id = tvb_get_letohs(tvb, offset + i + 2 + 2);
1917 sub_item = proto_tree_add_item(ti_eir_struct_subtree, hf_did_product_id, tvb, offset + i + 2 + 4, 2, ENC_LITTLE_ENDIAN);
1918 product_id = tvb_get_letohs(tvb, offset + i + 2 + 4);
1920 if (vendor_id_source == DID_VENDOR_ID_SOURCE_USB_FORUM) {
1921 str_val = val_to_str_ext_const(vendor_id << 16 | product_id, &ext_usb_products_vals, "Unknown");
1922 proto_item_append_text(sub_item, " (%s)", str_val);
1925 proto_tree_add_item(ti_eir_struct_subtree, hf_did_version, tvb, offset + i + 2 + 6, 2, ENC_LITTLE_ENDIAN);
1927 break;
1928 case 0x11: /* Security Manager OOB Flags */
1929 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_oob_flags_oob_data_present, tvb, offset+i+2, 1, ENC_LITTLE_ENDIAN);
1930 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_oob_flags_le_supported_host, tvb, offset+i+2, 1, ENC_LITTLE_ENDIAN);
1931 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_oob_flags_simultaneous_le_and_br_edr_host, tvb, offset+i+2, 1, ENC_LITTLE_ENDIAN);
1932 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_oob_flags_address_type, tvb, offset+i+2, 1, ENC_LITTLE_ENDIAN);
1933 break;
1934 case 0x12: /* Slave Connection Interval Range */
1935 sub_item = proto_tree_add_item(tree, hf_bthci_evt_le_con_interval, tvb, offset+i+2, 2, ENC_LITTLE_ENDIAN);
1936 proto_item_append_text(sub_item, " Min (%g msec)", tvb_get_letohs(tvb, offset+i+2)*1.25);
1938 sub_item = proto_tree_add_item(tree, hf_bthci_evt_le_con_interval, tvb, offset+i+4, 2, ENC_LITTLE_ENDIAN);
1939 proto_item_append_text(sub_item, " Max (%g msec)", tvb_get_letohs(tvb, offset+i+4)*1.25);
1940 proto_item_append_text(ti_eir_struct,": %g - %g msec", tvb_get_letohs(tvb, offset+i+2)*1.25, tvb_get_letohs(tvb, offset+i+4)*1.25);
1941 break;
1942 case 0x16: /* Service Data */
1943 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_sc_uuid16, tvb, offset+i+2, 2, ENC_LITTLE_ENDIAN);
1944 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_data, tvb, offset + i + 4, length - 3, ENC_NA);
1945 break;
1946 case 0x17: /* Public Target Address */
1947 case 0x18: /* Random Target Address */
1949 j=0;
1950 while(j<(guint8)(length-1))
1952 dissect_bthci_evt_bd_addr(tvb, offset+i+j+2, pinfo, ti_eir_struct_subtree, NULL);
1953 j+=6;
1955 break;
1957 case 0x19: /* Appearance */
1959 guint16 appearance = tvb_get_letohs(tvb, offset+i+2);
1960 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_appearance, tvb, offset+i+2, 2, ENC_LITTLE_ENDIAN);
1961 proto_item_append_text(ti_eir_struct,": %s", val_to_str_ext(appearance, &bthci_cmd_appearance_vals_ext, "Unknown"));
1962 break;
1964 case 0x1A: /* Advertising Interval */
1965 /* From CSS v3.pdf */
1966 sub_item = proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_eir_ad_advertising_interval, tvb, offset + i + 2, 2, ENC_LITTLE_ENDIAN);
1967 proto_item_append_text(sub_item, " (%g msec)", tvb_get_letohs(tvb, offset + i + 2) * 0.625);
1968 break;
1969 case 0x3D: /* 3D Information Data */
1970 proto_tree_add_item(ti_eir_struct_subtree, hf_3ds_factory_test_mode, tvb, offset + i + 2, 1, ENC_LITTLE_ENDIAN);
1971 proto_tree_add_item(ti_eir_struct_subtree, hf_3ds_reserved, tvb, offset + i + 2, 1, ENC_LITTLE_ENDIAN);
1972 proto_tree_add_item(ti_eir_struct_subtree, hf_3ds_send_battery_level_report_on_startup, tvb, offset + i + 2, 1, ENC_LITTLE_ENDIAN);
1973 proto_tree_add_item(ti_eir_struct_subtree, hf_3ds_battery_level_reporting, tvb, offset + i + 2, 1, ENC_LITTLE_ENDIAN);
1974 proto_tree_add_item(ti_eir_struct_subtree, hf_3ds_association_notification, tvb, offset + i + 2, 1, ENC_LITTLE_ENDIAN);
1976 proto_tree_add_item(ti_eir_struct_subtree, hf_3ds_path_loss_threshold, tvb, offset + i + 2 + 1, 1, ENC_LITTLE_ENDIAN);
1978 break;
1979 case 0xFF: /* Manufacturer Specific */ {
1980 guint16 company_id;
1982 proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_eir_ad_company_id, tvb, offset + i + 2, 2, ENC_LITTLE_ENDIAN);
1983 company_id = tvb_get_letohs(tvb, offset + i + 2);
1984 if (company_id == 0x000F && tvb_get_guint8(tvb, offset + i + 2 + 2) == 0) { /* 3DS profile Legacy Devices */
1985 proto_tree_add_item(ti_eir_struct_subtree, hf_3ds_legacy_fixed, tvb, offset + i + 2 + 2, 1, ENC_LITTLE_ENDIAN);
1987 proto_tree_add_item(ti_eir_struct_subtree, hf_3ds_legacy_3d_capable_tv, tvb, offset + i + 2 + 3, 1, ENC_LITTLE_ENDIAN);
1988 proto_tree_add_item(ti_eir_struct_subtree, hf_3ds_legacy_ignored_1_3, tvb, offset + i + 2 + 3, 1, ENC_LITTLE_ENDIAN);
1989 proto_tree_add_item(ti_eir_struct_subtree, hf_3ds_legacy_fixed_4, tvb, offset + i + 2 + 3, 1, ENC_LITTLE_ENDIAN);
1990 proto_tree_add_item(ti_eir_struct_subtree, hf_3ds_legacy_ignored_5, tvb, offset + i + 2 + 3, 1, ENC_LITTLE_ENDIAN);
1991 proto_tree_add_item(ti_eir_struct_subtree, hf_3ds_legacy_fixed_6, tvb, offset + i + 2 + 3, 1, ENC_LITTLE_ENDIAN);
1992 proto_tree_add_item(ti_eir_struct_subtree, hf_3ds_legacy_test_mode, tvb, offset + i + 2 + 3, 1, ENC_LITTLE_ENDIAN);
1994 proto_tree_add_item(ti_eir_struct_subtree, hf_3ds_legacy_path_loss_threshold, tvb, offset + i + 2 + 4, 1, ENC_LITTLE_ENDIAN);
1995 } else {
1996 sub_item = proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_data, tvb, offset + i + 2, length - 1, ENC_NA);
1997 expert_add_info(pinfo, sub_item, &ei_eir_undecoded);
2000 break;
2001 default:
2002 sub_item = proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_data, tvb, offset + i + 2, length - 1, ENC_NA);
2003 expert_add_info(pinfo, sub_item, &ei_eir_unknown);
2005 i += length+1;
2007 else {
2008 break;
2012 return offset + size;
2015 static int
2016 dissect_bthci_evt_io_capability_request(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
2018 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, NULL);
2020 return offset;
2023 static int
2024 dissect_bthci_evt_io_capability_response(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
2026 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, NULL);
2028 proto_tree_add_item(tree, hf_bthci_evt_io_capability, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2029 offset++;
2031 proto_tree_add_item(tree, hf_bthci_evt_oob_data_present, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2032 offset++;
2034 proto_tree_add_item(tree, hf_bthci_evt_auth_requirements, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2035 offset++;
2037 return offset;
2040 static int
2041 dissect_bthci_evt_user_confirmation_request(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
2043 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, NULL);
2045 proto_tree_add_item(tree, hf_bthci_evt_numeric_value, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2046 offset+=4;
2048 return offset;
2051 static int
2052 dissect_bthci_evt_user_passkey_request(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
2054 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, NULL);
2056 return offset;
2059 static int
2060 dissect_bthci_evt_remote_oob_data_request(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
2062 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, NULL);
2064 return offset;
2067 static int
2068 dissect_bthci_evt_simple_pairing_complete(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
2070 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2071 offset++;
2073 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, NULL);
2075 return offset;
2078 static int
2079 dissect_bthci_evt_user_passkey_notification(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
2081 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, NULL);
2083 proto_tree_add_item(tree, hf_bthci_evt_passkey, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2084 offset+=4;
2086 return offset;
2089 static int
2090 dissect_bthci_evt_keypress_notification(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
2092 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, NULL);
2094 proto_tree_add_item(tree, hf_bthci_evt_notification_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2095 offset++;
2097 return offset;
2100 static int
2101 dissect_bthci_evt_remote_host_sup_feat_notification(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
2103 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, NULL);
2104 offset = dissect_bthci_evt_lmp_features(tvb, offset, pinfo, tree, 0);
2106 return offset;
2109 static int
2110 dissect_bthci_evt_le_meta(tvbuff_t *tvb, int offset, packet_info *pinfo,
2111 proto_tree *tree, hci_data_t *hci_data)
2113 proto_item *item;
2114 guint8 subevent_code;
2116 subevent_code = tvb_get_guint8(tvb, offset);
2117 proto_tree_add_item(tree, hf_bthci_evt_le_meta_subevent, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2119 col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", val_to_str(subevent_code, evt_le_meta_subevent, "Unknown 0x%02x"));
2121 offset++;
2123 switch(subevent_code) {
2124 case 0x01: /* LE Connection Complete */
2125 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2126 offset++;
2127 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2128 offset+=2;
2129 proto_tree_add_item(tree, hf_bthci_evt_role, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2130 offset++;
2131 proto_tree_add_item(tree, hf_bthci_evt_le_peer_address_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2132 offset++;
2133 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, NULL);
2134 item = proto_tree_add_item(tree, hf_bthci_evt_le_con_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2135 proto_item_append_text(item, " (%g msec)", tvb_get_letohs(tvb, offset)*1.25);
2136 offset+=2;
2137 item = proto_tree_add_item(tree, hf_bthci_evt_le_con_latency, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2138 proto_item_append_text(item, " (number events)");
2139 offset+=2;
2140 item = proto_tree_add_item(tree, hf_bthci_evt_le_supervision_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2141 proto_item_append_text(item, " (%g sec)", tvb_get_letohs(tvb, offset)*0.01);
2142 offset+=2;
2143 proto_tree_add_item(tree, hf_bthci_evt_le_master_clock_accuracy, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2144 offset++;
2145 break;
2146 case 0x02: /* LE Advertising Report */
2148 guint8 i, num_reports, length;
2150 num_reports = tvb_get_guint8(tvb, offset);
2151 proto_tree_add_item(tree, hf_bthci_evt_num_reports, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2152 offset++;
2153 for(i=0; i<num_reports; i++) {
2154 proto_tree_add_item(tree, hf_bthci_evt_advts_event_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2155 offset++;
2156 proto_tree_add_item(tree, hf_bthci_evt_le_peer_address_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2157 offset++;
2158 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, NULL);
2159 length = tvb_get_guint8(tvb, offset);
2160 proto_tree_add_item(tree, hf_bthci_evt_data_length, tvb, offset, 1, ENC_NA);
2161 offset++;
2162 offset=dissect_bthci_evt_eir_ad_data(tvb, offset, pinfo, tree, length, NULL, hci_data);
2163 proto_tree_add_item(tree, hf_bthci_evt_rssi, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2164 offset++;
2167 break;
2168 case 0x03: /* LE Connection Update Complete */
2169 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2170 offset++;
2171 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2172 offset+=2;
2173 item = proto_tree_add_item(tree, hf_bthci_evt_le_con_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2174 proto_item_append_text(item, " (%g msec)", tvb_get_letohs(tvb, offset)*1.25);
2175 offset+=2;
2176 item = proto_tree_add_item(tree, hf_bthci_evt_le_con_latency, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2177 proto_item_append_text(item, " (number events)");
2178 offset+=2;
2179 item = proto_tree_add_item(tree, hf_bthci_evt_le_supervision_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2180 proto_item_append_text(item, " (%g sec)", tvb_get_letohs(tvb, offset)*0.01);
2181 offset+=2;
2182 break;
2183 case 0x04: /* LE Read Remote Used Features Complete */
2184 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2185 offset++;
2186 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2187 offset+=2;
2188 proto_tree_add_item(tree, hf_bthci_evt_le_feature_00, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2189 offset+=8;
2190 break;
2191 case 0x05: /* LE Long Term Key Request */
2192 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2193 offset+=2;
2194 proto_tree_add_item(tree, hf_bthci_evt_random_number, tvb, offset, 8, ENC_NA);
2195 offset+=8;
2196 proto_tree_add_item(tree, hf_bthci_evt_encrypted_diversifier, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2197 offset+=2;
2198 break;
2199 default:
2200 break;
2202 return offset;
2205 static int
2206 dissect_bthci_evt_physical_link_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2208 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2209 offset++;
2210 proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2211 offset++;
2212 return offset;
2215 static int
2216 dissect_bthci_evt_channel_select_physical_link_recovery(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2218 proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2219 offset++;
2220 return offset;
2223 static int
2224 dissect_bthci_evt_disconnect_physical_link_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2226 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2227 offset++;
2229 proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2230 offset++;
2231 proto_tree_add_item(tree, hf_bthci_evt_reason, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2232 offset++;
2233 return offset;
2236 static int
2237 dissect_bthci_evt_physical_link_loss_early_warning(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2239 proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2240 offset++;
2241 proto_tree_add_item(tree, hf_bthci_evt_link_loss_reason, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2242 offset++;
2243 return offset;
2246 static int
2247 dissect_bthci_evt_logical_link_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2249 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2250 offset++;
2251 proto_tree_add_item(tree, hf_bthci_evt_logical_link_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2252 offset+=2;
2253 proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2254 offset++;
2255 proto_tree_add_item(tree, hf_bthci_evt_flow_spec_identifier, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2256 offset++;
2257 return offset;
2260 static int
2261 dissect_bthci_evt_disconnect_logical_link_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2263 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2264 offset++;
2265 proto_tree_add_item(tree, hf_bthci_evt_logical_link_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2266 offset+=2;
2267 proto_tree_add_item(tree, hf_bthci_evt_reason, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2268 offset++;
2269 return offset;
2272 static int
2273 dissect_bthci_evt_flow_spec_modify_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2275 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2276 offset++;
2277 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2278 offset+=2;
2279 return offset;
2282 static int
2283 dissect_bthci_evt_num_completed_data_blocks(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2285 guint8 evt_num_handles;
2287 proto_tree_add_item(tree, hf_bthci_evt_total_num_data_blocks, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2288 offset+=2;
2290 evt_num_handles = tvb_get_guint8(tvb, offset);
2291 proto_tree_add_item(tree, hf_bthci_evt_num_handles, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2292 offset++;
2294 while(evt_num_handles--){
2295 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2296 offset+=2;
2297 proto_tree_add_item(tree, hf_bthci_evt_num_compl_packets, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2298 offset+=2;
2299 proto_tree_add_item(tree, hf_bthci_evt_num_compl_blocks, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2300 offset+=2;
2302 return offset;
2305 static int
2306 dissect_bthci_evt_amp_start_stop_test(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2308 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2309 offset++;
2310 proto_tree_add_item(tree, hf_bthci_evt_test_scenario, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2311 offset++;
2312 return offset;
2315 static int
2316 dissect_bthci_evt_amp_receiver_test(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2318 proto_tree_add_item(tree, hf_bthci_evt_amp_controller_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2319 offset++;
2320 proto_tree_add_item(tree, hf_bthci_evt_report_reason, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2321 offset++;
2322 proto_tree_add_item(tree, hf_bthci_evt_report_event_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2323 offset++;
2324 proto_tree_add_item(tree, hf_bthci_evt_num_frames, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2325 offset+=2;
2326 proto_tree_add_item(tree, hf_bthci_evt_num_error_frames, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2327 offset+=2;
2328 proto_tree_add_item(tree, hf_bthci_evt_num_bits, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2329 offset+=4;
2330 proto_tree_add_item(tree, hf_bthci_evt_num_error_bits, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2331 offset+=4;
2332 return offset;
2335 static int
2336 dissect_bthci_evt_short_range_mode_change_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2338 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2339 offset++;
2340 proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2341 offset++;
2342 proto_tree_add_item(tree, hf_bthci_evt_short_range_mode_state, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2343 offset++;
2344 return offset;
2347 static int
2348 dissect_bthci_evt_amp_status_change(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2350 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2351 offset++;
2352 proto_tree_add_item(tree, hf_bthci_evt_amp_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2353 offset++;
2354 return offset;
2357 static int
2358 dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset,
2359 packet_info *pinfo, proto_tree *tree, hci_data_t *hci_data)
2361 proto_item *ti_opcode;
2362 proto_tree *opcode_tree;
2363 proto_item *item;
2364 gint16 timeout;
2365 guint8 num8;
2366 guint i;
2367 guint16 opcode;
2368 guint8 ogf;
2369 guint32 accuracy;
2370 guint8 bd_addr[6];
2371 gboolean local_addr = FALSE;
2372 gint hfx;
2374 proto_tree_add_item(tree, hf_bthci_evt_num_command_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2375 offset++;
2377 opcode = tvb_get_letohs(tvb, offset);
2378 ogf = opcode >> 10;
2380 ti_opcode = proto_tree_add_item(tree, hf_bthci_evt_opcode, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2381 opcode_tree = proto_item_add_subtree(ti_opcode, ett_opcode);
2382 proto_tree_add_item(opcode_tree, hf_bthci_evt_ogf, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2384 if (ogf == HCI_OGF_LINK_CONTROL)
2385 hfx = hf_bthci_evt_ocf_link_control;
2386 else if (ogf == HCI_OGF_LINK_POLICY)
2387 hfx = hf_bthci_evt_ocf_link_policy;
2388 else if (ogf == HCI_OGF_HOST_CONTROLLER)
2389 hfx = hf_bthci_evt_ocf_host_controller_and_baseband;
2390 else if (ogf == HCI_OGF_INFORMATIONAL)
2391 hfx = hf_bthci_evt_ocf_informational;
2392 else if (ogf == HCI_OGF_STATUS)
2393 hfx = hf_bthci_evt_ocf_status;
2394 else if (ogf == HCI_OGF_TESTING)
2395 hfx = hf_bthci_evt_ocf_testing;
2396 else if (ogf == HCI_OGF_LOW_ENERGY)
2397 hfx = hf_bthci_evt_ocf_low_energy;
2398 else if (ogf == HCI_OGF_LOGO_TESTING)
2399 hfx = hf_bthci_evt_ocf_logo_testing;
2400 else
2401 hfx = hf_bthci_evt_ocf;
2402 proto_tree_add_item(opcode_tree, hfx, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2403 offset+=2;
2405 col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)",
2406 val_to_str_ext(opcode, &bthci_cmd_opcode_vals_ext, "Unknown 0x%08x"));
2408 switch(opcode) {
2409 /* This is a list of Commands that all return just the status */
2410 case 0x0402: /* Inquiry Cancel */
2411 case 0x0403: /* Periodic Inquiry Mode */
2412 case 0x0404: /* Exit Periodic Enquiry Mode */
2413 case 0x080f: /* Write Default Link Policy Settings */
2414 case 0x0c01: /* Set Event Mask */
2415 case 0x0c03: /* Reset */
2416 case 0x0c05: /* Set Event Filter */
2417 case 0x0c0a: /* Write PIN Type */
2418 case 0x0c0b: /* Create Unit Key */
2419 case 0x0c13: /* Change Local Name */
2420 case 0x0c16: /* Write Connection Accept Timeout */
2421 case 0x0c18: /* Write Page Timeout */
2422 case 0x0c1a: /* Write Scan Enable */
2423 case 0x0c1c: /* Write Page Scan Activity */
2424 case 0x0c1e: /* Write Inquiry Scan Activity */
2425 case 0x0c20: /* Write Authentication Enable */
2426 case 0x0c22: /* Write Encryption Mode */
2427 case 0x0c24: /* Write Class of Device */
2428 case 0x0c26: /* Write Voice Setting */
2429 case 0x0c2a: /* Write Num Broadcast Retransmissions */
2430 case 0x0c2c: /* Write Hold Mode Activity */
2431 case 0x0c2f: /* Write SCO Flow Control Enable */
2432 case 0x0c31: /* Set Host Controller To Host Flow Control */
2433 case 0x0c33: /* Host Buffer Size */
2434 case 0x0c3a: /* Write Current IAC LAP */
2435 case 0x0c3c: /* Write Page Scan Period Mode */
2436 case 0x0c3e: /* Write Page Scan Mode */
2437 case 0x0c3f: /* Set AFH Host Channel Classification */
2438 case 0x0c43: /* Write Inquiry Scan Type */
2439 case 0x0c45: /* Write Inquiry Mode */
2440 case 0x0c47: /* Write Page Scan Type */
2441 case 0x0c49: /* Write AFH Channel Assessment Mode */
2442 case 0x0c52: /* Write Extended Inquiry Response */
2443 case 0x0c53: /* Refresh Encryption Key */
2444 case 0x0c56: /* Write Simple Pairing Mode */
2445 case 0x0c59: /* Write Inquiry Tx Power Level */
2446 case 0x0c5b: /* Write Default Erroneous Data Reporting */
2447 case 0x0c62: /* Write Logical Link Accept Timeout */
2448 case 0x0c63: /* Set Event Mask Page 2 */
2449 case 0x0c65: /* Write Location Data */
2450 case 0x0c67: /* Write Flow Control Mode */
2451 case 0x0c6a: /* Write Best Effort Timeout */
2452 case 0x0c6b: /* Short Range Mode */
2453 case 0x0c6d: /* Write LE Host Supported */
2454 case 0x1802: /* Write Loopback Mode */
2455 case 0x1803: /* Enable Device Under Test Mode */
2456 case 0x1804: /* Write Simple Pairing Debug Mode */
2457 case 0x1807: /* Enable AMP Receiver Reports */
2458 case 0x1808: /* AMP Test End */
2459 case 0x1809: /* AMP Test */
2460 case 0x2001: /* LE Set Event Mask */
2461 case 0x2005: /* LE Set Random Address */
2462 case 0x2006: /* LE Set Advertising Parameters */
2463 case 0x2008: /* LE Set Advertising Data */
2464 case 0x2009: /* LE Set Scan Response Data */
2465 case 0x200a: /* LE Set Advertise Enable */
2466 case 0x200b: /* LE Set Scan Parameters */
2467 case 0x200c: /* LE Set Scan Enable */
2468 case 0x200e: /* LE Create Connection Cancel */
2469 case 0x2010: /* LE Clear White List */
2470 case 0x2011: /* LE Add Device To White List */
2471 case 0x2012: /* LE Remove Device From White List */
2472 case 0x2014: /* LE Set Host Channel Classification */
2473 case 0x201d: /* LE Receiver Test */
2474 case 0x201e: /* LE Transmitter Test */
2475 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2476 offset++;
2477 break;
2479 /* This is a list of Commands that all return status and BD_ADDR */
2480 case 0x1009: /* Read BD_ADDR */
2481 local_addr = TRUE;
2482 /* FALLTHROUGH */
2483 case 0x0408: /* Create Connection Cancel */
2484 case 0x040b: /* Link Key Request Reply */
2485 case 0x040c: /* Link Key Request Negative Reply */
2486 case 0x040d: /* PIN Code Request Reply */
2487 case 0x040e: /* PIN Code Request Negative Reply */
2488 case 0x041a: /* Remote Name Request Cancel */
2489 case 0x042b: /* IO Capability Request Reply */
2490 case 0x0434: /* IO Capability Request Negative Reply */
2491 case 0x042c: /* User Confirmation Request Reply */
2492 case 0x042d: /* User Confirmation Request Negative Reply */
2493 case 0x042e: /* User Passkey Request Reply */
2494 case 0x042f: /* User Passkey Request Negative Reply */
2495 case 0x0430: /* Remote OOB Data Request Reply */
2496 case 0x0433: /* Remote OOB Data Request Negative Reply */
2497 case 0x0c60: /* Send Keypress Notification */
2498 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2499 offset++;
2501 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, bd_addr);
2502 if (!pinfo->fd->flags.visited && hci_data != NULL && local_addr) {
2503 wmem_tree_key_t key[4];
2504 guint32 k_interface_id;
2505 guint32 k_adapter_id;
2506 guint32 k_frame_number;
2507 localhost_bdaddr_entry_t *localhost_bdaddr_entry;
2509 k_interface_id = hci_data->interface_id;
2510 k_adapter_id = hci_data->adapter_id;
2511 k_frame_number = pinfo->fd->num;
2513 key[0].length = 1;
2514 key[0].key = &k_interface_id;
2515 key[1].length = 1;
2516 key[1].key = &k_adapter_id;
2517 key[2].length = 1;
2518 key[2].key = &k_frame_number;
2519 key[3].length = 0;
2520 key[3].key = NULL;
2522 localhost_bdaddr_entry = (localhost_bdaddr_entry_t *) wmem_new(wmem_file_scope(), localhost_bdaddr_entry_t);
2523 localhost_bdaddr_entry->interface_id = k_interface_id;
2524 localhost_bdaddr_entry->adapter_id = k_adapter_id;
2525 memcpy(localhost_bdaddr_entry->bd_addr, bd_addr, 6);
2526 wmem_tree_insert32_array(hci_data->localhost_bdaddr, key, localhost_bdaddr_entry);
2529 break;
2531 /* This is a list of Commands that all return status and connection_handle */
2532 case 0x080d: /* Write Link Policy Settings */
2533 case 0x0811: /* Sniff Subrating */
2534 case 0x0c08: /* Flush */
2535 case 0x0c28: /* Write Automatic Flush Timeout */
2536 case 0x0c37: /* Write Link Supervision Timeout */
2537 case 0x0c5f: /* Enhanced Flush */
2538 case 0x1402: /* Reset Failed Contact Counter */
2539 case 0x201a: /* LE Long Term Key Request Reply */
2540 case 0x201b: /* LE Long Term Key Request Neg Reply */
2541 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2542 offset++;
2544 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2545 offset+=2;
2547 break;
2549 /* This is a list of Commands that all return status and timeout */
2550 case 0x0c15: /* Read Connection Accept Timeout */
2551 case 0x0c17: /* Read Page Timeout */
2552 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2553 offset++;
2555 timeout = tvb_get_letohs(tvb, offset);
2556 item = proto_tree_add_item(tree, hf_bthci_evt_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2557 proto_item_append_text(item, " slots (%g msec)", timeout*0.625);
2558 offset+=2;
2560 break;
2562 /* This is a list of Commands that all return status, connection handle and timeout */
2563 case 0x0c27: /* Read Automatic Flush Timeout */
2564 case 0x0c36: /* Read Link Supervision Timeout */
2565 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2566 offset++;
2568 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2569 offset+=2;
2571 timeout = tvb_get_letohs(tvb, offset);
2572 item = proto_tree_add_item(tree, hf_bthci_evt_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2573 proto_item_append_text(item, " slots (%g msec)", timeout*0.625);
2574 offset+=2;
2576 break;
2578 /* This is a list of Commands that all return status, interval and window */
2579 case 0x0c1b: /* Read Page Scan Activity */
2580 case 0x0c1d: /* Read Inquiry Scan Activity */
2581 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2582 offset++;
2584 proto_tree_add_item(tree, hf_bthci_evt_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2585 offset+=2;
2587 proto_tree_add_item(tree, hf_bthci_evt_window, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2588 offset+=2;
2590 break;
2592 case 0x0420: /* Read LMP Handle */
2593 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2594 offset++;
2596 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2597 offset+=2;
2599 proto_tree_add_item(tree, hf_bthci_evt_lmp_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2600 offset++;
2602 /* 4 reserved bytes */
2603 offset+=4;
2604 break;
2606 case 0x043b: /* Logical Link Cancel */
2607 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2608 offset++;
2610 proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2611 offset++;
2613 proto_tree_add_item(tree, hf_bthci_evt_flow_spec_identifier, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2614 offset++;
2616 break;
2617 case 0x0809: /* Role Discovery */
2618 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2619 offset++;
2621 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2622 offset+=2;
2624 proto_tree_add_item(tree, hf_bthci_evt_curr_role, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2625 offset++;
2627 break;
2629 case 0x080c: /* Read Link Policy Settings */
2630 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2631 offset++;
2633 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2634 offset+=2;
2636 proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_switch, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2637 proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_hold , tvb, offset, 2, ENC_LITTLE_ENDIAN);
2638 proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_sniff , tvb, offset, 2, ENC_LITTLE_ENDIAN);
2639 proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_park , tvb, offset, 2, ENC_LITTLE_ENDIAN);
2640 offset+=2;
2642 break;
2644 case 0x080e: /* Read Default Link Policy Settings */
2645 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2646 offset++;
2648 proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_switch, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2649 proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_hold , tvb, offset, 2, ENC_LITTLE_ENDIAN);
2650 proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_sniff , tvb, offset, 2, ENC_LITTLE_ENDIAN);
2651 proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_park , tvb, offset, 2, ENC_LITTLE_ENDIAN);
2652 offset+=2;
2654 break;
2656 case 0x0c09: /* Read PIN Type */
2657 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2658 offset++;
2660 proto_tree_add_item(tree, hf_bthci_evt_pin_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2661 offset++;
2663 break;
2665 case 0x0c0d: /* Read Stored Link Key */
2666 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2667 offset++;
2669 proto_tree_add_item(tree, hf_bthci_evt_max_num_keys, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2670 offset+=2;
2672 proto_tree_add_item(tree, hf_bthci_evt_num_keys_read, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2673 offset+=2;
2675 break;
2677 case 0x0c11: /* Write Stored Link Key */
2678 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2679 offset++;
2681 proto_tree_add_item(tree, hf_bthci_evt_num_keys_written, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2682 offset++;
2684 break;
2686 case 0x0c12: /* Delete Stored Link Key */
2687 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2688 offset++;
2690 proto_tree_add_item(tree, hf_bthci_evt_num_keys_deleted, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2691 offset+=2;
2693 break;
2695 case 0x0c14: /* Read Local Name */
2696 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2697 offset++;
2699 proto_tree_add_item(tree, hf_bthci_evt_device_name, tvb, offset, 248, ENC_ASCII|ENC_NA);
2700 if (!pinfo->fd->flags.visited && hci_data != NULL) {
2701 wmem_tree_key_t key[4];
2702 guint32 k_interface_id;
2703 guint32 k_adapter_id;
2704 guint32 k_frame_number;
2705 gchar *name;
2706 localhost_name_entry_t *localhost_name_entry;
2708 k_interface_id = hci_data->interface_id;
2709 k_adapter_id = hci_data->adapter_id;
2710 k_frame_number = pinfo->fd->num;
2712 name = tvb_get_string(wmem_packet_scope(), tvb, offset, 248);
2714 key[0].length = 1;
2715 key[0].key = &k_interface_id;
2716 key[1].length = 1;
2717 key[1].key = &k_adapter_id;
2718 key[2].length = 1;
2719 key[2].key = &k_frame_number;
2720 key[3].length = 0;
2721 key[3].key = NULL;
2723 localhost_name_entry = (localhost_name_entry_t *) wmem_new(wmem_file_scope(), localhost_name_entry_t);
2724 localhost_name_entry->interface_id = k_interface_id;
2725 localhost_name_entry->adapter_id = k_adapter_id;
2726 localhost_name_entry->name = wmem_strdup(wmem_file_scope(), name);
2728 wmem_tree_insert32_array(hci_data->localhost_name, key, localhost_name_entry);
2730 offset += 248;
2732 break;
2734 case 0x0c19: /* Read Scan Enable */
2735 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2736 offset++;
2738 proto_tree_add_item(tree, hf_bthci_evt_scan_enable, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2739 offset++;
2741 break;
2743 case 0x0c1f: /* Read Authentication Enable */
2744 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2745 offset++;
2747 proto_tree_add_item(tree, hf_bthci_evt_authentication_enable, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2748 offset++;
2750 break;
2752 case 0x0c21: /* Read Encryption Mode */
2753 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2754 offset++;
2756 proto_tree_add_item(tree, hf_bthci_evt_encryption_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2757 offset++;
2759 break;
2761 case 0x0c23: /* Read Class of Device */
2762 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2763 offset++;
2765 offset = dissect_bthci_evt_cod(tvb, offset, pinfo, tree);
2767 break;
2769 case 0x0c25: /* Read Voice Setting */
2770 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2771 offset++;
2773 proto_tree_add_item(tree, hf_bthci_evt_input_unused, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2774 proto_tree_add_item(tree, hf_bthci_evt_input_coding, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2775 proto_tree_add_item(tree, hf_bthci_evt_input_data_format, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2776 proto_tree_add_item(tree, hf_bthci_evt_input_sample_size, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2777 proto_tree_add_item(tree, hf_bthci_evt_linear_pcm_bit_pos, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2778 proto_tree_add_item(tree, hf_bthci_evt_air_coding_format, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2779 offset+=2;
2781 break;
2783 case 0x0c29: /* Read Num Broadcast Retransmissions */
2784 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2785 offset++;
2787 proto_tree_add_item(tree, hf_bthci_evt_num_broadcast_retransm, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2788 offset++;
2790 break;
2792 case 0x0c2b: /* Read Hold Mode Activity */
2793 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2794 offset++;
2796 proto_tree_add_item(tree, hf_bthci_evt_hold_mode_act_page, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2797 proto_tree_add_item(tree, hf_bthci_evt_hold_mode_act_inquiry, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2798 proto_tree_add_item(tree, hf_bthci_evt_hold_mode_act_periodic, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2799 offset++;
2801 break;
2803 case 0x0c2d: /* Read Transmit Power Level */
2804 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2805 offset++;
2807 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2808 offset+=2;
2810 proto_tree_add_item(tree, hf_bthci_evt_transmit_power_level, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2811 offset++;
2813 break;
2815 case 0x0c2e: /* Read SCO Flow Control Enable */
2816 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2817 offset++;
2819 proto_tree_add_item(tree, hf_bthci_evt_sco_flow_cont_enable, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2820 offset++;
2822 break;
2825 case 0x0c38: /* Read Number of Supported IAC */
2826 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2827 offset++;
2829 proto_tree_add_item(tree, hf_bthci_evt_num_supp_iac, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2830 offset++;
2832 break;
2834 case 0x0c39: /* Read Current IAC LAP */
2835 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2836 offset++;
2838 num8 = tvb_get_guint8(tvb, offset);
2839 proto_tree_add_item(tree, hf_bthci_evt_num_curr_iac, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2840 offset++;
2842 for (i=0; i<num8; i++) {
2843 proto_tree_add_item(tree, hf_bthci_evt_iac_lap, tvb, offset, 3, ENC_LITTLE_ENDIAN);
2844 offset+=3;
2846 break;
2848 case 0x0c3b: /* Read Page Scan Period Mode */
2849 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2850 offset++;
2852 proto_tree_add_item(tree, hf_bthci_evt_page_scan_period_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2853 offset++;
2855 break;
2857 case 0x0c3d: /* Read Page Scan Mode */
2858 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2859 offset++;
2861 proto_tree_add_item(tree, hf_bthci_evt_page_scan_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2862 offset++;
2864 break;
2866 case 0x0c42: /* Read Inquiry Scan Type */
2867 case 0x0c46: /* Read Page Scan Type */
2868 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2869 offset++;
2870 proto_tree_add_item(tree, hf_bthci_evt_scan_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2871 offset++;
2872 break;
2874 case 0x0c44: /* Read Inquiry Mode */
2875 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2876 offset++;
2877 proto_tree_add_item(tree, hf_bthci_evt_inq_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2878 offset++;
2879 break;
2881 case 0x0c48: /* Read AFH Channel Assessment Mode */
2882 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2883 offset++;
2884 proto_tree_add_item(tree, hf_bthci_evt_afh_ch_assessment_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2885 offset++;
2886 break;
2888 case 0x0c51: /* Read Extended Inquiry Response */
2889 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2890 offset++;
2892 proto_tree_add_item(tree, hf_bthci_evt_fec_required, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2893 offset++;
2895 offset=dissect_bthci_evt_eir_ad_data(tvb, offset, pinfo, tree, 240, NULL, hci_data);
2896 break;
2898 case 0x0c55: /* Read Simple Pairing Mode */
2899 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2900 offset++;
2902 proto_tree_add_item(tree, hf_bthci_evt_simple_pairing_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2903 offset++;
2904 break;
2906 case 0x0c57: /* Read Local OOB Data */
2907 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2908 offset++;
2909 proto_tree_add_item(tree, hf_bthci_evt_hash_c, tvb, offset, 16, ENC_NA);
2910 offset+=16;
2911 proto_tree_add_item(tree, hf_bthci_evt_randomizer_r, tvb, offset, 16, ENC_NA);
2912 offset+=16;
2913 break;
2915 case 0x0c58: /* Read Inquiry Response Tx Power Level */
2916 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2917 offset++;
2918 proto_tree_add_item(tree, hf_bthci_evt_power_level_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2919 offset++;
2920 break;
2923 case 0x0c5a: /* Read Default Erroneous Data Reporting */
2924 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2925 offset++;
2927 proto_tree_add_item(tree, hf_bthci_evt_err_data_reporting, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2928 offset++;
2930 break;
2932 case 0x0c61: /* Read Logical Link Accept Timeout */
2933 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2934 offset++;
2935 item = proto_tree_add_item(tree, hf_bthci_evt_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2936 proto_item_append_text(item, " slots (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
2937 offset+=2;
2938 break;
2940 case 0x0c64: /* Read Location Data */
2941 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2942 offset++;
2943 proto_tree_add_item(tree, hf_bthci_evt_location_domain_aware, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2944 offset++;
2945 proto_tree_add_item(tree, hf_bthci_evt_location_domain, tvb, offset, 2, ENC_ASCII | ENC_NA);
2946 offset+=2;
2947 proto_tree_add_item(tree, hf_bthci_evt_location_domain_options, tvb, offset, 1, ENC_ASCII | ENC_NA);
2948 offset++;
2949 proto_tree_add_item(tree, hf_bthci_evt_location_options, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2950 offset++;
2951 break;
2953 case 0x0c66: /* Read Flow Control Mode */
2954 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2955 offset++;
2956 proto_tree_add_item(tree, hf_bthci_evt_flow_control_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2957 offset++;
2958 break;
2960 case 0x0c68: /* Read Enhanced Tx Power Level */
2961 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2962 offset++;
2963 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2964 offset+=2;
2965 proto_tree_add_item(tree, hf_bthci_evt_transmit_power_level_gfsk, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2966 offset++;
2967 proto_tree_add_item(tree, hf_bthci_evt_transmit_power_level_dqpsk, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2968 offset++;
2969 proto_tree_add_item(tree, hf_bthci_evt_transmit_power_level_8dpsk, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2970 offset++;
2971 break;
2973 case 0x0c69: /* Read Best Effort Timeout */
2974 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2975 offset++;
2976 proto_tree_add_item(tree, hf_bthci_evt_flush_to_us, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2977 offset+=4;
2978 break;
2980 case 0x0c6c: /* Read LE Host Supported */
2981 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2982 offset++;
2983 proto_tree_add_item(tree, hf_bthci_evt_le_supported_host, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2984 offset++;
2985 proto_tree_add_item(tree, hf_bthci_evt_le_simultaneous_host, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2986 offset++;
2987 break;
2989 case 0x1001: /* Read Local Version Information */
2990 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2991 offset++;
2993 proto_tree_add_item(tree, hf_bthci_evt_hci_vers_nr, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2994 offset++;
2996 proto_tree_add_item(tree, hf_bthci_evt_hci_revision, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2997 offset+=2;
2999 proto_tree_add_item(tree, hf_bthci_evt_vers_nr, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3000 offset++;
3002 proto_tree_add_item(tree, hf_bthci_evt_comp_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3003 offset+=2;
3005 proto_tree_add_item(tree, hf_bthci_evt_sub_vers_nr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3006 offset+=2;
3008 break;
3010 case 0x1002: /* Read Local Supported Commands */
3011 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3012 offset++;
3014 proto_tree_add_item(tree, hf_bthci_evt_local_supported_cmds, tvb, offset, 64, ENC_NA);
3015 offset+=64;
3017 break;
3019 case 0x1003: /* Read Local Supported Features */
3020 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3021 offset++;
3023 offset = dissect_bthci_evt_lmp_features(tvb, offset, pinfo, tree, 0);
3025 break;
3027 case 0x1004: /* Read Local Extended Features */
3029 guint8 page_number;
3031 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3032 offset++;
3034 page_number = tvb_get_guint8(tvb, offset);
3035 proto_tree_add_item(tree, hf_bthci_evt_page_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3036 offset++;
3038 proto_tree_add_item(tree, hf_bthci_evt_max_page_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3039 offset++;
3041 offset = dissect_bthci_evt_lmp_features(tvb, offset, pinfo, tree, page_number);
3044 break;
3046 case 0x1005: /* Read Buffer Size */
3047 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3048 offset++;
3050 proto_tree_add_item(tree, hf_bthci_evt_host_data_packet_length_acl, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3051 offset+=2;
3053 proto_tree_add_item(tree, hf_bthci_evt_host_data_packet_length_sco, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3054 offset++;
3056 proto_tree_add_item(tree, hf_bthci_evt_host_total_num_acl_data_packets, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3057 offset+=2;
3059 proto_tree_add_item(tree, hf_bthci_evt_host_total_num_sco_data_packets, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3060 offset+=2;
3062 break;
3064 case 0x100a: /* Read Data Block Size */
3065 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3066 offset++;
3067 proto_tree_add_item(tree, hf_bthci_evt_max_acl_data_packet_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3068 offset+=2;
3069 proto_tree_add_item(tree, hf_bthci_evt_data_block_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3070 offset+=2;
3071 proto_tree_add_item(tree, hf_bthci_evt_total_num_data_blocks, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3072 offset+=2;
3073 break;
3075 case 0x1007: /* Read Country Code */
3076 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3077 offset++;
3079 proto_tree_add_item(tree, hf_bthci_evt_country_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3080 offset++;
3082 break;
3084 case 0x1401: /* Read Failed Contact Counter */
3085 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3086 offset++;
3088 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3089 offset+=2;
3091 proto_tree_add_item(tree, hf_bthci_evt_failed_contact_counter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3092 offset+=2;
3094 break;
3096 case 0x1403: /* Get Link Quality */
3097 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3098 offset++;
3100 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3101 offset+=2;
3103 proto_tree_add_item(tree, hf_bthci_evt_link_quality, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3104 offset++;
3106 break;
3108 case 0x1405: /* Read RSSI */
3109 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3110 offset++;
3112 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3113 offset+=2;
3115 proto_tree_add_item(tree, hf_bthci_evt_rssi, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3116 offset++;
3118 break;
3120 case 0x1406: /* Read AFH Channel Map */
3121 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3122 offset++;
3124 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3125 offset+=2;
3127 proto_tree_add_item(tree, hf_bthci_evt_afh_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3128 offset++;
3130 proto_tree_add_item(tree, hf_bthci_evt_afh_channel_map, tvb, offset, 10, ENC_NA);
3131 offset+=10;
3133 break;
3135 case 0x1407: /* Read Clock */
3136 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3137 offset++;
3139 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3140 offset+=2;
3142 proto_tree_add_item(tree, hf_bthci_evt_clock, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3143 offset+=4;
3145 accuracy = tvb_get_letohl(tvb, offset);
3146 item = proto_tree_add_item(tree, hf_bthci_evt_clock_accuracy, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3147 proto_item_append_text(item, " %g msec", accuracy*0.3125);
3148 offset+=2;
3149 break;
3151 case 0x1408: /* Read Encryption Key Size */
3152 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3153 offset++;
3154 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3155 offset+=2;
3156 proto_tree_add_item(tree, hf_bthci_evt_enc_key_size, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3157 offset++;
3158 break;
3160 case 0x1409: /* Read Local AMP Info */
3161 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3162 offset++;
3163 proto_tree_add_item(tree, hf_bthci_evt_amp_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3164 offset++;
3165 proto_tree_add_item(tree, hf_bthci_evt_total_bandwidth, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3166 offset+=4;
3167 proto_tree_add_item(tree, hf_bthci_evt_max_guaranteed_bandwidth, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3168 offset+=4;
3169 proto_tree_add_item(tree, hf_bthci_evt_min_latency, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3170 offset+=4;
3171 proto_tree_add_item(tree, hf_bthci_evt_max_pdu_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3172 offset+=4;
3173 proto_tree_add_item(tree, hf_bthci_evt_amp_controller_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3174 offset++;
3175 proto_tree_add_item(tree, hf_bthci_evt_pal_capabilities_00, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3176 offset+=2;
3177 proto_tree_add_item(tree, hf_bthci_evt_max_amp_assoc_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3178 offset+=2;
3179 proto_tree_add_item(tree, hf_bthci_evt_max_flush_to_us, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3180 offset+=4;
3181 proto_tree_add_item(tree, hf_bthci_evt_best_effort_flush_to_us, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3182 offset+=4;
3183 break;
3185 case 0x140a: /* Read Local AMP Assoc */
3186 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3187 offset++;
3188 proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3189 offset++;
3190 proto_tree_add_item(tree, hf_bthci_evt_amp_remaining_assoc_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3191 offset+=2;
3192 proto_tree_add_item(tree, hf_bthci_evt_amp_assoc_fragment, tvb, offset, -1, ENC_NA);
3193 offset+=tvb_length_remaining(tvb, offset);
3194 break;
3196 case 0x140b: /* Write Remote AMP Assoc */
3197 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3198 offset++;
3199 proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3200 offset++;
3201 break;
3203 case 0x1801: /* Read Loopback Mode */
3204 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3205 offset++;
3206 proto_tree_add_item(tree, hf_bthci_evt_loopback_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3207 offset++;
3208 break;
3210 case 0x2002: /* LE Read Buffer Size */
3211 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3212 offset++;
3213 item = proto_tree_add_item(tree, hf_bthci_evt_le_acl_data_pkt_len, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3214 if( (tvb_get_letohs(tvb, offset) == 0) && (tvb_get_guint8(tvb, offset+2) == 0) )
3215 proto_item_append_text(item, " (buffers shared between BR/EDR and LE) ");
3216 offset+=2;
3217 proto_tree_add_item(tree, hf_bthci_evt_total_num_le_acl_data_pkts, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3218 offset++;
3219 break;
3221 case 0x2003: /* LE Read Local Supported Features */
3222 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3223 offset++;
3225 if (tree) {
3226 proto_item *ti_le_features;
3227 proto_item *ti_le_subtree;
3229 ti_le_features = proto_tree_add_item(tree, hf_bthci_evt_le_features, tvb, offset, 8, ENC_NA);
3230 ti_le_subtree = proto_item_add_subtree(ti_le_features, ett_lmp_subtree);
3232 proto_tree_add_item(ti_le_subtree,hf_bthci_evt_le_feature_00, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3233 offset+=8;
3235 break;
3236 case 0x2007: /* LE Read Advertising Channel Tx Power */
3238 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3239 offset++;
3240 proto_tree_add_item(tree, hf_bthci_evt_transmit_power_level, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3241 offset++;
3242 break;
3245 case 0x200f: /* LE Read White List Size */
3247 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3248 offset++;
3249 proto_tree_add_item(tree, hf_bthci_evt_white_list_size, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3250 offset++;
3251 break;
3254 case 0x2015: /* LE Read Channel Map */
3256 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3257 offset++;
3258 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3259 offset+=2;
3260 proto_tree_add_item(tree, hf_bthci_evt_le_channel_map, tvb, offset, 1, ENC_NA);
3261 offset+=5;
3262 break;
3265 case 0x2017: /* LE Encrypt */
3267 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3268 offset++;
3269 proto_tree_add_item(tree, hf_bthci_evt_encrypted_data, tvb, offset, 16, ENC_NA);
3270 offset+=16;
3271 break;
3274 case 0x2018: /* LE Rand */
3276 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3277 offset++;
3278 proto_tree_add_item(tree, hf_bthci_evt_random_number, tvb, offset, 8, ENC_NA);
3279 offset+=8;
3280 break;
3283 case 0x201c: /* LE Read Supported States */
3285 proto_item *ti_le_states;
3286 proto_item *ti_le_states_subtree;
3288 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3289 offset++;
3291 ti_le_states=proto_tree_add_item(tree, hf_bthci_evt_le_states, tvb, offset, 8, ENC_NA);
3292 ti_le_states_subtree=proto_item_add_subtree(ti_le_states, ett_le_state_subtree);
3294 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_00, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3295 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_01, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3296 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_02, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3297 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_03, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3298 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_04, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3299 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_05, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3300 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_06, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3301 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_07, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3302 offset++;
3303 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_10, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3304 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_11, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3305 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_12, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3306 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_13, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3307 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_14, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3308 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_15, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3309 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_16, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3310 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_17, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3311 offset++;
3312 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_20, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3313 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_21, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3314 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_22, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3315 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_23, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3316 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_24, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3317 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_25, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3318 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_26, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3319 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_27, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3320 offset++;
3321 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_30, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3322 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_31, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3323 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_32, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3324 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_33, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3325 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_34, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3326 offset+=5;
3327 break;
3330 case 0x201f: /* LE Test End */
3332 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3333 offset++;
3334 proto_tree_add_item(tree, hf_bthci_evt_le_num_packets, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3335 offset+=2;
3336 break;
3339 default:
3340 proto_tree_add_item(tree, hf_bthci_evt_ret_params, tvb, offset, -1, ENC_NA);
3341 offset+=tvb_length_remaining(tvb, offset);
3342 break;
3345 return offset;
3348 static int
3349 dissect_bthci_evt_qos_setup_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
3351 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3352 offset++;
3354 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3355 offset+=2;
3357 proto_tree_add_item(tree, hf_bthci_evt_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3358 offset++;
3360 proto_tree_add_item(tree, hf_bthci_evt_service_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3361 offset++;
3363 proto_tree_add_item(tree, hf_bthci_evt_token_rate, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3364 offset+=4;
3366 proto_tree_add_item(tree, hf_bthci_evt_peak_bandwidth, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3367 offset+=4;
3369 proto_tree_add_item(tree, hf_bthci_evt_latency, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3370 offset+=4;
3372 proto_tree_add_item(tree, hf_bthci_evt_delay_variation, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3373 offset+=4;
3375 return offset;
3378 static int
3379 dissect_bthci_evt_change_conn_link_key_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
3381 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3382 offset++;
3384 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3385 offset+=2;
3387 return offset;
3390 static int
3391 dissect_bthci_evt_master_link_key_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
3393 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3394 offset++;
3396 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3397 offset+=2;
3399 proto_tree_add_item(tree, hf_bthci_evt_key_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3400 offset++;
3402 return offset;
3405 static int
3406 dissect_bthci_evt_encryption_change(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
3408 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3409 offset++;
3411 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3412 offset+=2;
3414 proto_tree_add_item(tree, hf_bthci_evt_encryption_enable, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3415 offset++;
3417 return offset;
3420 static int
3421 dissect_bthci_evt_read_remote_ext_features_complete(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
3423 guint8 page_number;
3425 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3426 offset++;
3428 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3429 offset+=2;
3431 page_number = tvb_get_guint8(tvb, offset);
3432 proto_tree_add_item(tree, hf_bthci_evt_page_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3433 offset++;
3435 proto_tree_add_item(tree, hf_bthci_evt_max_page_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3436 offset++;
3438 offset = dissect_bthci_evt_lmp_features(tvb, offset, pinfo, tree, page_number);
3440 return offset;
3443 static int
3444 dissect_bthci_evt_sync_connection_complete(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
3446 proto_item *item;
3448 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3449 offset++;
3451 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3452 offset+=2;
3454 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, NULL);
3456 proto_tree_add_item(tree, hf_bthci_evt_sync_link_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3457 offset++;
3459 item = proto_tree_add_item(tree, hf_bthci_evt_sync_tx_interval, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3460 proto_item_append_text(item, " slots (%g msec)", tvb_get_guint8(tvb, offset)*0.625);
3461 offset++;
3463 item = proto_tree_add_item(tree, hf_bthci_evt_sync_rtx_window, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3464 proto_item_append_text(item, " slots (%g msec)", tvb_get_guint8(tvb, offset)*0.625);
3465 offset++;
3467 proto_tree_add_item(tree, hf_bthci_evt_sync_rx_packet_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3468 offset+=2;
3470 proto_tree_add_item(tree, hf_bthci_evt_sync_tx_packet_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3471 offset+=2;
3473 proto_tree_add_item(tree, hf_bthci_evt_air_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3474 offset++;
3476 return offset;
3479 static int
3480 dissect_bthci_evt_sync_connection_changed(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
3482 proto_item *item;
3484 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3485 offset++;
3487 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3488 offset+=2;
3490 item = proto_tree_add_item(tree, hf_bthci_evt_sync_tx_interval, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3491 proto_item_append_text(item, " slots (%g msec)", tvb_get_guint8(tvb, offset)*0.625);
3492 offset++;
3494 item = proto_tree_add_item(tree, hf_bthci_evt_sync_rtx_window, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3495 proto_item_append_text(item, " slots (%g msec)", tvb_get_guint8(tvb, offset)*0.625);
3496 offset++;
3498 proto_tree_add_item(tree, hf_bthci_evt_sync_rx_packet_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3499 offset+=2;
3501 proto_tree_add_item(tree, hf_bthci_evt_sync_tx_packet_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3502 offset+=2;
3504 return offset;
3507 static int
3508 dissect_bthci_evt_sniff_subrating(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
3510 proto_item *item;
3512 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3513 offset++;
3515 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3516 offset+=2;
3518 item = proto_tree_add_item(tree, hf_bthci_evt_max_tx_latency, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3519 proto_item_append_text(item, " slots (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
3520 offset+=2;
3522 item = proto_tree_add_item(tree, hf_bthci_evt_max_rx_latency, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3523 proto_item_append_text(item, " slots (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
3524 offset+=2;
3526 item = proto_tree_add_item(tree, hf_bthci_evt_min_remote_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3527 proto_item_append_text(item, " slots (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
3528 offset+=2;
3530 item = proto_tree_add_item(tree, hf_bthci_evt_min_local_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3531 proto_item_append_text(item, " slots (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
3532 offset+=2;
3534 return offset;
3537 static int
3538 dissect_bthci_evt_flow_specification_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
3540 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3541 offset++;
3543 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3544 offset+=2;
3546 proto_tree_add_item(tree, hf_bthci_evt_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3547 offset++;
3549 proto_tree_add_item(tree, hf_bthci_evt_flow_direction, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3550 offset++;
3552 proto_tree_add_item(tree, hf_bthci_evt_service_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3553 offset++;
3555 proto_tree_add_item(tree, hf_bthci_evt_token_rate, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3556 offset+=4;
3558 proto_tree_add_item(tree, hf_bthci_evt_token_bucket_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3559 offset+=4;
3561 proto_tree_add_item(tree, hf_bthci_evt_peak_bandwidth, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3562 offset+=4;
3564 proto_tree_add_item(tree, hf_bthci_evt_latency, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3565 offset+=4;
3567 return offset;
3570 static int
3571 dissect_bthci_evt_enhanced_flush_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
3573 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3574 offset+=2;
3576 return offset;
3579 static int
3580 dissect_bthci_evt_encryption_key_refresh_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
3582 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3583 offset++;
3585 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3586 offset+=2;
3588 return offset;
3591 static int
3592 dissect_bthci_evt_link_supervision_timeout_changed(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
3594 proto_item *item;
3596 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3597 offset+=2;
3599 item = proto_tree_add_item(tree, hf_bthci_evt_link_supervision_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3600 proto_item_append_text(item, " slots (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
3601 offset+=2;
3603 return offset;
3606 static int
3607 dissect_bthci_evt_inq_result(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
3609 guint8 num, evt_num_responses;
3611 evt_num_responses = tvb_get_guint8(tvb, offset);
3612 proto_tree_add_item(tree, hf_bthci_evt_num_responses, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3613 offset++;
3615 for(num=0;num<evt_num_responses;num++){
3616 offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, NULL);
3618 proto_tree_add_item(tree, hf_bthci_evt_page_scan_repetition_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3619 offset++;
3621 proto_tree_add_item(tree, hf_bthci_evt_page_scan_period_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3622 offset++;
3624 proto_tree_add_item(tree, hf_bthci_evt_page_scan_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3625 offset++;
3627 offset = dissect_bthci_evt_cod(tvb, offset, pinfo, tree);
3629 proto_tree_add_item(tree, hf_bthci_evt_clock_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3630 offset+=2;
3633 return offset;
3637 /* Code to actually dissect the packets */
3638 static gint
3639 dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
3641 proto_item *ti;
3642 proto_tree *bthci_evt_tree;
3643 guint8 param_length, evt_code;
3644 guint8 bd_addr[6];
3645 gint offset = 0;
3646 hci_data_t *hci_data;
3648 ti = proto_tree_add_item(tree, proto_bthci_evt, tvb, offset, -1, ENC_NA);
3649 bthci_evt_tree = proto_item_add_subtree(ti, ett_bthci_evt);
3651 switch (pinfo->p2p_dir) {
3652 case P2P_DIR_SENT:
3653 col_set_str(pinfo->cinfo, COL_INFO, "Sent ");
3654 break;
3655 case P2P_DIR_RECV:
3656 col_set_str(pinfo->cinfo, COL_INFO, "Rcvd ");
3657 break;
3658 default:
3659 col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ",
3660 pinfo->p2p_dir);
3661 break;
3664 hci_data = (hci_data_t *) data;
3665 DISSECTOR_ASSERT(hci_data);
3667 evt_code = tvb_get_guint8(tvb, offset);
3668 proto_tree_add_item(bthci_evt_tree, hf_bthci_evt_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3669 proto_item_append_text(bthci_evt_tree, " - %s", val_to_str_const(evt_code, evt_code_vals, "Unknown 0x%08x"));
3670 offset++;
3672 param_length = tvb_get_guint8(tvb, offset);
3673 proto_tree_add_item(bthci_evt_tree, hf_bthci_evt_param_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3674 offset++;
3677 col_set_str(pinfo->cinfo, COL_PROTOCOL, "HCI_EVT");
3679 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(evt_code, evt_code_vals, "Unknown 0x%08x"));
3681 if (param_length > 0) {
3682 switch(evt_code) {
3683 case 0x01: /* Inquiry Complete */
3684 offset=dissect_bthci_evt_inq_complete(tvb, offset, pinfo, bthci_evt_tree);
3685 break;
3687 case 0x02: /* Inquiry result event */
3688 offset=dissect_bthci_evt_inq_result(tvb, offset, pinfo, bthci_evt_tree);
3689 break;
3691 case 0x03: /* Connection Complete */
3692 offset=dissect_bthci_evt_conn_complete(tvb, offset, pinfo, bthci_evt_tree, hci_data);
3693 break;
3695 case 0x04: /* Connection Request */
3696 offset=dissect_bthci_evt_conn_request(tvb, offset, pinfo, bthci_evt_tree);
3697 break;
3699 case 0x05: /* Disconnection Complete */
3700 offset=dissect_bthci_evt_disconn_complete(tvb, offset, pinfo, bthci_evt_tree);
3701 break;
3703 case 0x06: /* Authentication Complete */
3704 offset=dissect_bthci_evt_auth_complete(tvb, offset, pinfo, bthci_evt_tree);
3705 break;
3707 case 0x07: /* Remote Name Request Complete */
3708 offset=dissect_bthci_evt_remote_name_req_complete(tvb, offset, pinfo, bthci_evt_tree, hci_data);
3709 break;
3711 case 0x08: /* Encryption Change */
3712 offset=dissect_bthci_evt_encryption_change(tvb, offset, pinfo, bthci_evt_tree);
3713 break;
3715 case 0x09: /* Change Connection Link Key Complete */
3716 offset=dissect_bthci_evt_change_conn_link_key_complete(tvb, offset, pinfo, bthci_evt_tree);
3717 break;
3719 case 0x0a: /* Master Link Key Complete */
3720 offset=dissect_bthci_evt_master_link_key_complete(tvb, offset, pinfo, bthci_evt_tree);
3721 break;
3723 case 0x0b: /* Read Remote Support Features Complete */
3724 offset=dissect_bthci_evt_read_remote_support_features_complete(tvb, offset, pinfo, bthci_evt_tree);
3725 break;
3727 case 0x0c: /* Read Remote Version Information Complete */
3728 offset=dissect_bthci_evt_read_remote_version_information_complete(tvb, offset, pinfo, bthci_evt_tree);
3729 break;
3731 case 0x0d: /* QoS Setup Complete */
3732 offset=dissect_bthci_evt_qos_setup_complete(tvb, offset, pinfo, bthci_evt_tree);
3733 break;
3735 case 0x0e: /* Command Complete */
3736 offset=dissect_bthci_evt_command_complete(tvb, offset, pinfo, bthci_evt_tree, hci_data);
3737 break;
3739 case 0x0f: /* Command Status */
3740 offset=dissect_bthci_evt_command_status(tvb, offset, pinfo, bthci_evt_tree);
3741 break;
3743 case 0x10: /* Hardware Error */
3744 offset=dissect_bthci_evt_hardware_error(tvb, offset, pinfo, bthci_evt_tree);
3745 break;
3747 case 0x11: /* Flush Occurred */
3748 offset=dissect_bthci_evt_flush_occured(tvb, offset, pinfo, bthci_evt_tree);
3749 break;
3751 case 0x12: /* Role Change */
3752 offset=dissect_bthci_evt_role_change(tvb, offset, pinfo, bthci_evt_tree);
3753 break;
3755 case 0x13: /* Number Of Completed Packets */
3756 offset=dissect_bthci_evt_number_of_completed_packets(tvb, offset, pinfo, bthci_evt_tree);
3757 break;
3759 case 0x14: /* Mode Change */
3760 offset=dissect_bthci_evt_mode_change(tvb, offset, pinfo, bthci_evt_tree);
3761 break;
3763 case 0x15: /* Return Link Keys */
3764 offset=dissect_bthci_evt_return_link_keys(tvb, offset, pinfo, bthci_evt_tree);
3765 break;
3767 case 0x16: /* PIN Code Request */
3768 offset=dissect_bthci_evt_pin_code_request(tvb, offset, pinfo, bthci_evt_tree);
3769 break;
3771 case 0x17: /* Link Key Request */
3772 offset=dissect_bthci_evt_link_key_request(tvb, offset, pinfo, bthci_evt_tree);
3773 break;
3775 case 0x18: /* Link Key Notification */
3776 offset=dissect_bthci_evt_link_key_notification(tvb, offset, pinfo, bthci_evt_tree);
3777 break;
3779 case 0x19: /* Loopback Command */
3780 offset=dissect_bthci_evt_loopback_command(tvb, offset, pinfo, bthci_evt_tree, hci_data);
3781 break;
3783 case 0x1a: /* Data Buffer Overflow */
3784 offset=dissect_bthci_evt_data_buffer_overflow(tvb, offset, pinfo, bthci_evt_tree);
3785 break;
3787 case 0x1b: /* Max Slots Change */
3788 offset=dissect_bthci_evt_max_slots_change(tvb, offset, pinfo, bthci_evt_tree);
3789 break;
3791 case 0x1c: /* Read Clock Offset Complete */
3792 offset=dissect_bthci_evt_read_clock_offset_complete(tvb, offset, pinfo, bthci_evt_tree);
3793 break;
3795 case 0x1d: /* Connection Packet Type Changed */
3796 offset=dissect_bthci_evt_conn_packet_type_changed(tvb, offset, pinfo, bthci_evt_tree);
3797 break;
3799 case 0x1e: /* QoS Violation */
3800 offset=dissect_bthci_evt_qos_violation(tvb, offset, pinfo, bthci_evt_tree);
3801 break;
3803 case 0x1f: /* Page Scan Mode Change */
3804 offset=dissect_bthci_evt_page_scan_mode_change(tvb, offset, pinfo, bthci_evt_tree);
3805 break;
3807 case 0x20: /* Page Scan Repetition Mode Change */
3808 offset=dissect_bthci_evt_page_scan_repetition_mode_change(tvb, offset, pinfo, bthci_evt_tree);
3809 break;
3811 case 0x21: /* Flow Specification Complete */
3812 offset=dissect_bthci_evt_flow_specification_complete(tvb, offset, pinfo, bthci_evt_tree);
3813 break;
3815 case 0x22: /* Inquiry Result with RSSI */
3816 offset=dissect_bthci_evt_inq_result_with_rssi(tvb, offset, pinfo, bthci_evt_tree, NULL);
3817 break;
3819 case 0x23: /* Read Remote Extended Features Complete */
3820 offset=dissect_bthci_evt_read_remote_ext_features_complete(tvb, offset, pinfo, bthci_evt_tree);
3821 break;
3823 case 0x2c: /* Synchronous Connection Complete */
3824 offset=dissect_bthci_evt_sync_connection_complete(tvb, offset, pinfo, bthci_evt_tree);
3825 break;
3827 case 0x2d: /* Synchronous Connection Changed */
3828 offset=dissect_bthci_evt_sync_connection_changed(tvb, offset, pinfo, bthci_evt_tree);
3829 break;
3831 case 0x2e: /* Sniff Subrating */
3832 offset=dissect_bthci_evt_sniff_subrating(tvb, offset, pinfo, bthci_evt_tree);
3833 break;
3835 case 0x2f: /* Extended Inquiry Result */
3836 /* TODO: Get bd_addr from first and pass to second*/
3837 offset = dissect_bthci_evt_inq_result_with_rssi(tvb, offset, pinfo, bthci_evt_tree, bd_addr);
3838 offset = dissect_bthci_evt_eir_ad_data(tvb, offset, pinfo, bthci_evt_tree, 240, bd_addr, hci_data);
3839 break;
3841 case 0x30: /* Encryption Key Refresh Complete */
3842 offset=dissect_bthci_evt_encryption_key_refresh_complete(tvb, offset, pinfo, bthci_evt_tree);
3843 break;
3845 case 0x31: /* IO Capability Request */
3846 offset=dissect_bthci_evt_io_capability_request(tvb, offset, pinfo, bthci_evt_tree);
3847 break;
3849 case 0x32: /* IO Capability Response */
3850 offset=dissect_bthci_evt_io_capability_response(tvb, offset, pinfo, bthci_evt_tree);
3851 break;
3853 case 0x33: /* User Confirmation Request */
3854 offset=dissect_bthci_evt_user_confirmation_request(tvb, offset, pinfo, bthci_evt_tree);
3855 break;
3857 case 0x34: /* User Passkey Request */
3858 offset=dissect_bthci_evt_user_passkey_request(tvb, offset, pinfo, bthci_evt_tree);
3859 break;
3861 case 0x35: /* Remote OOB Data Request */
3862 offset=dissect_bthci_evt_remote_oob_data_request(tvb, offset, pinfo, bthci_evt_tree);
3863 break;
3865 case 0x36: /* Simple Pairing Complete */
3866 offset=dissect_bthci_evt_simple_pairing_complete(tvb, offset, pinfo, bthci_evt_tree);
3867 break;
3869 case 0x38: /* Link Supervision Timeout Changed */
3870 offset=dissect_bthci_evt_link_supervision_timeout_changed(tvb, offset, pinfo, bthci_evt_tree);
3871 break;
3873 case 0x39: /* Enhanced Flush Complete */
3874 offset=dissect_bthci_evt_enhanced_flush_complete(tvb, offset, pinfo, bthci_evt_tree);
3875 break;
3877 case 0x3b: /* Enhanced Flush Complete */
3878 offset=dissect_bthci_evt_user_passkey_notification(tvb, offset, pinfo, bthci_evt_tree);
3879 break;
3881 case 0x3c: /* Enhanced Flush Complete */
3882 offset=dissect_bthci_evt_keypress_notification(tvb, offset, pinfo, bthci_evt_tree);
3883 break;
3885 case 0x3d: /* Remote Host Supported Features Notification */
3886 offset=dissect_bthci_evt_remote_host_sup_feat_notification(tvb, offset, pinfo, bthci_evt_tree);
3887 break;
3889 case 0x3e: /* LE Meta */
3890 offset=dissect_bthci_evt_le_meta(tvb, offset, pinfo, bthci_evt_tree, hci_data);
3891 break;
3893 case 0x40: /* Physical Link Complete */
3894 offset=dissect_bthci_evt_physical_link_complete(tvb, offset, pinfo, bthci_evt_tree);
3895 break;
3897 case 0x41: /* Channel Selected */
3898 case 0x44: /* Physical Link Recovery */
3899 offset=dissect_bthci_evt_channel_select_physical_link_recovery(tvb, offset, pinfo, bthci_evt_tree);
3900 break;
3902 case 0x42: /* Disconnect Physical Link Complete */
3903 offset=dissect_bthci_evt_disconnect_physical_link_complete(tvb, offset, pinfo, bthci_evt_tree);
3904 break;
3906 case 0x43: /* Physical Link Loss Early Warning */
3907 offset=dissect_bthci_evt_physical_link_loss_early_warning(tvb, offset, pinfo, bthci_evt_tree);
3908 break;
3910 case 0x45: /* Logical Link Complete */
3911 offset=dissect_bthci_evt_logical_link_complete(tvb, offset, pinfo, bthci_evt_tree);
3912 break;
3914 case 0x46: /* Disconnect Logical Link Complete */
3915 offset=dissect_bthci_evt_disconnect_logical_link_complete(tvb, offset, pinfo, bthci_evt_tree);
3916 break;
3918 case 0x47: /* Flow Spec Modify Complete */
3919 offset=dissect_bthci_evt_flow_spec_modify_complete(tvb, offset, pinfo, bthci_evt_tree);
3920 break;
3922 case 0x48: /* Number Of Completed Data Blocks */
3923 offset=dissect_bthci_evt_num_completed_data_blocks(tvb, offset, pinfo, bthci_evt_tree);
3924 break;
3926 case 0x49: /* AMP Start Test */
3927 case 0x4a: /* AMP Test End */
3928 offset=dissect_bthci_evt_amp_start_stop_test(tvb, offset, pinfo, bthci_evt_tree);
3929 break;
3931 case 0x4b: /* AMP Receiver Test */
3932 offset=dissect_bthci_evt_amp_receiver_test(tvb, offset, pinfo, bthci_evt_tree);
3933 break;
3935 case 0x4c: /* Short Range Mode Change Complete */
3936 offset=dissect_bthci_evt_short_range_mode_change_complete(tvb, offset, pinfo, bthci_evt_tree);
3937 break;
3939 case 0x4d: /* AMP Status Change */
3940 offset=dissect_bthci_evt_amp_status_change(tvb, offset, pinfo, bthci_evt_tree);
3941 break;
3943 case 0x4e: /* Triggered Clock Capture */
3944 case 0x4f: /* Synchronization Train Complete */
3945 case 0x50: /* Synchronization Train Received */
3946 case 0x51: /* Connectionless Slave Broadcast Receive */
3947 case 0x52: /* Connectionless Slave Broadcast Timeout */
3948 case 0x53: /* Truncated Page Complete */
3949 case 0x54: /* Slave Page Response Timeout */
3950 case 0x55: /* Connectionless Slave Broadcast Channel Map Change */
3951 case 0x56: /* Inquiry Response Notification */
3952 case 0xfe: /* Bluetooth Logo Testing */
3953 case 0xff: /* Vendor-Specific */
3954 /* TODO: Implement above cases */
3955 proto_tree_add_expert(bthci_evt_tree, pinfo, &ei_event_undecoded, tvb, offset, -1);
3956 offset += tvb_length_remaining(tvb, offset);
3957 break;
3959 default:
3960 proto_tree_add_expert(bthci_evt_tree, pinfo, &ei_event_unknown, tvb, offset, -1);
3961 offset += tvb_length_remaining(tvb, offset);
3962 break;
3967 return offset;
3971 /* Register the protocol with Wireshark */
3973 /* this format is require because a script is used to build the C function
3974 that calls all the protocol registration.
3977 void
3978 proto_register_bthci_evt(void)
3980 module_t *module;
3981 expert_module_t *expert_bthci_evt;
3983 /* Setup list of header fields See Section 1.6.1 for details*/
3984 static hf_register_info hf[] = {
3985 { &hf_bthci_evt_code,
3986 { "Event Code", "bthci_evt.code",
3987 FT_UINT8, BASE_HEX, VALS(evt_code_vals), 0x0,
3988 NULL, HFILL }
3990 { &hf_bthci_evt_param_length,
3991 { "Parameter Total Length", "bthci_evt.param_length",
3992 FT_UINT8, BASE_DEC, NULL, 0x0,
3993 NULL, HFILL }
3995 { &hf_bthci_evt_num_command_packets,
3996 { "Number of Allowed Command Packets", "bthci_evt.num_command_packets",
3997 FT_UINT8, BASE_DEC, NULL, 0x0,
3998 NULL, HFILL }
4000 { &hf_bthci_evt_num_handles,
4001 { "Number of Connection Handles", "bthci_evt.num_handles",
4002 FT_UINT8, BASE_DEC, NULL, 0x0,
4003 "Number of Connection Handles and Num_HCI_Data_Packets parameter pairs", HFILL }
4005 { &hf_bthci_evt_connection_handle,
4006 { "Connection Handle", "bthci_evt.connection_handle",
4007 FT_UINT16, BASE_HEX, NULL, 0x0,
4008 NULL, HFILL }
4011 { &hf_bthci_evt_num_compl_packets,
4012 { "Number of Completed Packets", "bthci_evt.num_compl_packets",
4013 FT_UINT16, BASE_DEC, NULL, 0x0,
4014 "The number of HCI Data Packets that have been completed", HFILL }
4017 { &hf_bthci_evt_opcode,
4018 { "Command Opcode", "bthci_evt.opcode",
4019 FT_UINT16, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_opcode_vals_ext, 0x0,
4020 "HCI Command Opcode", HFILL }
4022 { &hf_bthci_evt_ogf,
4023 { "Opcode Group Field", "bthci_evt.opcode.ogf",
4024 FT_UINT16, BASE_HEX|BASE_EXT_STRING, &bthci_ogf_vals_ext, 0xfc00,
4025 NULL, HFILL }
4027 { &hf_bthci_evt_ocf_link_control,
4028 { "Opcode Command Field", "bthci_evt.opcode.ocf",
4029 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_ocf_link_control_vals_ext, 0x03ff,
4030 NULL, HFILL }
4032 { &hf_bthci_evt_ocf_link_policy,
4033 { "Opcode Command Field", "bthci_evt.opcode.ocf",
4034 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_ocf_link_policy_vals_ext, 0x03ff,
4035 NULL, HFILL }
4037 { &hf_bthci_evt_ocf_host_controller_and_baseband,
4038 { "Opcode Command Field", "bthci_evt.opcode.ocf",
4039 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_ocf_host_controller_and_baseband_vals_ext, 0x03ff,
4040 NULL, HFILL }
4042 { &hf_bthci_evt_ocf_informational,
4043 { "Opcode Command Field", "bthci_evt.opcode.ocf",
4044 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_ocf_informational_vals_ext, 0x03ff,
4045 NULL, HFILL }
4047 { &hf_bthci_evt_ocf_status,
4048 { "Opcode Command Field", "bthci_evt.opcode.ocf",
4049 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_ocf_status_vals_ext, 0x03ff,
4050 NULL, HFILL }
4052 { &hf_bthci_evt_ocf_testing,
4053 { "Opcode Command Field", "bthci_evt.opcode.ocf",
4054 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_ocf_testing_vals_ext, 0x03ff,
4055 NULL, HFILL }
4057 { &hf_bthci_evt_ocf_low_energy,
4058 { "Opcode Command Field", "bthci_evt.opcode.ocf",
4059 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_ocf_low_energy_vals_ext, 0x03ff,
4060 NULL, HFILL }
4062 { &hf_bthci_evt_ocf_logo_testing,
4063 { "Opcode Command Field", "bthci_evt.opcode.ocf",
4064 FT_UINT16, BASE_HEX, NULL, 0x03ff,
4065 NULL, HFILL }
4067 { &hf_bthci_evt_ocf,
4068 { "Opcode Command Field", "bthci_evt.opcode.ocf",
4069 FT_UINT16, BASE_HEX, NULL, 0x03ff,
4070 NULL, HFILL }
4072 { &hf_bthci_evt_ret_params,
4073 { "Return Parameter", "bthci_evt.ret_params",
4074 FT_NONE, BASE_NONE, NULL, 0x0,
4075 NULL, HFILL }
4077 { &hf_bthci_evt_status,
4078 { "Status", "bthci_evt.status",
4079 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_status_vals_ext, 0x0,
4080 NULL, HFILL }
4082 { &hf_bthci_evt_status_pending,
4083 { "Status", "bthci_evt.status",
4084 FT_UINT8, BASE_HEX, VALS(bthci_cmd_status_pending_vals), 0x0,
4085 NULL, HFILL }
4087 { &hf_bthci_evt_bd_addr,
4088 { "BD_ADDR", "bthci_evt.bd_addr",
4089 FT_ETHER, BASE_NONE, NULL, 0x0,
4090 "Bluetooth Device Address", HFILL}
4092 { &hf_bthci_evt_class_of_device,
4093 { "Class of Device", "bthci_evt.class_of_device",
4094 FT_UINT24, BASE_HEX, NULL, 0x0,
4095 NULL, HFILL }
4097 { &hf_bthci_evt_cod_major_service_class_information,
4098 { "Major Service Classes: Information", "bthci_evt.class_of_device.major_service_classes.information",
4099 FT_BOOLEAN, 16, NULL, 0x8000,
4100 NULL, HFILL }
4102 { &hf_bthci_evt_cod_major_service_class_telephony,
4103 { "Major Service Classes: Telephony", "bthci_evt.class_of_device.major_service_classes.telephony",
4104 FT_BOOLEAN, 16, NULL, 0x4000,
4105 NULL, HFILL }
4107 { &hf_bthci_evt_cod_major_service_class_audio,
4108 { "Major Service Classes: Audio", "bthci_evt.class_of_device.major_service_classes.audio",
4109 FT_BOOLEAN, 16, NULL, 0x2000,
4110 NULL, HFILL }
4112 { &hf_bthci_evt_cod_major_service_class_object_transfer,
4113 { "Major Service Classes: Object Transfer", "bthci_evt.class_of_device.major_service_classes.object_transfer",
4114 FT_BOOLEAN, 16, NULL, 0x1000,
4115 NULL, HFILL }
4117 { &hf_bthci_evt_cod_major_service_class_capturing,
4118 { "Major Service Classes: Capturing", "bthci_evt.class_of_device.major_service_classes.capturing",
4119 FT_BOOLEAN, 16, NULL, 0x0800,
4120 NULL, HFILL }
4122 { &hf_bthci_evt_cod_major_service_class_rendering,
4123 { "Major Service Classes: Rendering", "bthci_evt.class_of_device.major_service_classes.rendering",
4124 FT_BOOLEAN, 16, NULL, 0x0400,
4125 NULL, HFILL }
4127 { &hf_bthci_evt_cod_major_service_class_networking,
4128 { "Major Service Classes: Networking", "bthci_evt.class_of_device.major_service_classes.networking",
4129 FT_BOOLEAN, 16, NULL, 0x0200,
4130 NULL, HFILL }
4132 { &hf_bthci_evt_cod_major_service_class_positioning,
4133 { "Major Service Classes: Positioning", "bthci_evt.class_of_device.major_service_classes.positioning",
4134 FT_BOOLEAN, 16, NULL, 0x0100,
4135 NULL, HFILL }
4137 { &hf_bthci_evt_cod_major_service_class_reserved,
4138 { "Major Service Classes: Reserved", "bthci_evt.class_of_device.major_service_classes.reserved",
4139 FT_UINT16, BASE_HEX, NULL, 0x00C0,
4140 NULL, HFILL }
4142 { &hf_bthci_evt_cod_major_service_class_limited_discoverable_mode,
4143 { "Major Service Classes: Limited Discoverable Mode", "bthci_evt.class_of_device.major_service_classes.limited_discoverable_mode",
4144 FT_BOOLEAN, 16, NULL, 0x0020,
4145 NULL, HFILL }
4147 { &hf_bthci_evt_cod_major_device_class,
4148 { "Major Device Class", "bthci_evt.class_of_device.major_device_class",
4149 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_major_device_class_vals_ext, 0x1F,
4150 NULL, HFILL }
4152 { &hf_bthci_evt_cod_minor_device_class_computer,
4153 { "Minor Device Class", "bthci_evt.class_of_device.minor_device_class",
4154 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_computer_vals_ext, 0xFC,
4155 NULL, HFILL }
4157 { &hf_bthci_evt_cod_minor_device_class_phone,
4158 { "Minor Device Class", "bthci_evt.class_of_device.minor_device_class",
4159 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_phone_vals_ext, 0xFC,
4160 NULL, HFILL }
4162 { &hf_bthci_evt_cod_minor_device_class_lan_net_load_factor,
4163 { "Minor Device Class: Load Factor", "bthci_evt.class_of_device.minor_device_class.load_factor",
4164 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_lan_net_load_factor_vals_ext, 0xE0,
4165 NULL, HFILL }
4167 { &hf_bthci_evt_cod_minor_device_class_lan_net_type,
4168 { "Minor Device Class: Type", "bthci_evt.class_of_device.minor_device_class.type",
4169 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_lan_net_type_vals_ext, 0x1C,
4170 NULL, HFILL }
4172 { &hf_bthci_evt_cod_minor_device_class_audio_video,
4173 { "Minor Device Class", "bthci_evt.class_of_device.minor_device_class",
4174 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_audio_video_vals_ext, 0xFC,
4175 NULL, HFILL }
4177 { &hf_bthci_evt_cod_minor_device_class_peripheral_class,
4178 { "Minor Device Class", "bthci_evt.class_of_device.minor_device_class",
4179 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_peripheral_class_vals_ext, 0xC0,
4180 NULL, HFILL }
4182 { &hf_bthci_evt_cod_minor_device_class_peripheral_type,
4183 { "Minor Device Class", "bthci_evt.class_of_device.minor_device_class",
4184 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_peripheral_type_vals_ext, 0x3C,
4185 NULL, HFILL }
4187 { &hf_bthci_evt_cod_minor_device_class_imaging_class_printer,
4188 { "Minor Device Class: Class: Printer", "bthci_evt.class_of_device.minor_device_class.class.printer",
4189 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_imaging_type_vals_ext, 0x80,
4190 NULL, HFILL }
4192 { &hf_bthci_evt_cod_minor_device_class_imaging_class_scanner,
4193 { "Minor Device Class: Class: Scanner", "bthci_evt.class_of_device.minor_device_class.class.scanner",
4194 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_imaging_type_vals_ext, 0x40,
4195 NULL, HFILL }
4197 { &hf_bthci_evt_cod_minor_device_class_imaging_class_camera,
4198 { "Minor Device Class: Class: Camera", "bthci_evt.class_of_device.minor_device_class.class.camera",
4199 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_imaging_type_vals_ext, 0x20,
4200 NULL, HFILL }
4202 { &hf_bthci_evt_cod_minor_device_class_imaging_class_display,
4203 { "Minor Device Class: Class: Display", "bthci_evt.class_of_device.minor_device_class.class.display",
4204 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_imaging_type_vals_ext, 0x10,
4205 NULL, HFILL }
4207 { &hf_bthci_evt_cod_minor_device_class_imaging_type,
4208 { "Minor Device Class: Type", "bthci_evt.class_of_device.minor_device_class.type",
4209 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_imaging_type_vals_ext, 0x0C,
4210 NULL, HFILL }
4212 { &hf_bthci_evt_cod_minor_device_class_wearable,
4213 { "Minor Device Class", "bthci_evt.class_of_device.minor_device_class",
4214 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_wearable_vals_ext, 0xFC,
4215 NULL, HFILL }
4217 { &hf_bthci_evt_cod_minor_device_class_toy,
4218 { "Minor Device Class", "bthci_evt.class_of_device.minor_device_class",
4219 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_toy_vals_ext, 0xFC,
4220 NULL, HFILL }
4222 { &hf_bthci_evt_cod_minor_device_class_health,
4223 { "Minor Device Class", "bthci_evt.class_of_device.minor_device_class",
4224 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_health_vals_ext, 0xFC,
4225 NULL, HFILL }
4227 { &hf_bthci_evt_cod_minor_device_class_unknown,
4228 { "Minor Device Class", "bthci_evt.class_of_device.minor_device_class",
4229 FT_UINT8, BASE_HEX, NULL, 0xFC,
4230 NULL, HFILL }
4232 { &hf_bthci_evt_cod_format_type,
4233 { "Format Type", "bthci_evt.class_of_device.format_type",
4234 FT_UINT8, BASE_HEX, NULL, 0x03,
4235 NULL, HFILL }
4237 { &hf_bthci_evt_link_type,
4238 { "Link Type", "bthci_evt.link_type",
4239 FT_UINT8, BASE_HEX, VALS(evt_link_types), 0x0,
4240 NULL, HFILL }
4242 { &hf_bthci_evt_encryption_mode,
4243 { "Encryption Mode", "bthci_evt.encryption_mode",
4244 FT_UINT8, BASE_HEX, VALS(evt_encryption_modes), 0x0,
4245 NULL, HFILL }
4247 { &hf_bthci_evt_reason,
4248 { "Reason", "bthci_evt.reason",
4249 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_status_vals_ext, 0x0,
4250 NULL, HFILL }
4252 { &hf_bthci_evt_remote_name,
4253 { "Remote Name", "bthci_evt.remote_name",
4254 FT_STRINGZ, BASE_NONE, NULL, 0x0,
4255 "Userfriendly descriptive name for the remote device", HFILL }
4257 { &hf_bthci_evt_encryption_enable,
4258 { "Encryption Enable", "bthci_evt.encryption_enable",
4259 FT_UINT8, BASE_HEX, VALS(evt_encryption_enable), 0x0,
4260 NULL, HFILL }
4262 { &hf_bthci_evt_key_flag,
4263 { "Key Flag", "bthci_evt.key_flag",
4264 FT_UINT8, BASE_HEX, VALS(evt_key_flag), 0x0,
4265 NULL, HFILL }
4267 { &hf_bthci_evt_vers_nr,
4268 { "LMP Version", "bthci_evt.lmp_vers_nr",
4269 FT_UINT8, BASE_HEX, VALS(evt_lmp_vers_nr), 0x0,
4270 "Version of the Current LMP", HFILL }
4272 { &hf_bthci_evt_hci_vers_nr,
4273 { "HCI Version", "bthci_evt.hci_vers_nr",
4274 FT_UINT8, BASE_HEX, VALS(evt_hci_vers_nr), 0x0,
4275 "Version of the Current HCI", HFILL }
4277 { &hf_bthci_evt_hci_revision,
4278 { "HCI Revision", "bthci_evt.hci_vers_nr",
4279 FT_UINT16, BASE_DEC, NULL, 0x0,
4280 "Revision of the Current HCI", HFILL }
4282 { &hf_bthci_evt_comp_id,
4283 { "Manufacturer Name", "bthci_evt.comp_id",
4284 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_evt_comp_id_ext, 0x0,
4285 "Manufacturer Name of Bluetooth Hardware", HFILL }
4287 { &hf_bthci_evt_sub_vers_nr,
4288 { "LMP Subversion", "bthci_evt.lmp_sub_vers_nr",
4289 FT_UINT16, BASE_DEC, NULL, 0x0,
4290 "Subversion of the Current LMP", HFILL }
4292 { &hf_bthci_evt_flags,
4293 { "Flags", "bthci_evt.flags",
4294 FT_UINT8, BASE_HEX, NULL, 0x0,
4295 NULL, HFILL }
4297 { &hf_bthci_evt_service_type,
4298 { "Service Type", "bthci_evt.service_type",
4299 FT_UINT8, BASE_HEX, VALS(evt_service_types), 0x0,
4300 NULL, HFILL }
4302 { &hf_bthci_evt_token_rate,
4303 { "Available Token Rate", "bthci_evt.token_rate",
4304 FT_UINT32, BASE_DEC, NULL, 0x0,
4305 "Available Token Rate, in bytes per second", HFILL }
4307 { &hf_bthci_evt_peak_bandwidth,
4308 { "Available Peak Bandwidth", "bthci_evt.peak_bandwidth",
4309 FT_UINT32, BASE_DEC, NULL, 0x0,
4310 "Available Peak Bandwidth, in bytes per second", HFILL }
4312 { &hf_bthci_evt_latency,
4313 { "Available Latency", "bthci_evt.latency",
4314 FT_UINT32, BASE_DEC, NULL, 0x0,
4315 "Available Latency, in microseconds", HFILL }
4317 { &hf_bthci_evt_delay_variation,
4318 { "Available Delay Variation", "bthci_evt.delay_variation",
4319 FT_UINT32, BASE_DEC, NULL, 0x0,
4320 "Available Delay Variation, in microseconds", HFILL }
4322 { &hf_bthci_evt_hardware_code,
4323 { "Hardware Code", "bthci_evt.hardware_code",
4324 FT_UINT8, BASE_HEX, NULL, 0x0,
4325 "Hardware Code (implementation specific)", HFILL }
4327 { &hf_bthci_evt_role,
4328 { "Role", "bthci_evt.role",
4329 FT_UINT8, BASE_HEX, VALS(evt_role_vals), 0x0,
4330 NULL, HFILL }
4332 { &hf_bthci_evt_curr_mode,
4333 { "Current Mode", "bthci_evt.current_mode",
4334 FT_UINT8, BASE_HEX, VALS(evt_modes), 0x0,
4335 NULL, HFILL }
4337 { &hf_bthci_evt_interval,
4338 { "Interval", "bthci_evt.interval",
4339 FT_UINT16, BASE_DEC, NULL, 0x0,
4340 "Interval - Number of Baseband slots", HFILL }
4342 { &hf_bthci_evt_link_key,
4343 { "Link Key", "bthci_evt.link_key",
4344 FT_BYTES, BASE_NONE, NULL, 0x0,
4345 "Link Key for the associated BD_ADDR", HFILL }
4347 { &hf_bthci_evt_key_type,
4348 { "Key Type", "bthci_evt.key_type",
4349 FT_UINT8, BASE_HEX, VALS(evt_key_types), 0x0,
4350 NULL, HFILL }
4352 { &hf_bthci_evt_max_slots,
4353 { "Maximum Number of Slots", "bthci_evt.max_slots",
4354 FT_UINT8, BASE_DEC, NULL, 0x0,
4355 "Maximum Number of slots allowed for baseband packets", HFILL }
4357 { &hf_bthci_evt_clock_offset,
4358 { "Clock Offset", "bthci_evt.clock_offset",
4359 FT_UINT16, BASE_HEX, NULL, 0x7FFF,
4360 "Bit 2-16 of the Clock Offset between CLKmaster-CLKslave", HFILL }
4362 { &hf_bthci_evt_page_scan_mode,
4363 { "Page Scan Mode", "bthci_evt.page_scan_mode",
4364 FT_UINT8, BASE_HEX, VALS(bthci_cmd_page_scan_modes), 0x0,
4365 NULL, HFILL }
4367 { &hf_bthci_evt_page_scan_repetition_mode,
4368 { "Page Scan Repetition Mode", "bthci_evt.page_scan_repetition_mode",
4369 FT_UINT8, BASE_HEX, VALS(bthci_cmd_page_scan_repetition_modes), 0x0,
4370 NULL, HFILL }
4372 { &hf_bthci_evt_page_scan_period_mode,
4373 { "Page Scan Period Mode", "bthci_evt.page_scan_period_mode",
4374 FT_UINT8, BASE_HEX, VALS(bthci_cmd_page_scan_period_modes), 0x0,
4375 NULL, HFILL }
4377 { &hf_bthci_evt_link_type_2dh1,
4378 { "ACL Link Type 2-DH1", "bthci_evt.link_type_2dh1",
4379 FT_BOOLEAN, 16, NULL, 0x0002,
4380 NULL, HFILL }
4382 { &hf_bthci_evt_link_type_3dh1,
4383 { "ACL Link Type 3-DH1", "bthci_evt.link_type_3dh1",
4384 FT_BOOLEAN, 16, NULL, 0x0004,
4385 NULL, HFILL }
4387 { &hf_bthci_evt_link_type_dm1,
4388 { "ACL Link Type DM1", "bthci_evt.link_type_dm1",
4389 FT_BOOLEAN, 16, NULL, 0x0008,
4390 NULL, HFILL }
4392 { &hf_bthci_evt_link_type_dh1,
4393 { "ACL Link Type DH1", "bthci_evt.link_type_dh1",
4394 FT_BOOLEAN, 16, NULL, 0x0010,
4395 NULL, HFILL }
4397 { &hf_bthci_evt_link_type_2dh3,
4398 { "ACL Link Type 2-DH3", "bthci_evt.link_type_2dh3",
4399 FT_BOOLEAN, 16, NULL, 0x0100,
4400 NULL, HFILL }
4402 { &hf_bthci_evt_link_type_3dh3,
4403 { "ACL Link Type 3-DH3", "bthci_evt.link_type_3dh3",
4404 FT_BOOLEAN, 16, NULL, 0x0200,
4405 NULL, HFILL }
4407 { &hf_bthci_evt_link_type_dm3,
4408 { "ACL Link Type DM3", "bthci_evt.link_type_dm3",
4409 FT_BOOLEAN, 16, NULL, 0x0400,
4410 NULL, HFILL }
4412 { &hf_bthci_evt_link_type_dh3,
4413 { "ACL Link Type DH3", "bthci_evt.link_type_dh3",
4414 FT_BOOLEAN, 16, NULL, 0x0800,
4415 NULL, HFILL }
4417 { &hf_bthci_evt_link_type_2dh5,
4418 { "ACL Link Type 2-DH5", "bthci_evt.link_type_2dh5",
4419 FT_BOOLEAN, 16, NULL, 0x1000,
4420 NULL, HFILL }
4422 { &hf_bthci_evt_link_type_3dh5,
4423 { "ACL Link Type 3-DH5", "bthci_evt.link_type_3dh5",
4424 FT_BOOLEAN, 16, NULL, 0x2000,
4425 NULL, HFILL }
4427 { &hf_bthci_evt_link_type_dm5,
4428 { "ACL Link Type DM5", "bthci_evt.link_type_dm5",
4429 FT_BOOLEAN, 16, NULL, 0x4000,
4430 NULL, HFILL }
4432 { &hf_bthci_evt_link_type_dh5,
4433 { "ACL Link Type DH5", "bthci_evt.link_type_dh5",
4434 FT_BOOLEAN, 16, NULL, 0x8000,
4435 NULL, HFILL }
4437 { &hf_bthci_evt_link_type_hv1,
4438 { "SCO Link Type HV1", "bthci_evt.link_type_hv1",
4439 FT_BOOLEAN, 16, NULL, 0x0020,
4440 NULL, HFILL }
4442 { &hf_bthci_evt_link_type_hv2,
4443 { "SCO Link Type HV2", "bthci_evt.link_type_hv2",
4444 FT_BOOLEAN, 16, NULL, 0x0040,
4445 NULL, HFILL }
4447 { &hf_bthci_evt_link_type_hv3,
4448 { "SCO Link Type HV3", "bthci_evt.link_type_hv3",
4449 FT_BOOLEAN, 16, NULL, 0x0080,
4450 NULL, HFILL }
4452 { &hf_lmp_features,
4453 { "LMP Features", "bthci_evt.lmp_features",
4454 FT_NONE, BASE_NONE, NULL, 0x00,
4455 NULL, HFILL }
4457 { &hf_lmp_feature_3slot_packets,
4458 { "3-slot packets", "bthci_evt.lmp_features.3slot_packets",
4459 FT_BOOLEAN, 8, NULL, 0x01,
4460 NULL, HFILL }
4462 { &hf_lmp_feature_5slot_packets,
4463 { "5-slot packets", "bthci_evt.lmp_features.5slot_packets",
4464 FT_BOOLEAN, 8, NULL, 0x02,
4465 NULL, HFILL }
4467 { &hf_lmp_feature_encryption,
4468 { "Encryption", "bthci_evt.lmp_features.encryption",
4469 FT_BOOLEAN, 8, NULL, 0x04,
4470 NULL, HFILL }
4472 { &hf_lmp_feature_slot_offset,
4473 { "Slot Offset", "bthci_evt.lmp_features.slot_offset",
4474 FT_BOOLEAN, 8, NULL, 0x08,
4475 NULL, HFILL }
4477 { &hf_lmp_feature_timing_accuracy,
4478 { "Timing Accuracy", "bthci_evt.lmp_features.timing_accuracy",
4479 FT_BOOLEAN, 8, NULL, 0x10,
4480 NULL, HFILL }
4482 { &hf_lmp_feature_role_switch,
4483 { "Role Switch", "bthci_evt.lmp_features.role_switch",
4484 FT_BOOLEAN, 8, NULL, 0x20,
4485 NULL, HFILL }
4487 { &hf_lmp_feature_hold_mode,
4488 { "Hold Mode", "bthci_evt.lmp_features.hold_mode",
4489 FT_BOOLEAN, 8, NULL, 0x40,
4490 NULL, HFILL }
4492 { &hf_lmp_feature_sniff_mode,
4493 { "Sniff Mode", "bthci_evt.lmp_features.sniff_mode",
4494 FT_BOOLEAN, 8, NULL, 0x80,
4495 NULL, HFILL }
4497 { &hf_lmp_feature_park_state,
4498 { "Park Mode", "bthci_evt.lmp_features.park_state",
4499 FT_BOOLEAN, 8, NULL, 0x01,
4500 NULL, HFILL }
4502 { &hf_lmp_feature_power_control_requests,
4503 { "Power Control Requests", "bthci_evt.lmp_features.power_control_requests",
4504 FT_BOOLEAN, 8, NULL, 0x02,
4505 NULL, HFILL }
4507 { &hf_lmp_feature_channel_quality_driven_data_rate,
4508 { "Channel Quality Driven Data Rate", "bthci_evt.lmp_features.channel_quality_driven_data_rate",
4509 FT_BOOLEAN, 8, NULL, 0x04,
4510 NULL, HFILL }
4512 { &hf_lmp_feature_sco_link,
4513 { "SCO Link", "bthci_evt.lmp_features.sco_link",
4514 FT_BOOLEAN, 8, NULL, 0x08,
4515 NULL, HFILL }
4517 { &hf_lmp_feature_hv2_packets,
4518 { "HV2 packets", "bthci_evt.lmp_features.hv2_packets",
4519 FT_BOOLEAN, 8, NULL, 0x10,
4520 NULL, HFILL }
4522 { &hf_lmp_feature_hv3_packets,
4523 { "HV3 packets", "bthci_evt.lmp_features.hv3_packets",
4524 FT_BOOLEAN, 8, NULL, 0x20,
4525 NULL, HFILL }
4527 { &hf_lmp_feature_u_law_log_synchronous_data,
4528 { "u-law Log Synchronous Data", "bthci_evt.lmp_features.u_law_log_synchronous_data",
4529 FT_BOOLEAN, 8, NULL, 0x40,
4530 NULL, HFILL }
4532 { &hf_lmp_feature_a_law_log_synchronous_data,
4533 { "A-law Log Synchronous Data", "bthci_evt.lmp_features.a_law_log_synchronous_data",
4534 FT_BOOLEAN, 8, NULL, 0x80,
4535 NULL, HFILL }
4537 { &hf_lmp_feature_cvsd_synchronous_data,
4538 { "CVSD Synchronous Data", "bthci_evt.lmp_features.cvsd_synchronous_data",
4539 FT_BOOLEAN, 8, NULL, 0x01,
4540 NULL, HFILL }
4542 { &hf_lmp_feature_paging_parameter_negotiation,
4543 { "Paging Parameter Negotiation", "bthci_evt.lmp_features.paging_parameter_negotiation",
4544 FT_BOOLEAN, 8, NULL, 0x02,
4545 NULL, HFILL }
4547 { &hf_lmp_feature_power_control,
4548 { "Power Control", "bthci_evt.lmp_features.power_control",
4549 FT_BOOLEAN, 8, NULL, 0x04,
4550 NULL, HFILL }
4552 { &hf_lmp_feature_transparent_synchronous_data,
4553 { "Transparent Synchronous Data", "bthci_evt.lmp_features.transparent_synchronous_data",
4554 FT_BOOLEAN, 8, NULL, 0x08,
4555 NULL, HFILL }
4557 { &hf_lmp_feature_flow_control_lag,
4558 { "Flow Control Lag", "bthci_evt.lmp_features.flow_control_lag",
4559 FT_UINT8, BASE_DEC, NULL, 0x70,
4560 NULL, HFILL }
4562 { &hf_lmp_feature_broadcast_encryption,
4563 { "Broadband Encryption", "bthci_evt.lmp_features.broadcast_encryption",
4564 FT_BOOLEAN, 8, NULL, 0x80,
4565 NULL, HFILL }
4567 { &hf_lmp_feature_reserved_24,
4568 { "Reserved", "bthci_evt.lmp_features.reserved.24",
4569 FT_BOOLEAN, 8, NULL, 0x01,
4570 NULL, HFILL }
4572 { &hf_lmp_feature_edr_acl_2mbps_mode,
4573 { "EDR ACL 2 Mbps Mode", "bthci_evt.lmp_features.edr_acl_2mbps_mode",
4574 FT_BOOLEAN, 8, NULL, 0x02,
4575 NULL, HFILL }
4577 { &hf_lmp_feature_edr_acl_3mbps_mode,
4578 { "EDR ACL 3 Mbps Mode", "bthci_evt.lmp_features.edr_acl_3mbps_mode",
4579 FT_BOOLEAN, 8, NULL, 0x04,
4580 NULL, HFILL }
4582 { &hf_lmp_feature_enhanced_inquiry_scan,
4583 { "Enhanced Inquiry Scan", "bthci_evt.lmp_features.enhanced_inquiry_scan",
4584 FT_BOOLEAN, 8, NULL, 0x08,
4585 NULL, HFILL }
4587 { &hf_lmp_feature_interlaced_inquiry_scan,
4588 { "Interlaced Inquiry Scan", "bthci_evt.lmp_features.interlaced_inquiry_scan",
4589 FT_BOOLEAN, 8, NULL, 0x10,
4590 NULL, HFILL }
4592 { &hf_lmp_feature_interlaced_page_scan,
4593 { "Interlaced Page Scan", "bthci_evt.lmp_features.interlaced_page_scan",
4594 FT_BOOLEAN, 8, NULL, 0x20,
4595 NULL, HFILL }
4597 { &hf_lmp_feature_rssi_with_inquiry_results,
4598 { "RSSI with Inquiry Results", "bthci_evt.lmp_features.rssi_with_inquiry_results",
4599 FT_BOOLEAN, 8, NULL, 0x40,
4600 NULL, HFILL }
4602 { &hf_lmp_feature_ev3_packets,
4603 { "EV3 Packets", "bthci_evt.lmp_features.ev3_packets",
4604 FT_BOOLEAN, 8, NULL, 0x80,
4605 NULL, HFILL }
4607 { &hf_lmp_feature_ev4_packets,
4608 { "EV4 Packets", "bthci_evt.lmp_features.ev4_packets",
4609 FT_BOOLEAN, 8, NULL, 0x01,
4610 NULL, HFILL }
4612 { &hf_lmp_feature_ev5_packets,
4613 { "EV5 Packets", "bthci_evt.lmp_features.ev5_packets",
4614 FT_BOOLEAN, 8, NULL, 0x02,
4615 NULL, HFILL }
4617 { &hf_lmp_feature_reserved_34,
4618 { "Reserved", "bthci_evt.lmp_features.reserved.34",
4619 FT_BOOLEAN, 8, NULL, 0x04,
4620 NULL, HFILL }
4622 { &hf_lmp_feature_afh_capable_slave,
4623 { "AFH Capable Slave", "bthci_evt.lmp_features.afh_capable_slave",
4624 FT_BOOLEAN, 8, NULL, 0x08,
4625 NULL, HFILL }
4627 { &hf_lmp_feature_afh_classification_slave,
4628 { "AFH Classification Slave", "bthci_evt.lmp_features.afh_classification_slave",
4629 FT_BOOLEAN, 8, NULL, 0x10,
4630 NULL, HFILL }
4632 { &hf_lmp_feature_br_edr_not_supported,
4633 { "BR/EDR Not Supported", "bthci_evt.lmp_features.br_edr_not_supported",
4634 FT_BOOLEAN, 8, NULL, 0x20,
4635 NULL, HFILL }
4637 { &hf_lmp_feature_le_supported_controller,
4638 { "LE Supported Controller", "bthci_evt.lmp_features.le_supported_controller",
4639 FT_BOOLEAN, 8, NULL, 0x40,
4640 NULL, HFILL }
4642 { &hf_lmp_feature_3slot_edr_acl_packets,
4643 { "3-slot EDR ACL packets", "bthci_evt.lmp_features.3slot_edr_acl_packets",
4644 FT_BOOLEAN, 8, NULL, 0x80,
4645 NULL, HFILL }
4647 { &hf_lmp_feature_5slot_edr_acl_packets,
4648 { "5-slot EDR ACL packets", "bthci_evt.lmp_features.5slot_edr_acl_packets",
4649 FT_BOOLEAN, 8, NULL, 0x01,
4650 NULL, HFILL }
4652 { &hf_lmp_feature_sniff_subrating,
4653 { "Sniff Subrating", "bthci_evt.lmp_features.sniff_subrating",
4654 FT_BOOLEAN, 8, NULL, 0x02,
4655 NULL, HFILL }
4657 { &hf_lmp_feature_pause_encryption,
4658 { "Pause Encryption", "bthci_evt.lmp_features.pause_encryption",
4659 FT_BOOLEAN, 8, NULL, 0x04,
4660 NULL, HFILL }
4662 { &hf_lmp_feature_afh_capable_master,
4663 { "AFH Capable Master", "bthci_evt.lmp_features.afh_capable_master",
4664 FT_BOOLEAN, 8, NULL, 0x08,
4665 NULL, HFILL }
4667 { &hf_lmp_feature_afh_classification_master,
4668 { "AFH Classification Master", "bthci_evt.lmp_features.afh_classification_master",
4669 FT_BOOLEAN, 8, NULL, 0x10,
4670 NULL, HFILL }
4672 { &hf_lmp_feature_edr_esco_2mbps_mode,
4673 { "EDR eSCO 2 Mbps Mode", "bthci_evt.lmp_features.edr_esco_2mbps_mode",
4674 FT_BOOLEAN, 8, NULL, 0x20,
4675 NULL, HFILL }
4677 { &hf_lmp_feature_edr_esco_3mbps_mode,
4678 { "EDR eSCO 3 Mbps Mode", "bthci_evt.lmp_features.edr_esco_3mbps_mode",
4679 FT_BOOLEAN, 8, NULL, 0x40,
4680 NULL, HFILL }
4682 { &hf_lmp_feature_3slot_edr_esco_packets,
4683 { "3-slot EDR eSCO Packets", "bthci_evt.lmp_features.3slot_edr_esco_packets",
4684 FT_BOOLEAN, 8, NULL, 0x80,
4685 NULL, HFILL }
4687 { &hf_lmp_feature_extended_inquiry_response,
4688 { "Extended Inquiry Response", "bthci_evt.lmp_features.extended_inquiry_response",
4689 FT_BOOLEAN, 8, NULL, 0x01,
4690 NULL, HFILL }
4692 { &hf_lmp_feature_simultaneous_le_and_br_edr_controller,
4693 {"Simultaneous LE and BR/EDR to Same Device Capable Controller", "bthci_evt.lmp_features.simultaneous_le_and_br_edr.controller",
4694 FT_BOOLEAN, 8, NULL, 0x02,
4695 NULL, HFILL}
4697 { &hf_lmp_feature_reserved_50,
4698 { "Reserved", "bthci_evt.lmp_features.reserved.50",
4699 FT_BOOLEAN, 8, NULL, 0x04,
4700 NULL, HFILL }
4702 { &hf_lmp_feature_secure_simple_pairing,
4703 { "Secure Simple Pairing", "bthci_evt.lmp_features.secure_simple_pairing",
4704 FT_BOOLEAN, 8, NULL, 0x08,
4705 NULL, HFILL }
4707 { &hf_lmp_feature_encapsulated_pdu,
4708 { "Encapsulated PDU", "bthci_evt.lmp_features.encapsulated_pdu",
4709 FT_BOOLEAN, 8, NULL, 0x10,
4710 NULL, HFILL }
4712 { &hf_lmp_feature_erroneous_data_reporting,
4713 { "Erroneous Data Reporting", "bthci_evt.lmp_features.erroneous_data_reporting",
4714 FT_BOOLEAN, 8, NULL, 0x20,
4715 NULL, HFILL }
4717 { &hf_lmp_feature_non_flushable_packet_boundary_flag,
4718 { "Non-flushable Packet Boundary Flag", "bthci_evt.lmp_features.non_flushable_packet_boundary_flag",
4719 FT_BOOLEAN, 8, NULL, 0x40,
4720 NULL, HFILL }
4722 { &hf_lmp_feature_reserved_55,
4723 { "Reserved", "bthci_evt.lmp_features.reserved.55",
4724 FT_BOOLEAN, 8, NULL, 0x80,
4725 NULL, HFILL }
4727 { &hf_lmp_feature_link_supervision_timeout_changed_event,
4728 { "Link Supervision Timeout Changed Event", "bthci_evt.lmp_features.supervision_timeout_changed_event",
4729 FT_BOOLEAN, 8, NULL, 0x01,
4730 NULL, HFILL }
4732 { &hf_lmp_feature_inquiry_tx_power_level,
4733 { "Inquiry TX Power Level", "bthci_evt.lmp_features.inquiry_tx_power_level",
4734 FT_BOOLEAN, 8, NULL, 0x02,
4735 NULL, HFILL }
4737 { &hf_lmp_feature_enhanced_power_control,
4738 { "Enhanced Power Control", "bthci_evt.lmp_features.enhanced_power_control",
4739 FT_BOOLEAN, 8, NULL, 0x04,
4740 NULL, HFILL }
4742 { &hf_lmp_feature_reserved_59_62,
4743 { "Reserved", "bthci_evt.lmp_features.reserved.59_62",
4744 FT_BOOLEAN, 8, NULL, 0x78,
4745 NULL, HFILL }
4747 { &hf_lmp_feature_extended_features,
4748 { "Extended Features", "bthci_evt.lmp_features.extended_features",
4749 FT_BOOLEAN, 8, NULL, 0x80,
4750 NULL, HFILL }
4752 { &hf_lmp_feature_secure_simple_pairing_host,
4753 {"Secure Simple Pairing Host", "bthci_evt.lmp_features.secure_simple_pairing_host",
4754 FT_BOOLEAN, 8, NULL, 0x01,
4755 NULL, HFILL}
4757 { &hf_lmp_feature_le_supported_host,
4758 {"LE Supported Host", "bthci_evt.lmp_features.le_supported.host",
4759 FT_BOOLEAN, 8, NULL, 0x02,
4760 NULL, HFILL}
4762 { &hf_lmp_feature_simultaneous_le_and_br_edr_host,
4763 {"Simultaneous LE and BR/EDR to Same Device Capable Host", "bthci_evt.lmp_features.simultaneous_le_and_br_edr.host",
4764 FT_BOOLEAN, 8, NULL, 0x04,
4765 NULL, HFILL}
4767 { &hf_lmp_feature_reserved_67_71,
4768 {"Reserved", "bthci_evt.lmp_features.reserved.67_71",
4769 FT_UINT8, BASE_HEX, NULL, 0xF8,
4770 NULL, HFILL}
4772 { &hf_lmp_feature_reserved,
4773 {"Reserved", "bthci_evt.lmp_features.reserved",
4774 FT_BYTES, BASE_NONE, NULL, 0x0,
4775 NULL, HFILL}
4777 { &hf_bthci_evt_num_keys,
4778 { "Number of Link Keys", "bthci_evt.num_keys",
4779 FT_UINT8, BASE_DEC, NULL, 0x0,
4780 "Number of Link Keys contained", HFILL }
4782 { &hf_bthci_evt_num_keys_read,
4783 { "Number of Link Keys Read", "bthci_evt.num_keys_read",
4784 FT_UINT16, BASE_DEC, NULL, 0x0,
4785 NULL, HFILL }
4787 { &hf_bthci_evt_num_keys_deleted,
4788 { "Number of Link Keys Deleted", "bthci_evt.num_keys_deleted",
4789 FT_UINT16, BASE_DEC, NULL, 0x0,
4790 NULL, HFILL }
4792 { &hf_bthci_evt_num_keys_written,
4793 { "Number of Link Keys Written", "bthci_evt.num_keys_written",
4794 FT_UINT8, BASE_DEC, NULL, 0x0,
4795 NULL, HFILL }
4797 { &hf_bthci_evt_max_num_keys,
4798 { "Max Num Keys", "bthci_evt.max_num_keys",
4799 FT_UINT16, BASE_DEC, NULL, 0x0,
4800 "Total Number of Link Keys that the Host Controller can store", HFILL }
4802 { &hf_bthci_evt_num_responses,
4803 { "Number of responses", "bthci_evt.num_responses",
4804 FT_UINT8, BASE_DEC, NULL, 0x0,
4805 "Number of Responses from Inquiry", HFILL }
4807 { &hf_bthci_evt_link_policy_setting_switch,
4808 { "Enable Master Slave Switch", "bthci_evt.link_policy_switch",
4809 FT_BOOLEAN, 16, NULL, 0x0001,
4810 NULL, HFILL }
4812 { &hf_bthci_evt_link_policy_setting_hold,
4813 { "Enable Hold Mode", "bthci_evt.link_policy_hold",
4814 FT_BOOLEAN, 16, NULL, 0x0002,
4815 NULL, HFILL }
4817 { &hf_bthci_evt_link_policy_setting_sniff,
4818 { "Enable Sniff Mode", "bthci_evt.link_policy_sniff",
4819 FT_BOOLEAN, 16, NULL, 0x0004,
4820 NULL, HFILL }
4822 { &hf_bthci_evt_link_policy_setting_park,
4823 { "Enable Park Mode", "bthci_evt.link_policy_park",
4824 FT_BOOLEAN, 16, NULL, 0x0008,
4825 NULL, HFILL }
4827 { &hf_bthci_evt_curr_role,
4828 { "Current Role", "bthci_evt.curr_role",
4829 FT_UINT8, BASE_HEX, VALS(evt_role_vals_handle), 0x0,
4830 "Current role for this connection handle", HFILL }
4832 { &hf_bthci_evt_pin_type,
4833 { "PIN Type", "bthci_evt.pin_type",
4834 FT_UINT8, BASE_HEX, VALS(evt_pin_types), 0x0,
4835 "PIN Types", HFILL }
4837 { &hf_bthci_evt_device_name,
4838 { "Device Name", "bthci_evt.device_name",
4839 FT_STRINGZ, BASE_NONE, NULL, 0x0,
4840 "Userfriendly descriptive name for the device", HFILL }
4842 { &hf_bthci_evt_timeout,
4843 { "Timeout", "bthci_evt.timeout",
4844 FT_UINT16, BASE_DEC, NULL, 0x0,
4845 "Number of Baseband slots for timeout.", HFILL }
4847 { &hf_bthci_evt_scan_enable,
4848 { "Scan", "bthci_evt.scan_enable",
4849 FT_UINT8, BASE_HEX, VALS(bthci_cmd_scan_enable_values), 0x0,
4850 "Scan Enable", HFILL }
4852 { &hf_bthci_evt_authentication_enable,
4853 { "Authentication", "bthci_evt.auth_enable",
4854 FT_UINT8, BASE_HEX, VALS(evt_auth_enable_values), 0x0,
4855 "Authentication Enable", HFILL }
4857 { &hf_bthci_evt_sco_flow_cont_enable,
4858 { "SCO Flow Control", "bthci_evt.sco_flow_cont_enable",
4859 FT_UINT8, BASE_HEX, VALS(evt_enable_values), 0x0,
4860 "SCO Flow Control Enable", HFILL }
4862 { &hf_bthci_evt_window,
4863 { "Interval", "bthci_evt.window",
4864 FT_UINT16, BASE_DEC, NULL, 0x0,
4865 "Window", HFILL }
4867 { &hf_bthci_evt_input_unused,
4868 { "Unused bits", "bthci_evt.voice.unused",
4869 FT_UINT16, BASE_HEX, NULL, 0xfc00,
4870 NULL, HFILL }
4872 { &hf_bthci_evt_input_coding,
4873 { "Input Coding", "bthci_evt.voice.input_coding",
4874 FT_UINT16, BASE_DEC | BASE_EXT_STRING, &bthci_cmd_input_coding_vals_ext, 0x0300,
4875 "Authentication Enable", HFILL }
4877 { &hf_bthci_evt_input_data_format,
4878 { "Input Data Format", "bthci_evt.voice.input_data_format",
4879 FT_UINT16, BASE_DEC | BASE_EXT_STRING, &bthci_cmd_input_data_format_vals_ext, 0x00c0,
4880 NULL, HFILL }
4882 { &hf_bthci_evt_input_sample_size,
4883 { "Input Sample Size", "bthci_evt.voice.input_sample_size",
4884 FT_UINT16, BASE_DEC | BASE_EXT_STRING, &bthci_cmd_input_sample_size_vals_ext, 0x0020,
4885 NULL, HFILL }
4887 { &hf_bthci_evt_linear_pcm_bit_pos,
4888 { "Linear PCM Bit Position", "bthci_evt.voice.linear_pcm_bit_pos",
4889 FT_UINT16, BASE_DEC, NULL, 0x001c,
4890 "# bit pos. that MSB of sample is away from starting at MSB", HFILL }
4892 { &hf_bthci_evt_air_coding_format,
4893 { "Air Coding Format", "bthci_evt.voice.air_coding_format",
4894 FT_UINT16, BASE_DEC | BASE_EXT_STRING, &bthci_cmd_air_coding_format_vals_ext, 0x0003,
4895 NULL, HFILL }
4897 { &hf_bthci_evt_num_broadcast_retransm,
4898 { "Num Broadcast Retran", "bthci_evt.num_broad_retran",
4899 FT_UINT8, BASE_DEC, NULL, 0x0,
4900 "Number of Broadcast Retransmissions", HFILL }
4902 { &hf_bthci_evt_hold_mode_act_page,
4903 { "Suspend Page Scan", "bthci_evt.hold_mode_page",
4904 FT_BOOLEAN, 8, NULL, 0x1,
4905 "Device can enter low power state", HFILL }
4907 { &hf_bthci_evt_hold_mode_act_inquiry,
4908 { "Suspend Inquiry Scan", "bthci_evt.hold_mode_inquiry",
4909 FT_BOOLEAN, 8, NULL, 0x2,
4910 "Device can enter low power state", HFILL }
4912 { &hf_bthci_evt_hold_mode_act_periodic,
4913 { "Suspend Periodic Inquiries", "bthci_evt.hold_mode_periodic",
4914 FT_BOOLEAN, 8, NULL, 0x4,
4915 "Device can enter low power state", HFILL }
4917 { &hf_bthci_evt_transmit_power_level,
4918 { "Transmit Power Level (dBm)", "bthci_evt.transmit_power_level",
4919 FT_INT8, BASE_DEC, NULL, 0x0,
4920 NULL, HFILL }
4922 { &hf_bthci_evt_num_supp_iac,
4923 {"Num Support IAC", "bthci_evt.num_supp_iac",
4924 FT_UINT8, BASE_DEC, NULL, 0x0,
4925 "Num of supported IAC the device can simultaneously listen", HFILL }
4927 { &hf_bthci_evt_num_curr_iac,
4928 {"Num Current IAC", "bthci_evt.num_curr_iac",
4929 FT_UINT8, BASE_DEC, NULL, 0x0,
4930 "Num of IACs currently in use to simultaneously listen", HFILL }
4932 { &hf_bthci_evt_iac_lap,
4933 { "IAC LAP", "bthci_evt.num_curr_iac",
4934 FT_UINT24, BASE_HEX, NULL, 0x0,
4935 "LAP(s)used to create IAC", HFILL }
4937 { &hf_bthci_evt_loopback_mode,
4938 {"Loopback Mode", "bthci_evt.loopback_mode",
4939 FT_UINT8, BASE_HEX, VALS(evt_loopback_modes), 0x0,
4940 NULL, HFILL }
4942 { &hf_bthci_evt_country_code,
4943 {"Country Code", "bthci_evt.country_code",
4944 FT_UINT8, BASE_HEX, VALS(evt_country_code_values), 0x0,
4945 NULL, HFILL }
4947 { &hf_bthci_evt_failed_contact_counter,
4948 {"Failed Contact Counter", "bthci_evt.failed_contact_counter",
4949 FT_UINT16, BASE_DEC, NULL, 0x0,
4950 NULL, HFILL }
4952 { &hf_bthci_evt_link_quality,
4953 {"Link Quality", "bthci_evt.link_quality",
4954 FT_UINT8, BASE_DEC, NULL, 0x0,
4955 "Link Quality (0x00 - 0xFF Higher Value = Better Link)", HFILL }
4957 { &hf_bthci_evt_rssi,
4958 { "RSSI (dB)", "bthci_evt.rssi",
4959 FT_INT8, BASE_DEC, NULL, 0x0,
4960 NULL, HFILL }
4962 { &hf_bthci_evt_host_data_packet_length_acl,
4963 {"Host ACL Data Packet Length (bytes)", "bthci_evt.max_data_length_acl",
4964 FT_UINT16, BASE_DEC, NULL, 0x0,
4965 "Max Host ACL Data Packet length of data portion host is able to accept", HFILL }
4967 { &hf_bthci_evt_host_data_packet_length_sco,
4968 {"Host SCO Data Packet Length (bytes)", "bthci_evt.max_data_length_sco",
4969 FT_UINT8, BASE_DEC, NULL, 0x0,
4970 "Max Host SCO Data Packet length of data portion host is able to accept", HFILL }
4972 { &hf_bthci_evt_host_total_num_acl_data_packets,
4973 {"Host Total Num ACL Data Packets", "bthci_evt.max_data_num_acl",
4974 FT_UINT16, BASE_DEC, NULL, 0x0,
4975 "Total Number of HCI ACL Data Packets that can be stored in the data buffers of the Host", HFILL }
4977 { &hf_bthci_evt_host_total_num_sco_data_packets,
4978 {"Host Total Num SCO Data Packets", "bthci_evt.max_data_num_sco",
4979 FT_UINT16, BASE_DEC, NULL, 0x0,
4980 "Total Number of HCI SCO Data Packets that can be stored in the data buffers of the Host", HFILL }
4982 { &hf_bthci_evt_page_number,
4983 {"Page Number", "bthci_evt.page_number",
4984 FT_UINT8, BASE_DEC, NULL, 0x0,
4985 NULL, HFILL}
4987 { &hf_bthci_evt_max_page_number,
4988 {"Max. Page Number", "bthci_evt.max_page_number",
4989 FT_UINT8, BASE_DEC, NULL, 0x0,
4990 NULL, HFILL}
4992 { &hf_bthci_evt_local_supported_cmds,
4993 { "Local Supported Commands", "bthci_evt.local_supported_cmds",
4994 FT_BYTES, BASE_NONE, NULL, 0x0,
4995 NULL, HFILL }
4997 { &hf_bthci_evt_fec_required,
4998 {"FEC Required", "bthci_evt.fec_required",
4999 FT_BOOLEAN, 8, NULL, 0x0,
5000 NULL, HFILL}
5002 { &hf_bthci_evt_err_data_reporting,
5003 {"Erroneous Data Reporting", "bthci_evt.err_data_reporting",
5004 FT_UINT8, BASE_DEC, VALS(evt_enable_values), 0x0,
5005 NULL, HFILL}
5007 { &hf_bthci_evt_scan_type,
5008 {"Scan Type", "bthci_evt.inq_scan_type",
5009 FT_UINT8, BASE_DEC, VALS(evt_scan_types), 0x0,
5010 NULL, HFILL}
5012 { &hf_bthci_evt_inq_mode,
5013 {"Inquiry Mode", "bthci_evt.inq_scan_type",
5014 FT_UINT8, BASE_DEC, VALS(evt_inq_modes), 0x0,
5015 NULL, HFILL}
5017 { &hf_bthci_evt_power_level_type,
5018 {"Type", "bthci_evt.power_level_type",
5019 FT_UINT8, BASE_HEX, VALS(evt_power_level_types), 0x0,
5020 NULL, HFILL}
5022 { &hf_bthci_evt_sync_link_type,
5023 {"Link Type", "bthci_evt.sync_link_type",
5024 FT_UINT8, BASE_HEX, VALS(evt_sync_link_types), 0x0,
5025 NULL, HFILL}
5027 { &hf_bthci_evt_sync_tx_interval,
5028 {"Transmit Interval", "bthci_evt.sync_tx_interval",
5029 FT_UINT8, BASE_DEC, NULL, 0x0,
5030 NULL, HFILL}
5032 { &hf_bthci_evt_sync_rtx_window,
5033 {"Retransmit Window", "bthci_evt.sync_rtx_window",
5034 FT_UINT8, BASE_DEC, NULL, 0x0,
5035 NULL, HFILL}
5037 { &hf_bthci_evt_sync_rx_packet_length,
5038 {"Rx Packet Length", "bthci_evt.sync_rx_pkt_len",
5039 FT_UINT16, BASE_DEC, NULL, 0x0,
5040 NULL, HFILL}
5042 { &hf_bthci_evt_sync_tx_packet_length,
5043 {"Tx Packet Length", "bthci_evt.sync_tx_pkt_len",
5044 FT_UINT16, BASE_DEC, NULL, 0x0,
5045 NULL, HFILL}
5047 { &hf_bthci_evt_air_mode,
5048 {"Air Mode", "bthci_evt.air_mode",
5049 FT_UINT8, BASE_DEC, VALS(evt_air_mode_vals), 0x0,
5050 NULL, HFILL}
5052 { &hf_bthci_evt_max_tx_latency,
5053 {"Max. Tx Latency", "bthci_evt.max_tx_latency",
5054 FT_UINT16, BASE_DEC, NULL, 0x0,
5055 NULL, HFILL}
5057 { &hf_bthci_evt_max_rx_latency,
5058 {"Max. Rx Latency", "bthci_evt.max_rx_latency",
5059 FT_UINT16, BASE_DEC, NULL, 0x0,
5060 NULL, HFILL}
5062 { &hf_bthci_evt_min_remote_timeout,
5063 {"Min. Remote Timeout", "bthci_evt.min_remote_timeout",
5064 FT_UINT16, BASE_DEC, NULL, 0x0,
5065 NULL, HFILL}
5067 { &hf_bthci_evt_min_local_timeout,
5068 {"Min. Local Timeout", "bthci_evt.min_local_timeout",
5069 FT_UINT16, BASE_DEC, NULL, 0x0,
5070 NULL, HFILL}
5072 { &hf_bthci_evt_link_supervision_timeout,
5073 {"Link Supervision Timeout", "bthci_evt.link_supervision_timeout",
5074 FT_UINT16, BASE_DEC, NULL, 0x0,
5075 NULL, HFILL}
5077 { &hf_bthci_evt_token_bucket_size,
5078 { "Token Bucket Size", "bthci_evt.token_bucket_size",
5079 FT_UINT32, BASE_DEC, NULL, 0x0,
5080 "Token Bucket Size (bytes)", HFILL }
5082 { &hf_bthci_evt_flow_direction,
5083 {"Flow Direction", "bthci_evt.flow_direction",
5084 FT_UINT8, BASE_DEC, VALS(evt_flow_direction_values), 0x0,
5085 NULL, HFILL}
5087 { &hf_bthci_evt_afh_ch_assessment_mode,
5088 {"AFH Channel Assessment Mode", "bthci_evt.afh_ch_assessment_mode",
5089 FT_UINT8, BASE_DEC, VALS(evt_enable_values), 0x0,
5090 NULL, HFILL}
5092 { &hf_bthci_evt_lmp_handle,
5093 { "LMP Handle", "bthci_evt.lmp_handle",
5094 FT_UINT16, BASE_HEX, NULL, 0x0,
5095 NULL, HFILL }
5097 { &hf_bthci_evt_clock,
5098 { "Clock", "bthci_evt.clock",
5099 FT_UINT32, BASE_HEX, NULL, 0x0,
5100 NULL, HFILL }
5102 { &hf_bthci_evt_clock_accuracy,
5103 { "Clock", "bthci_evt.clock_accuracy",
5104 FT_UINT16, BASE_HEX, NULL, 0x0,
5105 NULL, HFILL }
5107 { &hf_bthci_evt_afh_mode,
5108 {"AFH Mode", "bthci_evt.afh_mode",
5109 FT_UINT8, BASE_DEC, VALS(evt_enable_values), 0x0,
5110 NULL, HFILL}
5112 { &hf_bthci_evt_afh_channel_map,
5113 {"AFH Channel Map", "bthci_evt.afh_channel_map",
5114 FT_BYTES, BASE_NONE, NULL, 0x0,
5115 NULL, HFILL}
5117 { &hf_bthci_evt_simple_pairing_mode,
5118 {"Simple Pairing Mode", "bthci_evt.simple_pairing_mode",
5119 FT_UINT8, BASE_DEC, VALS(evt_enable_values), 0x0,
5120 NULL, HFILL}
5122 { &hf_bthci_evt_hash_c,
5123 {"Hash C", "bthci_evt.hash_c",
5124 FT_BYTES, BASE_NONE, NULL, 0x0,
5125 NULL, HFILL}
5127 { &hf_bthci_evt_randomizer_r,
5128 {"Randomizer R", "bthci_evt.randomizer_r",
5129 FT_BYTES, BASE_NONE, NULL, 0x0,
5130 NULL, HFILL}
5132 { &hf_bthci_evt_io_capability,
5133 {"IO Capability", "bthci_evt.io_capability",
5134 FT_UINT8, BASE_HEX, VALS(bthci_cmd_io_capability_vals), 0x0,
5135 NULL, HFILL}
5137 { &hf_bthci_evt_oob_data_present,
5138 {"OOB Data Present", "bthci_evt.oob_data_present",
5139 FT_UINT8, BASE_DEC, VALS(bthci_cmd_oob_data_present_vals), 0x0,
5140 NULL, HFILL}
5142 { &hf_bthci_evt_auth_requirements,
5143 {"Authentication Requirements", "bthci_evt.auth_requirements",
5144 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &bthci_cmd_auth_req_vals_ext, 0x0,
5145 NULL, HFILL}
5147 { &hf_bthci_evt_numeric_value,
5148 {"Numeric Value", "bthci_evt.numeric_value",
5149 FT_UINT32, BASE_DEC, NULL, 0x0,
5150 NULL, HFILL}
5152 { &hf_bthci_evt_passkey,
5153 {"Passkey", "bthci_evt.passkey",
5154 FT_UINT32, BASE_DEC, NULL, 0x0,
5155 NULL, HFILL}
5157 { &hf_bthci_evt_notification_type,
5158 {"Notification Type", "bthci_evt.notification_type",
5159 FT_UINT8, BASE_DEC, VALS(bthci_cmd_notification_types), 0x0,
5160 NULL, HFILL}
5162 { &hf_bthci_evt_data,
5163 {"Data", "bthci_evt.data",
5164 FT_BYTES, BASE_NONE, NULL, 0x0,
5165 NULL, HFILL}
5167 { &hf_bthci_evt_eir_struct_length,
5168 { "Length", "bthci_evt.eir_struct_length",
5169 FT_UINT8, BASE_DEC, NULL, 0x0,
5170 "Structure Length", HFILL }
5172 { &hf_bthci_evt_eir_struct_type,
5173 { "Type", "bthci_evt.eir_data_type",
5174 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_eir_data_type_vals_ext, 0x0,
5175 "Data Type", HFILL }
5177 { &hf_bthci_evt_sc_uuid16,
5178 { "UUID", "bthci_evt.service_class_uuid16",
5179 FT_UINT16, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_service_class_type_vals_ext, 0x0,
5180 "16-bit Service Class UUID", HFILL }
5182 { &hf_bthci_evt_sc_uuid32,
5183 { "UUID", "bthci_evt.service_class_uuid32",
5184 FT_UINT32, BASE_HEX, NULL, 0x0,
5185 "32-bit Service Class UUID", HFILL }
5187 { &hf_bthci_evt_sc_uuid128,
5188 { "UUID", "bthci_evt.service_class_uuid128",
5189 FT_BYTES, BASE_NONE, NULL, 0x0,
5190 "128-bit Service Class UUID", HFILL }
5192 { &hf_bthci_evt_data_length,
5193 { "Data Length", "bthci_evt.data_length",
5194 FT_UINT8, BASE_DEC, NULL, 0x0,
5195 NULL, HFILL }
5197 { &hf_bthci_evt_location_domain_aware,
5198 { "Location Domain Aware", "bthci_evt.location_domain_aware",
5199 FT_BOOLEAN, 8, NULL, 0x0,
5200 NULL, HFILL }
5202 { &hf_bthci_evt_location_domain,
5203 { "Location Domain", "bthci_evt.location_domain",
5204 FT_STRING, BASE_NONE, NULL, 0x0,
5205 "ISO 3166-1 Country Code", HFILL }
5207 { &hf_bthci_evt_location_domain_options,
5208 { "Location Domain Options", "bthci_evt.location_domain_options",
5209 FT_STRING, BASE_NONE, NULL, 0x0,
5210 NULL, HFILL }
5212 { &hf_bthci_evt_location_options,
5213 { "Location Options", "bthci_evt.location_options",
5214 FT_UINT8, BASE_HEX, NULL, 0x0,
5215 NULL, HFILL }
5217 { &hf_bthci_evt_flow_control_mode,
5218 { "Flow Control Mode", "bthci_evt.flow_control_mode",
5219 FT_UINT8, BASE_HEX, VALS(evt_flow_ctrl_mode), 0x0,
5220 NULL, HFILL }
5222 { &hf_bthci_evt_physical_link_handle,
5223 { "Physical Link Handle", "bthci_evt.physical_link_handle",
5224 FT_UINT8, BASE_HEX, NULL, 0x0,
5225 NULL, HFILL }
5227 { &hf_bthci_evt_flow_spec_identifier,
5228 { "Flow Spec Identifier", "bthci_evt.flow_spec_id",
5229 FT_UINT8, BASE_HEX, NULL, 0x0,
5230 NULL, HFILL }
5232 { &hf_bthci_evt_logical_link_handle,
5233 { "Logical Link Handle", "bthci_evt.logical_link_handle",
5234 FT_UINT16, BASE_HEX, NULL, 0x0,
5235 NULL, HFILL}
5237 { &hf_bthci_evt_max_acl_data_packet_length,
5238 { "Max. ACL Data Packet Length", "bthci_evt.max_acl_data_packet_length",
5239 FT_UINT16, BASE_HEX, NULL, 0x0,
5240 NULL, HFILL}
5242 { &hf_bthci_evt_data_block_length,
5243 { "Max. Data Block Length", "bthci_evt.data_block_length",
5244 FT_UINT16, BASE_HEX, NULL, 0x0,
5245 NULL, HFILL}
5247 { &hf_bthci_evt_total_num_data_blocks,
5248 { "Total Number of Data Blocks", "bthci_evt.total_num_data_blocks",
5249 FT_UINT16, BASE_HEX, NULL, 0x0,
5250 NULL, HFILL}
5252 { &hf_bthci_evt_enc_key_size,
5253 { "Encryption Key Size", "bthci_evt.enc_key_size",
5254 FT_INT8, BASE_DEC, NULL, 0x0,
5255 NULL, HFILL }
5257 { &hf_bthci_evt_amp_remaining_assoc_length,
5258 { "AMP Remaining Assoc Length", "bthci_evt.amp_remaining_assoc_length",
5259 FT_UINT16, BASE_DEC, 0x0, 0x0,
5260 NULL, HFILL }
5262 { &hf_bthci_evt_amp_assoc_fragment,
5263 { "AMP Assoc Fragment", "bthci_evt.amp_assoc_fragment",
5264 FT_BYTES, BASE_NONE, 0x0, 0x0,
5265 NULL, HFILL }
5267 { &hf_bthci_evt_amp_status,
5268 { "AMP Status", "bthci_evt.amp_status",
5269 FT_UINT8, BASE_HEX, VALS(evt_amp_status), 0x0,
5270 NULL, HFILL }
5272 { &hf_bthci_evt_total_bandwidth,
5273 { "Total Bandwidth (kbps)", "bthci_evt.total_bandwidth",
5274 FT_UINT32, BASE_DEC, 0x0, 0x0,
5275 NULL, HFILL }
5277 { &hf_bthci_evt_max_guaranteed_bandwidth,
5278 { "Max Guaranteed Bandwidth (kbps)", "bthci_evt.max_guaranteed_bandwidth",
5279 FT_UINT32, BASE_DEC, 0x0, 0x0,
5280 NULL, HFILL }
5282 { &hf_bthci_evt_min_latency,
5283 { "Min Latency (us)", "bthci_evt.min_latency",
5284 FT_UINT32, BASE_DEC, 0x0, 0x0,
5285 NULL, HFILL }
5287 { &hf_bthci_evt_max_pdu_size,
5288 { "Max PDU Size", "bthci_evt.max_pdu_size",
5289 FT_UINT32, BASE_DEC, 0x0, 0x0,
5290 NULL, HFILL }
5292 { &hf_bthci_evt_amp_controller_type,
5293 { "Controller Type", "bthci_evt.controller_type",
5294 FT_UINT8, BASE_HEX, VALS(evt_controller_types), 0x0,
5295 NULL, HFILL }
5297 { &hf_bthci_evt_pal_capabilities_00,
5298 { "Guaranteed Service", "bthci_evt.pal_capabilities",
5299 FT_BOOLEAN, 16, NULL, 0x0001,
5300 NULL, HFILL }
5302 { &hf_bthci_evt_max_amp_assoc_length,
5303 { "Max AMP Assoc Length", "bthci_evt.max_amp_assoc_length",
5304 FT_UINT32, BASE_DEC, 0x0, 0x0,
5305 NULL, HFILL }
5307 { &hf_bthci_evt_max_flush_to_us,
5308 { "Max Flush Timeout (us)", "bthci_evt.max_flush_to",
5309 FT_UINT32, BASE_DEC, 0x0, 0x0,
5310 NULL, HFILL }
5312 { &hf_bthci_evt_best_effort_flush_to_us,
5313 { "Best Effort Flush Timeout (us)", "bthci_evt.best_effort_flush_to",
5314 FT_UINT32, BASE_DEC, 0x0, 0x0,
5315 NULL, HFILL }
5317 { &hf_bthci_evt_link_loss_reason,
5318 { "Reason", "bthci_evt.link_loss_reason",
5319 FT_UINT8, BASE_HEX, VALS(evt_link_loss_reasons), 0x0,
5320 NULL, HFILL }
5322 { &hf_bthci_evt_num_compl_blocks,
5323 { "Number Of Completed Blocks", "bthci_evt.num_compl_blocks",
5324 FT_UINT16, BASE_DEC, NULL, 0x0,
5325 NULL, HFILL }
5327 { &hf_bthci_evt_test_scenario,
5328 { "Test Scenario", "bthci_evt.test_scenario",
5329 FT_UINT8, BASE_HEX, NULL, 0x0,
5330 NULL, HFILL }
5332 { &hf_bthci_evt_report_reason,
5333 { "Reason", "bthci_evt.report_reason",
5334 FT_UINT8, BASE_HEX, VALS(evt_report_reasons), 0x0,
5335 NULL, HFILL }
5337 { &hf_bthci_evt_report_event_type,
5338 { "Report Event Type", "bthci_evt.report_event_type",
5339 FT_UINT8, BASE_HEX, VALS(evt_report_event_types), 0x0,
5340 NULL, HFILL }
5342 { &hf_bthci_evt_num_frames,
5343 { "Number Of Frames", "bthci_evt.num_frames",
5344 FT_UINT16, BASE_DEC, NULL, 0x0,
5345 NULL, HFILL }
5347 { &hf_bthci_evt_num_error_frames,
5348 { "Number Of Error Frames", "bthci_evt.num_error_frames",
5349 FT_UINT16, BASE_DEC, NULL, 0x0,
5350 NULL, HFILL }
5352 { &hf_bthci_evt_num_bits,
5353 { "Number Of Bits", "bthci_evt.num_bits",
5354 FT_UINT32, BASE_DEC, NULL, 0x0,
5355 NULL, HFILL }
5357 { &hf_bthci_evt_num_error_bits,
5358 { "Number Of Error Bits", "bthci_evt.num_error_bits",
5359 FT_UINT32, BASE_DEC, NULL, 0x0,
5360 NULL, HFILL }
5362 { &hf_bthci_evt_short_range_mode_state,
5363 { "Short Range Mode State", "bthci_evt.short_range_mode_state",
5364 FT_BOOLEAN, 8, NULL, 0x0,
5365 NULL, HFILL }
5367 { &hf_bthci_evt_transmit_power_level_gfsk,
5368 { "Transmit Power Level GFSK (dBm)", "bthci_evt.transmit_power_level_gfsk",
5369 FT_INT8, BASE_DEC, NULL, 0x0,
5370 NULL, HFILL }
5372 { &hf_bthci_evt_transmit_power_level_dqpsk,
5373 { "Transmit Power Level DQPSK (dBm)", "bthci_evt.transmit_power_level_dqpsk",
5374 FT_INT8, BASE_DEC, NULL, 0x0,
5375 NULL, HFILL }
5377 { &hf_bthci_evt_transmit_power_level_8dpsk,
5378 { "Transmit Power Level 8DPSK (dBm)", "bthci_evt.transmit_power_level_8dpsk",
5379 FT_INT8, BASE_DEC, NULL, 0x0,
5380 NULL, HFILL }
5382 { &hf_bthci_evt_flush_to_us,
5383 { "Flush Timeout (us)", "bthci_evt.flushto",
5384 FT_UINT32, BASE_DEC, NULL, 0x0,
5385 NULL, HFILL }
5387 { &hf_bthci_evt_le_supported_host,
5388 { "LE Supported Host", "bthci_evt.le_supported_host",
5389 FT_BOOLEAN, 8, NULL, 0x0,
5390 NULL, HFILL }
5392 { &hf_bthci_evt_le_simultaneous_host,
5393 { "Simultaneous LE Host", "bthci_evt.le_simlutaneous_host",
5394 FT_BOOLEAN, 8, NULL, 0x0,
5395 "Support for both LE and BR/EDR to same device", HFILL }
5397 { &hf_bthci_evt_le_acl_data_pkt_len,
5398 { "LE ACL Data Packet Length", "bthci_evt.le_acl_data_pkt_len",
5399 FT_UINT16, BASE_DEC, NULL, 0x0,
5400 NULL, HFILL }
5402 { &hf_bthci_evt_total_num_le_acl_data_pkts,
5403 { "Total Number LE ACL Data Packets", "bthci_evt.le_total_num_acl_data_pkts",
5404 FT_UINT8, BASE_DEC, NULL, 0x0,
5405 NULL, HFILL }
5407 { &hf_bthci_evt_le_features,
5408 { "Supported LE Features", "bthci_evt.le_features",
5409 FT_NONE, BASE_NONE, NULL, 0x00,
5410 NULL, HFILL }
5412 { &hf_bthci_evt_le_feature_00,
5413 { "LE Encryption", "bthci_evt.le_features.encryption",
5414 FT_BOOLEAN, 8, NULL, 0x01,
5415 NULL, HFILL }
5417 { &hf_bthci_evt_white_list_size,
5418 { "White List Size", "bthci_evt.le_white_list_size",
5419 FT_UINT8, BASE_DEC, NULL, 0x0,
5420 "Max. total whitelist entries storable in controller", HFILL }
5422 { &hf_bthci_evt_le_channel_map,
5423 { "Channel Map", "bthci_evt.le_channel_map",
5424 FT_BYTES, BASE_NONE, NULL, 0x0,
5425 NULL, HFILL }
5427 { &hf_bthci_evt_encrypted_data,
5428 { "Plaintext", "bthci_evt.le_encrypted_data",
5429 FT_BYTES, BASE_NONE, NULL, 0x0,
5430 NULL, HFILL }
5432 { &hf_bthci_evt_random_number,
5433 { "Random Number", "bthci_evt.le_random_number",
5434 FT_BYTES, BASE_NONE, NULL, 0x0,
5435 NULL, HFILL }
5437 { &hf_bthci_evt_le_num_packets,
5438 { "Number of Packets", "bthci_evt.le_num_packets",
5439 FT_UINT16, BASE_DEC, NULL, 0x0,
5440 NULL, HFILL }
5442 { &hf_bthci_evt_le_meta_subevent,
5443 { "Sub Event", "bthci_evt.le_meta_subevent",
5444 FT_UINT8, BASE_HEX, VALS(evt_le_meta_subevent), 0x00,
5445 NULL, HFILL }
5447 { &hf_bthci_evt_le_peer_address_type,
5448 { "Peer Address Type", "bthci_evt.le_peer_address_type",
5449 FT_UINT8, BASE_HEX, VALS(bthci_cmd_address_types_vals), 0x0,
5450 NULL, HFILL }
5452 { &hf_bthci_evt_le_con_interval,
5453 { "Connection Interval", "bthci_evt.le_con_interval",
5454 FT_UINT16, BASE_DEC, NULL, 0x0,
5455 NULL, HFILL }
5457 { &hf_bthci_evt_le_con_latency,
5458 { "Connection Latency", "bthci_evt.le_con_latency",
5459 FT_UINT16, BASE_DEC, NULL, 0x0,
5460 NULL, HFILL }
5462 { &hf_bthci_evt_le_supervision_timeout,
5463 { "Supervision Timeout", "bthci_evt.le_supv_timeout",
5464 FT_UINT16, BASE_DEC, NULL, 0x0,
5465 NULL, HFILL }
5467 { &hf_bthci_evt_encrypted_diversifier,
5468 { "Encrypted Diversifier", "bthci_evt.le_encrypted_diversifier",
5469 FT_UINT16, BASE_HEX, NULL, 0x0,
5470 NULL, HFILL }
5472 { &hf_bthci_evt_le_master_clock_accuracy,
5473 { "Master Clock Accuracy", "bthci_evt.le_master_clock_accuracy",
5474 FT_UINT8, BASE_HEX, VALS(evt_master_clock_accuray), 0x0,
5475 NULL, HFILL }
5477 { &hf_bthci_evt_num_reports,
5478 { "Num Reports", "bthci_evt.le_num_reports",
5479 FT_UINT8, BASE_DEC, NULL, 0x0,
5480 NULL, HFILL }
5482 { &hf_bthci_evt_advts_event_type,
5483 { "Event Type", "bthci_evt.le_advts_event_type",
5484 FT_UINT8, BASE_HEX, VALS(evt_le_advertising_evt_types), 0x0,
5485 NULL, HFILL }
5487 { &hf_bthci_evt_appearance,
5488 { "Appearance", "bthci_evt.le_appearance",
5489 FT_UINT16, BASE_HEX |BASE_EXT_STRING, &bthci_cmd_appearance_vals_ext, 0x0,
5490 NULL, HFILL }
5492 { &hf_bthci_evt_flags_limited_disc_mode,
5493 { "LE Limited Discoverable Mode", "bthci_evt.le_flags.limit_disc_mode",
5494 FT_BOOLEAN, 8, NULL, 0x01,
5495 NULL, HFILL }
5497 { &hf_bthci_evt_flags_general_disc_mode,
5498 { "LE General Discoverable Mode", "bthci_evt.le_flags.general_disc_mode",
5499 FT_BOOLEAN, 8, NULL, 0x02,
5500 NULL, HFILL }
5502 { &hf_bthci_evt_flags_bredr_not_support,
5503 { "BR/EDR Not Supported", "bthci_evt.le_flags.bredr_not_supported",
5504 FT_BOOLEAN, 8, NULL, 0x04,
5505 NULL, HFILL }
5507 { &hf_bthci_evt_flags_le_bredr_support_ctrl,
5508 { "Simultaneous LE and BR/EDR to Same Device Capable (Controller)", "bthci_evt.le_flags.bredr_support_ctrl",
5509 FT_BOOLEAN, 8, NULL, 0x08,
5510 NULL, HFILL }
5512 { &hf_bthci_evt_flags_le_bredr_support_host,
5513 { "Simultaneous LE and BR/EDR to Same Device Capable (Host)", "bthci_evt.le_flags.bredr_support_host",
5514 FT_BOOLEAN, 8, NULL, 0x10,
5515 NULL, HFILL }
5517 { &hf_bthci_evt_flags_reserved,
5518 { "Reserved", "bthci_evt.le_flags.reserved",
5519 FT_BOOLEAN, 8, NULL, 0xE0,
5520 NULL, HFILL }
5522 { &hf_bthci_evt_oob_flags_oob_data_present,
5523 { "OOB Data Present", "bthci_evt.oob_flags.oob_data_present",
5524 FT_BOOLEAN, 8, NULL, 0x01,
5525 NULL, HFILL }
5527 { &hf_bthci_evt_oob_flags_le_supported_host,
5528 { "LE Supported By Host", "bthci_evt.oob_flags.le_supported_host",
5529 FT_BOOLEAN, 8, NULL, 0x02,
5530 NULL, HFILL }
5532 { &hf_bthci_evt_oob_flags_simultaneous_le_and_br_edr_host,
5533 { "Simultaneous LE and BR/EDR to Same Device Capable (Host)", "bthci_evt.oob_flags.simultaneous_le_and_br_edr_host",
5534 FT_BOOLEAN, 8, NULL, 0x04,
5535 NULL, HFILL }
5537 { &hf_bthci_evt_oob_flags_address_type,
5538 { "Address Type", "bthci_evt.oob_flags.address_type",
5539 FT_UINT8, BASE_HEX, VALS(bthci_cmd_address_types_vals), 0x08,
5540 NULL, HFILL }
5542 { &hf_bthci_evt_le_states,
5543 { "Supported LE States", "bthci_evt.le_states",
5544 FT_NONE, BASE_NONE, NULL, 0x00,
5545 NULL, HFILL }
5547 { &hf_bthci_evt_le_states_00,
5548 { "Non-connectable Advertising State", "bthci_evt.le_states_00",
5549 FT_BOOLEAN, 8, NULL, 0x01,
5550 NULL, HFILL }
5552 { &hf_bthci_evt_le_states_01,
5553 { "Scannable Advertising State", "bthci_evt.le_states_01",
5554 FT_BOOLEAN, 8, NULL, 0x02,
5555 NULL, HFILL }
5557 { &hf_bthci_evt_le_states_02,
5558 { "Connectable Advertising State", "bthci_evt.le_states_02",
5559 FT_BOOLEAN, 8, NULL, 0x04,
5560 NULL, HFILL }
5562 { &hf_bthci_evt_le_states_03,
5563 { "Directed Advertising State", "bthci_evt.le_states_03",
5564 FT_BOOLEAN, 8, NULL, 0x08,
5565 NULL, HFILL }
5567 { &hf_bthci_evt_le_states_04,
5568 { "Passive Scanning State", "bthci_evt.le_states_04",
5569 FT_BOOLEAN, 8, NULL, 0x10,
5570 NULL, HFILL }
5572 { &hf_bthci_evt_le_states_05,
5573 { "Active Scanning State", "bthci_evt.le_states_05",
5574 FT_BOOLEAN, 8, NULL, 0x20,
5575 NULL, HFILL }
5577 { &hf_bthci_evt_le_states_06,
5578 { "Initiating State. Connection State in Master Role", "bthci_evt.le_states_06",
5579 FT_BOOLEAN, 8, NULL, 0x40,
5580 NULL, HFILL }
5582 { &hf_bthci_evt_le_states_07,
5583 { "Connection State in Slave Role", "bthci_evt.le_states_07",
5584 FT_BOOLEAN, 8, NULL, 0x80,
5585 NULL, HFILL }
5587 { &hf_bthci_evt_le_states_10,
5588 { "Non-connectable Advertising State and Passive Scanning State combination", "bthci_evt.le_states_10",
5589 FT_BOOLEAN, 8, NULL, 0x01,
5590 NULL, HFILL }
5592 { &hf_bthci_evt_le_states_11,
5593 { "Scannable Advertising State and Passive Scanning State combination", "bthci_evt.le_states_11",
5594 FT_BOOLEAN, 8, NULL, 0x02,
5595 NULL, HFILL }
5597 { &hf_bthci_evt_le_states_12,
5598 { "Connectable Advertising State and Passive Scanning State combination", "bthci_evt.le_states_12",
5599 FT_BOOLEAN, 8, NULL, 0x04,
5600 NULL, HFILL }
5602 { &hf_bthci_evt_le_states_13,
5603 { "Directed Advertising State and Passive Scanning State combination", "bthci_evt.le_states_13",
5604 FT_BOOLEAN, 8, NULL, 0x08,
5605 NULL, HFILL }
5607 { &hf_bthci_evt_le_states_14,
5608 { "Non-connectable Advertising State and Active Scanning State combination", "bthci_evt.le_states_14",
5609 FT_BOOLEAN, 8, NULL, 0x10,
5610 NULL, HFILL }
5612 { &hf_bthci_evt_le_states_15,
5613 { "Scannable Advertising State and Active Scanning State combination", "bthci_evt.le_states_15",
5614 FT_BOOLEAN, 8, NULL, 0x20,
5615 NULL, HFILL }
5617 { &hf_bthci_evt_le_states_16,
5618 { "Connectable Advertising State and Active Scanning State combination", "bthci_evt.le_states_16",
5619 FT_BOOLEAN, 8, NULL, 0x40,
5620 NULL, HFILL }
5622 { &hf_bthci_evt_le_states_17,
5623 { "Directed Advertising State and Active Scanning State combination", "bthci_evt.le_states_17",
5624 FT_BOOLEAN, 8, NULL, 0x80,
5625 NULL, HFILL }
5627 { &hf_bthci_evt_le_states_20,
5628 { "Non-connectable Advertising State and Initiating State combination", "bthci_evt.le_states_20",
5629 FT_BOOLEAN, 8, NULL, 0x01,
5630 NULL, HFILL }
5632 { &hf_bthci_evt_le_states_21,
5633 { "Scannable Advertising State and Initiating State combination", "bthci_evt.le_states_21",
5634 FT_BOOLEAN, 8, NULL, 0x02,
5635 NULL, HFILL }
5637 { &hf_bthci_evt_le_states_22,
5638 { "Non-connectable Advertising State and Master Role combination", "bthci_evt.le_states_22",
5639 FT_BOOLEAN, 8, NULL, 0x04,
5640 NULL, HFILL }
5642 { &hf_bthci_evt_le_states_23,
5643 { "Scannable Advertising State and Master Role combination", "bthci_evt.le_states_23",
5644 FT_BOOLEAN, 8, NULL, 0x08,
5645 NULL, HFILL }
5647 { &hf_bthci_evt_le_states_24,
5648 { "Non-connectable Advertising State and Slave Role combination", "bthci_evt.le_states_24",
5649 FT_BOOLEAN, 8, NULL, 0x10,
5650 NULL, HFILL }
5652 { &hf_bthci_evt_le_states_25,
5653 { "Scannable Advertising State and Slave Role combination", "bthci_evt.le_states_25",
5654 FT_BOOLEAN, 8, NULL, 0x20,
5655 NULL, HFILL }
5657 { &hf_bthci_evt_le_states_26,
5658 { "Passive Scanning State and Initiating State combination", "bthci_evt.le_states_26",
5659 FT_BOOLEAN, 8, NULL, 0x40,
5660 NULL, HFILL }
5662 { &hf_bthci_evt_le_states_27,
5663 { "Active Scanning State and Initiating State combination", "bthci_evt.le_states_27",
5664 FT_BOOLEAN, 8, NULL, 0x80,
5665 NULL, HFILL }
5667 { &hf_bthci_evt_le_states_30,
5668 { "Passive Scanning State and Master Role combination", "bthci_evt.le_states_30",
5669 FT_BOOLEAN, 8, NULL, 0x01,
5670 NULL, HFILL }
5672 { &hf_bthci_evt_le_states_31,
5673 { "Active Scanning State and Master Role combination", "bthci_evt.le_states_31",
5674 FT_BOOLEAN, 8, NULL, 0x02,
5675 NULL, HFILL }
5677 { &hf_bthci_evt_le_states_32,
5678 { "Passive Scanning state and Slave Role combination", "bthci_evt.le_states_32",
5679 FT_BOOLEAN, 8, NULL, 0x04,
5680 NULL, HFILL }
5682 { &hf_bthci_evt_le_states_33,
5683 { "Active Scanning state and Slave Role combination", "bthci_evt.le_states_33",
5684 FT_BOOLEAN, 8, NULL, 0x08,
5685 NULL, HFILL }
5687 { &hf_bthci_evt_le_states_34,
5688 { "Initiating State and Master Role combination. Master Role and Master Role combination", "bthci_evt.le_states_34",
5689 FT_BOOLEAN, 8, NULL, 0x10,
5690 NULL, HFILL }
5692 { &hf_bthci_evt_eir_ad_ssp_oob_length,
5693 { "SSP OOB Length", "bthci_evt.eir_ad.ssp_oob_length",
5694 FT_UINT16, BASE_DEC, NULL, 0x0,
5695 NULL, HFILL }
5697 { &hf_bthci_evt_eir_ad_advertising_interval,
5698 { "Advertising Interval", "bthci_evt.eir_ad.advertising_interval",
5699 FT_UINT16, BASE_DEC, NULL, 0x0,
5700 NULL, HFILL }
5702 { &hf_bthci_evt_eir_ad_company_id,
5703 { "Company ID", "bthci_evt.eir_ad.company_id",
5704 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_evt_comp_id_ext, 0x0,
5705 NULL, HFILL }
5707 { &hf_eir_ad_item,
5708 { "Item", "bthci_evt.eir_ad",
5709 FT_NONE, BASE_NONE, NULL, 0x0,
5710 NULL, HFILL }
5712 { &hf_extended_inquiry_response_data,
5713 { "Extended Inquiry Response Data", "bthci_evt.extended_inquiry_response_data",
5714 FT_NONE, BASE_NONE, NULL, 0x0,
5715 NULL, HFILL }
5717 { &hf_advertising_data,
5718 { "Advertising Data", "bthci_evt.advertising_data",
5719 FT_NONE, BASE_NONE, NULL, 0x0,
5720 NULL, HFILL }
5722 { &hf_usable_packet_types,
5723 { "Usable Packet Types", "bthci_evt.usable_packet_types",
5724 FT_NONE, BASE_NONE, NULL, 0x0,
5725 NULL, HFILL }
5727 { &hf_3ds_association_notification,
5728 { "3DS Association Notification", "bthci_evt.eir_ad.3ds.association_notification",
5729 FT_BOOLEAN, 8, NULL, 0x01,
5730 NULL, HFILL }
5732 { &hf_3ds_battery_level_reporting,
5733 { "3DS Battery Level Reporting", "bthci_evt.eir_ad.3ds.battery_level_reporting",
5734 FT_BOOLEAN, 8, NULL, 0x02,
5735 NULL, HFILL }
5737 { &hf_3ds_send_battery_level_report_on_startup,
5738 { "3DS Send Battery Level Report on Startup", "bthci_evt.eir_ad.3ds.send_battery_level_report_on_startup",
5739 FT_BOOLEAN, 8, NULL, 0x04,
5740 NULL, HFILL }
5742 { &hf_3ds_reserved,
5743 { "Reserved", "bthci_evt.eir_ad.3ds.reserved",
5744 FT_BOOLEAN, 8, NULL, 0x78,
5745 NULL, HFILL }
5747 { &hf_3ds_factory_test_mode,
5748 { "3DS Factory Test Mode", "bthci_evt.eir_ad.3ds.factory_test_mode",
5749 FT_BOOLEAN, 8, NULL, 0x80,
5750 NULL, HFILL }
5752 { &hf_3ds_path_loss_threshold,
5753 { "3DS Path Loss Threshold", "bthci_evt.eir_ad.3ds.path_loss_threshold",
5754 FT_UINT8, BASE_DEC, NULL, 0x00,
5755 NULL, HFILL }
5757 { &hf_3ds_legacy_fixed,
5758 { "3DS Legacy Fixed", "bthci_evt.eir_ad.3ds_legacy.fixed_byte",
5759 FT_UINT8, BASE_DEC, NULL, 0x00,
5760 NULL, HFILL }
5762 { &hf_3ds_legacy_3d_capable_tv,
5763 { "3DS Legacy Capable TV", "bthci_evt.eir_ad.3ds_legacy.capable_tv",
5764 FT_BOOLEAN, 8, NULL, 0x01,
5765 NULL, HFILL }
5767 { &hf_3ds_legacy_ignored_1_3,
5768 { "3DS Legacy Ignored", "bthci_evt.eir_ad.3ds_legacy.ignored.1_3",
5769 FT_BOOLEAN, 8, NULL, 0x0E,
5770 NULL, HFILL }
5772 { &hf_3ds_legacy_fixed_4,
5773 { "3DS Legacy Fixed", "bthci_evt.eir_ad.3ds_legacy.fixed.4",
5774 FT_BOOLEAN, 8, NULL, 0x10,
5775 NULL, HFILL }
5777 { &hf_3ds_legacy_ignored_5,
5778 { "3DS Legacy Ignored", "bthci_evt.eir_ad.3ds_legacy.ignored.5",
5779 FT_BOOLEAN, 8, NULL, 0x20,
5780 NULL, HFILL }
5782 { &hf_3ds_legacy_fixed_6,
5783 { "3DS Legacy Fixed", "bthci_evt.eir_ad.3ds_legacy.fixed.4",
5784 FT_BOOLEAN, 8, NULL, 0x40,
5785 NULL, HFILL }
5787 { &hf_3ds_legacy_test_mode,
5788 { "3DS Legacy Test Mode", "bthci_evt.eir_ad.3ds_legacy.test_mode",
5789 FT_BOOLEAN, 8, NULL, 0x80,
5790 NULL, HFILL }
5792 { &hf_3ds_legacy_path_loss_threshold,
5793 { "3DS Legacy Path Loss Threshold", "bthci_evt.eir_ad.3ds_legacy.path_loss_threshold",
5794 FT_UINT8, BASE_DEC, NULL, 0x00,
5795 NULL, HFILL }
5797 { &hf_did_vendor_id_source,
5798 { "Vendor ID Source", "bthci_evt.eir_ad.did.vendor_id_source",
5799 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &did_vendor_id_source_vals_ext, 0,
5800 NULL, HFILL }
5802 { &hf_did_vendor_id,
5803 { "Vendor ID", "bthci_evt.eir_ad.did.vendor_id",
5804 FT_UINT16, BASE_HEX, NULL, 0,
5805 NULL, HFILL }
5807 { &hf_did_vendor_id_bluetooth_sig,
5808 { "Vendor ID", "bthci_evt.eir_ad.did.vendor_id",
5809 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_evt_comp_id_ext, 0,
5810 NULL, HFILL }
5812 { &hf_did_vendor_id_usb_forum,
5813 { "Vendor ID", "bthci_evt.eir_ad.did.vendor_id",
5814 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &ext_usb_vendors_vals, 0,
5815 NULL, HFILL }
5817 { &hf_did_product_id,
5818 { "Product ID", "bthci_evt.eir_ad.did.product_id",
5819 FT_UINT16, BASE_HEX, NULL, 0,
5820 NULL, HFILL }
5822 { &hf_did_version,
5823 { "Version", "bthci_evt.eir_ad.did.version",
5824 FT_UINT16, BASE_HEX, NULL, 0,
5825 NULL, HFILL }
5829 static ei_register_info ei[] = {
5830 { &ei_eir_undecoded, { "bthci_evt.expert.eir.undecoded", PI_PROTOCOL, PI_UNDECODED, "Undecoded", EXPFILL }},
5831 { &ei_eir_unknown, { "bthci_evt.expert.eir.unknown", PI_PROTOCOL, PI_WARN, "Undown data", EXPFILL }},
5832 { &ei_event_undecoded, { "bthci_evt.expert.event.undecoded", PI_PROTOCOL, PI_UNDECODED, "Event undecoded", EXPFILL }},
5833 { &ei_event_unknown, { "bthci_evt.expert.event.unknown", PI_PROTOCOL, PI_WARN, "Unknown event", EXPFILL }}
5836 /* Setup protocol subtree array */
5837 static gint *ett[] = {
5838 &ett_bthci_evt,
5839 &ett_opcode,
5840 &ett_cod,
5841 &ett_lmp_subtree,
5842 &ett_ptype_subtree,
5843 &ett_eir_subtree,
5844 &ett_eir_struct_subtree,
5845 &ett_le_state_subtree
5848 /* Register the protocol name and description */
5849 proto_bthci_evt = proto_register_protocol("Bluetooth HCI Event",
5850 "HCI_EVT", "bthci_evt");
5851 new_register_dissector("bthci_evt", dissect_bthci_evt, proto_bthci_evt);
5853 /* Required function calls to register the header fields and subtrees used */
5854 proto_register_field_array(proto_bthci_evt, hf, array_length(hf));
5855 proto_register_subtree_array(ett, array_length(ett));
5857 expert_bthci_evt = expert_register_protocol(proto_bthci_evt);
5858 expert_register_field_array(expert_bthci_evt, ei, array_length(ei));
5860 module = prefs_register_protocol(proto_bthci_evt, NULL);
5861 prefs_register_static_text_preference(module, "hci_evt.version",
5862 "Bluetooth HCI version: 4.0 (Core)",
5863 "Version of protocol supported by this dissector.");
5867 /* If this dissector uses sub-dissector registration add a registration routine.
5868 This format is required because a script is used to find these routines and
5869 create the code that calls these routines.
5871 void
5872 proto_reg_handoff_bthci_evt(void)
5874 dissector_handle_t bthci_evt_handle;
5876 bthci_evt_handle = find_dissector("bthci_evt");
5877 dissector_add_uint("hci_h4.type", HCI_H4_TYPE_EVT, bthci_evt_handle);
5878 dissector_add_uint("hci_h1.type", BTHCI_CHANNEL_EVENT, bthci_evt_handle);
5880 bthci_cmd_handle = find_dissector("bthci_cmd");
5884 * Editor modelines - http://www.wireshark.org/tools/modelines.html
5886 * Local variables:
5887 * c-basic-offset: 4
5888 * tab-width: 8
5889 * indent-tabs-mode: nil
5890 * End:
5892 * vi: set shiftwidth=4 tabstop=8 expandtab:
5893 * :indentSize=4:tabSize=8:noTabs=true: