Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-bthci_evt.c
blob516c5581d2f1f47036d4642a7d7704a441338971
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
13 * Updated to HCI specification 5.3
14 * Allan M. Madsen 2022
15 * Updated to HCI specification 5.4
16 * Allan M. Madsen 2023
17 * Updated to HCI specification 6.0
18 * Allan M. Madsen 2024
20 * Wireshark - Network traffic analyzer
21 * By Gerald Combs <gerald@wireshark.org>
22 * Copyright 1998 Gerald Combs
24 * SPDX-License-Identifier: GPL-2.0-or-later
27 #include "config.h"
29 #include <epan/packet.h>
30 #include <epan/addr_resolv.h>
31 #include <epan/expert.h>
32 #include <epan/prefs.h>
33 #include <epan/decode_as.h>
34 #include <epan/tap.h>
35 #include <epan/proto_data.h>
36 #include <epan/unit_strings.h>
38 #include <wsutil/utf8_entities.h>
40 #include "packet-bluetooth.h"
41 #include "packet-bthci_sco.h"
42 #include "packet-bthci_cmd.h"
43 #include "packet-bthci_evt.h"
45 static dissector_handle_t bthci_cmd_handle;
46 static dissector_handle_t bthci_evt_handle;
47 static dissector_handle_t btcommon_cod_handle;
48 static dissector_handle_t btcommon_eir_handle;
49 static dissector_handle_t btcommon_ad_handle;
50 static dissector_handle_t btcommon_le_channel_map_handle;
52 /* Initialize the protocol and registered fields */
53 static int proto_bthci_evt;
54 static int hf_bthci_evt_code;
55 static int hf_bthci_evt_param_length;
56 static int hf_bthci_evt_num_command_packets;
57 static int hf_bthci_evt_num_handles;
58 static int hf_bthci_evt_connection_handle;
59 static int hf_bthci_evt_num_compl_packets;
60 static int hf_bthci_evt_ret_params;
61 static int hf_bthci_evt_status;
62 static int hf_bthci_evt_status_pending;
63 static int hf_bthci_evt_opcode;
64 static int hf_bthci_evt_ogf;
65 static int hf_bthci_evt_ocf;
66 static int hf_bthci_evt_ocf_link_control;
67 static int hf_bthci_evt_ocf_link_policy;
68 static int hf_bthci_evt_ocf_host_controller_and_baseband;
69 static int hf_bthci_evt_ocf_informational;
70 static int hf_bthci_evt_ocf_status;
71 static int hf_bthci_evt_ocf_testing;
72 static int hf_bthci_evt_ocf_logo_testing;
73 static int hf_bthci_evt_ocf_low_energy;
74 static int hf_bthci_evt_bd_addr;
75 static int hf_bthci_evt_link_type;
76 static int hf_bthci_evt_encryption_mode;
77 static int hf_bthci_evt_reason;
78 static int hf_bthci_evt_remote_name;
79 static int hf_bthci_evt_encryption_enable;
80 static int hf_bthci_evt_key_flag;
81 static int hf_bthci_evt_vers_nr;
82 static int hf_bthci_bthci_evt_hci_version;
83 static int hf_bthci_evt_hci_revision;
84 static int hf_bthci_evt_comp_id;
85 static int hf_bthci_evt_sub_vers_nr;
86 static int hf_bthci_evt_flags;
87 static int hf_bthci_evt_service_type;
88 static int hf_bthci_evt_token_rate;
89 static int hf_bthci_evt_peak_bandwidth;
90 static int hf_bthci_evt_latency;
91 static int hf_bthci_evt_delay_variation;
92 static int hf_bthci_evt_hardware_code;
93 static int hf_bthci_evt_role;
94 static int hf_bthci_evt_curr_role;
95 static int hf_bthci_evt_curr_mode;
96 static int hf_bthci_evt_interval;
97 static int hf_bthci_evt_link_key;
98 static int hf_bthci_evt_key_type;
99 static int hf_bthci_evt_max_slots;
100 static int hf_bthci_evt_clock_offset;
101 static int hf_bthci_evt_clock_offset_32;
102 static int hf_bthci_evt_page_scan_mode;
103 static int hf_bthci_evt_page_scan_repetition_mode;
104 static int hf_bthci_evt_reserved;
105 static int hf_bthci_evt_page_scan_period_mode;
106 static int hf_bthci_evt_num_keys;
107 static int hf_bthci_evt_num_keys_read;
108 static int hf_bthci_evt_max_num_keys;
109 static int hf_bthci_evt_num_responses;
110 static int hf_bthci_evt_num_keys_written;
111 static int hf_bthci_evt_num_keys_deleted;
112 static int hf_bthci_evt_link_policy_setting_switch;
113 static int hf_bthci_evt_link_policy_setting_hold;
114 static int hf_bthci_evt_link_policy_setting_sniff;
115 static int hf_bthci_evt_link_policy_setting_park;
116 static int hf_bthci_evt_pin_type;
117 static int hf_bthci_evt_device_name;
118 static int hf_bthci_evt_timeout;
119 static int hf_bthci_evt_scan_enable;
120 static int hf_bthci_evt_authentication_enable;
121 static int hf_bthci_evt_sco_flow_cont_enable;
122 static int hf_bthci_evt_window;
123 static int hf_bthci_evt_input_unused;
124 static int hf_bthci_evt_input_coding;
125 static int hf_bthci_evt_input_data_format;
126 static int hf_bthci_evt_input_sample_size;
127 static int hf_bthci_evt_linear_pcm_bit_pos;
128 static int hf_bthci_evt_air_coding_format;
129 static int hf_bthci_evt_num_broadcast_retransm;
130 static int hf_bthci_evt_hold_mode_act_page;
131 static int hf_bthci_evt_hold_mode_act_inquiry;
132 static int hf_bthci_evt_hold_mode_act_periodic;
133 static int hf_bthci_evt_transmit_power_level;
134 static int hf_bthci_evt_max_transmit_power_level;
135 static int hf_bthci_evt_transmit_power_level_gfsk;
136 static int hf_bthci_evt_transmit_power_level_dqpsk;
137 static int hf_bthci_evt_transmit_power_level_8dpsk;
138 static int hf_bthci_evt_flush_to_us;
139 static int hf_bthci_evt_num_supp_iac;
140 static int hf_bthci_evt_num_curr_iac;
141 static int hf_bthci_evt_iac_lap;
142 static int hf_bthci_evt_loopback_mode;
143 static int hf_bthci_evt_country_code;
144 static int hf_bthci_evt_failed_contact_counter;
145 static int hf_bthci_evt_link_quality;
146 static int hf_bthci_evt_rssi;
147 static int hf_bthci_evt_host_data_packet_length_acl;
148 static int hf_bthci_evt_host_data_packet_length_sco;
149 static int hf_bthci_evt_host_total_num_acl_data_packets;
150 static int hf_bthci_evt_host_total_num_sco_data_packets;
151 static int hf_bthci_evt_page_number;
152 static int hf_bthci_evt_max_page_number;
153 static int hf_bthci_evt_local_supported_cmds;
154 static int hf_bthci_evt_fec_required;
155 static int hf_bthci_evt_err_data_reporting;
156 static int hf_bthci_evt_scan_type;
157 static int hf_bthci_evt_inq_mode;
158 static int hf_bthci_evt_power_level_type;
159 static int hf_lmp_features;
160 static int hf_lmp_feature_3slot_packets;
161 static int hf_lmp_feature_5slot_packets;
162 static int hf_lmp_feature_encryption;
163 static int hf_lmp_feature_slot_offset;
164 static int hf_lmp_feature_timing_accuracy;
165 static int hf_lmp_feature_role_switch;
166 static int hf_lmp_feature_hold_mode;
167 static int hf_lmp_feature_sniff_mode;
168 static int hf_lmp_feature_park_state;
169 static int hf_lmp_feature_power_control_requests;
170 static int hf_lmp_feature_channel_quality_driven_data_rate;
171 static int hf_lmp_feature_sco_link;
172 static int hf_lmp_feature_hv2_packets;
173 static int hf_lmp_feature_hv3_packets;
174 static int hf_lmp_feature_u_law_log_synchronous_data;
175 static int hf_lmp_feature_a_law_log_synchronous_data;
176 static int hf_lmp_feature_cvsd_synchronous_data;
177 static int hf_lmp_feature_paging_parameter_negotiation;
178 static int hf_lmp_feature_power_control;
179 static int hf_lmp_feature_transparent_synchronous_data;
180 static int hf_lmp_feature_flow_control_lag;
181 static int hf_lmp_feature_broadcast_encryption;
182 static int hf_lmp_feature_reserved_24;
183 static int hf_lmp_feature_edr_acl_2mbps_mode;
184 static int hf_lmp_feature_edr_acl_3mbps_mode;
185 static int hf_lmp_feature_enhanced_inquiry_scan;
186 static int hf_lmp_feature_interlaced_inquiry_scan;
187 static int hf_lmp_feature_interlaced_page_scan;
188 static int hf_lmp_feature_rssi_with_inquiry_results;
189 static int hf_lmp_feature_ev3_packets;
190 static int hf_lmp_feature_ev4_packets;
191 static int hf_lmp_feature_ev5_packets;
192 static int hf_lmp_feature_reserved_34;
193 static int hf_lmp_feature_afh_capable_peripheral;
194 static int hf_lmp_feature_afh_classification_peripheral;
195 static int hf_lmp_feature_br_edr_not_supported;
196 static int hf_lmp_feature_le_supported_controller;
197 static int hf_lmp_feature_3slot_edr_acl_packets;
198 static int hf_lmp_feature_5slot_edr_acl_packets;
199 static int hf_lmp_feature_sniff_subrating;
200 static int hf_lmp_feature_pause_encryption;
201 static int hf_lmp_feature_afh_capable_central;
202 static int hf_lmp_feature_afh_classification_central;
203 static int hf_lmp_feature_edr_esco_2mbps_mode;
204 static int hf_lmp_feature_edr_esco_3mbps_mode;
205 static int hf_lmp_feature_3slot_edr_esco_packets;
206 static int hf_lmp_feature_extended_inquiry_response;
207 static int hf_lmp_feature_simultaneous_le_and_br_edr_controller;
208 static int hf_lmp_feature_reserved_50;
209 static int hf_lmp_feature_secure_simple_pairing;
210 static int hf_lmp_feature_encapsulated_pdu;
211 static int hf_lmp_feature_erroneous_data_reporting;
212 static int hf_lmp_feature_non_flushable_packet_boundary_flag;
213 static int hf_lmp_feature_reserved_55;
214 static int hf_lmp_feature_link_supervision_timeout_changed_event;
215 static int hf_lmp_feature_inquiry_tx_power_level;
216 static int hf_lmp_feature_enhanced_power_control;
217 static int hf_lmp_feature_reserved_59_62;
218 static int hf_lmp_feature_extended_features;
219 static int hf_lmp_feature_secure_simple_pairing_host;
220 static int hf_lmp_feature_le_supported_host;
221 static int hf_lmp_feature_simultaneous_le_and_br_edr_host;
222 static int hf_lmp_feature_secure_connections_host;
223 static int hf_lmp_feature_reserved_68_71;
224 static int hf_lmp_feature_cpb_central_operation;
225 static int hf_lmp_feature_cpb_peripheral_operation;
226 static int hf_lmp_feature_synchronization_train;
227 static int hf_lmp_feature_synchronization_scan;
228 static int hf_lmp_feature_inquiry_response_notification_event;
229 static int hf_lmp_feature_generalized_interlaced_scan;
230 static int hf_lmp_feature_coarse_clock_adjustment;
231 static int hf_lmp_feature_reserved_135;
232 static int hf_lmp_feature_secure_connections_controller;
233 static int hf_lmp_feature_ping;
234 static int hf_lmp_feature_reserved_138;
235 static int hf_lmp_feature_train_nudging;
236 static int hf_lmp_feature_slot_availability_mask;
237 static int hf_lmp_feature_reserved;
238 static int hf_bthci_evt_sync_link_type;
239 static int hf_bthci_evt_sync_tx_interval;
240 static int hf_bthci_evt_sync_rtx_window;
241 static int hf_bthci_evt_sync_rx_packet_length;
242 static int hf_bthci_evt_sync_tx_packet_length;
243 static int hf_bthci_evt_air_mode;
244 static int hf_bthci_evt_max_tx_latency;
245 static int hf_bthci_evt_max_rx_latency;
246 static int hf_bthci_evt_min_remote_timeout;
247 static int hf_bthci_evt_min_local_timeout;
248 static int hf_bthci_evt_link_supervision_timeout;
249 static int hf_bthci_evt_token_bucket_size;
250 static int hf_bthci_evt_flow_direction;
251 static int hf_bthci_evt_afh_ch_assessment_mode;
252 static int hf_bthci_evt_lmp_handle;
253 static int hf_bthci_evt_clock;
254 static int hf_bthci_evt_clock_accuracy;
255 static int hf_bthci_evt_afh_mode;
256 static int hf_bthci_evt_afh_channel_map;
257 static int hf_bthci_evt_simple_pairing_mode;
258 static int hf_bthci_evt_randomizer_r;
259 static int hf_bthci_evt_hash_c;
260 static int hf_bthci_evt_io_capability;
261 static int hf_bthci_evt_oob_data_present;
262 static int hf_bthci_evt_auth_requirements;
263 static int hf_bthci_evt_numeric_value;
264 static int hf_bthci_evt_passkey;
265 static int hf_bthci_evt_notification_type;
266 static int hf_bthci_evt_data_length;
267 static int hf_bthci_evt_location_domain_aware;
268 static int hf_bthci_evt_location_domain;
269 static int hf_bthci_evt_location_domain_options;
270 static int hf_bthci_evt_location_options;
271 static int hf_bthci_evt_flow_control_mode;
272 static int hf_bthci_evt_physical_link_handle;
273 static int hf_bthci_evt_flow_spec_identifier;
274 static int hf_bthci_evt_logical_link_handle;
275 static int hf_bthci_evt_max_acl_data_packet_length;
276 static int hf_bthci_evt_data_block_length;
277 static int hf_bthci_evt_total_num_data_blocks;
278 static int hf_bthci_evt_enc_key_size;
279 static int hf_bthci_evt_amp_remaining_assoc_length;
280 static int hf_bthci_evt_amp_assoc_fragment;
281 static int hf_bthci_evt_amp_status;
282 static int hf_bthci_evt_total_bandwidth;
283 static int hf_bthci_evt_max_guaranteed_bandwidth;
284 static int hf_bthci_evt_min_latency;
285 static int hf_bthci_evt_max_pdu_size;
286 static int hf_bthci_evt_amp_controller_type;
287 static int hf_bthci_evt_pal_capabilities_00;
288 static int hf_bthci_evt_max_amp_assoc_length;
289 static int hf_bthci_evt_max_flush_to_us;
290 static int hf_bthci_evt_best_effort_flush_to_us;
291 static int hf_bthci_evt_link_loss_reason;
292 static int hf_bthci_evt_num_compl_blocks;
293 static int hf_bthci_evt_test_scenario;
294 static int hf_bthci_evt_report_reason;
295 static int hf_bthci_evt_report_event_type;
296 static int hf_bthci_evt_num_frames;
297 static int hf_bthci_evt_num_error_frames;
298 static int hf_bthci_evt_num_bits;
299 static int hf_bthci_evt_num_error_bits;
300 static int hf_bthci_evt_short_range_mode_state;
301 static int hf_bthci_evt_le_supported_host;
302 static int hf_bthci_evt_le_simultaneous_host;
303 static int hf_bthci_evt_le_acl_data_pkt_len;
304 static int hf_bthci_evt_total_num_le_acl_data_pkts;
305 static int hf_bthci_evt_iso_data_pkt_len;
306 static int hf_bthci_evt_total_num_iso_data_pkts;
307 static int hf_bthci_evt_filter_accept_list_size;
308 static int hf_bthci_evt_le_channel_map;
309 static int hf_bthci_evt_encrypted_data;
310 static int hf_bthci_evt_random_number;
311 static int hf_bthci_evt_le_num_packets;
312 static int hf_bthci_evt_le_meta_subevent;
313 static int hf_bthci_evt_le_peer_address_type;
314 static int hf_bthci_evt_le_local_rpa;
315 static int hf_bthci_evt_le_peer_rpa;
316 static int hf_bthci_evt_le_con_interval;
317 static int hf_bthci_evt_le_min_interval;
318 static int hf_bthci_evt_le_max_interval;
319 static int hf_bthci_evt_le_con_latency;
320 static int hf_bthci_evt_le_supervision_timeout;
321 static int hf_bthci_evt_le_max_tx_octets;
322 static int hf_bthci_evt_le_max_tx_time;
323 static int hf_bthci_evt_le_max_rx_octets;
324 static int hf_bthci_evt_le_max_rx_time;
325 static int hf_bthci_evt_le_local_p_256_public_key;
326 static int hf_bthci_evt_le_dhkey;
327 static int hf_bthci_evt_encrypted_diversifier;
328 static int hf_bthci_evt_le_central_clock_accuracy;
329 static int hf_bthci_evt_num_reports;
330 static int hf_bthci_evt_advts_event_type;
331 static int hf_bthci_evt_le_states;
332 static int hf_bthci_evt_le_states_00;
333 static int hf_bthci_evt_le_states_01;
334 static int hf_bthci_evt_le_states_02;
335 static int hf_bthci_evt_le_states_03;
336 static int hf_bthci_evt_le_states_04;
337 static int hf_bthci_evt_le_states_05;
338 static int hf_bthci_evt_le_states_06;
339 static int hf_bthci_evt_le_states_07;
340 static int hf_bthci_evt_le_states_10;
341 static int hf_bthci_evt_le_states_11;
342 static int hf_bthci_evt_le_states_12;
343 static int hf_bthci_evt_le_states_13;
344 static int hf_bthci_evt_le_states_14;
345 static int hf_bthci_evt_le_states_15;
346 static int hf_bthci_evt_le_states_16;
347 static int hf_bthci_evt_le_states_17;
348 static int hf_bthci_evt_le_states_20;
349 static int hf_bthci_evt_le_states_21;
350 static int hf_bthci_evt_le_states_22;
351 static int hf_bthci_evt_le_states_23;
352 static int hf_bthci_evt_le_states_24;
353 static int hf_bthci_evt_le_states_25;
354 static int hf_bthci_evt_le_states_26;
355 static int hf_bthci_evt_le_states_27;
356 static int hf_bthci_evt_le_states_30;
357 static int hf_bthci_evt_le_states_31;
358 static int hf_bthci_evt_le_states_32;
359 static int hf_bthci_evt_le_states_33;
360 static int hf_bthci_evt_le_states_34;
361 static int hf_changed_in_frame;
362 static int hf_command_in_frame;
363 static int hf_pending_in_frame;
364 static int hf_response_in_frame;
365 static int hf_command_pending_time_delta;
366 static int hf_command_response_time_delta;
367 static int hf_pending_response_time_delta;
368 static int hf_bthci_evt_le_features;
369 static int hf_bthci_evt_le_features_encryption;
370 static int hf_bthci_evt_le_features_connection_parameters_request_procedure;
371 static int hf_bthci_evt_le_features_extended_reject_indication;
372 static int hf_bthci_evt_le_features_peripheral_initiated_features_exchange;
373 static int hf_bthci_evt_le_features_ping;
374 static int hf_bthci_evt_le_features_data_packet_length_extension;
375 static int hf_bthci_evt_le_features_ll_privacy;
376 static int hf_bthci_evt_le_features_extended_scanner_filter_policies;
377 static int hf_bthci_evt_le_features_2m_phy;
378 static int hf_bthci_evt_le_features_stable_modulation_index_tx;
379 static int hf_bthci_evt_le_features_stable_modulation_index_rx;
380 static int hf_bthci_evt_le_features_coded_phy;
381 static int hf_bthci_evt_le_features_extended_advertising;
382 static int hf_bthci_evt_le_features_periodic_advertising;
383 static int hf_bthci_evt_le_features_channel_selection_algorithm_2;
384 static int hf_bthci_evt_le_features_power_class_1;
385 static int hf_bthci_evt_le_features_minimum_number_of_used_channels_procedure;
386 static int hf_bthci_evt_le_features_connection_cte_request;
387 static int hf_bthci_evt_le_features_connection_cte_response;
388 static int hf_bthci_evt_le_features_connectionless_cte_tx;
389 static int hf_bthci_evt_le_features_connectionless_cte_rx;
390 static int hf_bthci_evt_le_features_antenna_switching_during_cte_tx_aod;
391 static int hf_bthci_evt_le_features_antenna_switching_during_cte_rx_aoa;
392 static int hf_bthci_evt_le_features_receiving_cte;
393 static int hf_bthci_evt_le_features_periodic_advertising_sync_transfer_sender;
394 static int hf_bthci_evt_le_features_periodic_advertising_sync_transfer_receiver;
395 static int hf_bthci_evt_le_features_sleep_clock_accuracy_updates;
396 static int hf_bthci_evt_le_features_remote_public_key_validation;
397 static int hf_bthci_evt_le_features_cis_central;
398 static int hf_bthci_evt_le_features_cis_peripheral;
399 static int hf_bthci_evt_le_features_isochronous_broadcaster;
400 static int hf_bthci_evt_le_features_synchronized_receiver;
401 static int hf_bthci_evt_le_features_isochronous_channels_host_support;
402 static int hf_bthci_evt_le_features_power_control_request;
403 static int hf_bthci_evt_le_features_power_change_indication;
404 static int hf_bthci_evt_le_features_path_loss_monitoring;
405 static int hf_bthci_evt_le_features_periodic_advertising_adi;
406 static int hf_bthci_evt_le_features_connection_subrating;
407 static int hf_bthci_evt_le_features_connection_subrating_host_support;
408 static int hf_bthci_evt_le_features_channel_classification;
409 static int hf_bthci_evt_le_features_coding_selection;
410 static int hf_bthci_evt_le_features_coding_selection_host_support;
411 static int hf_bthci_evt_le_features_decision_based_advertising_filtering;
412 static int hf_bthci_evt_le_features_periodic_advertising_responses_advertiser;
413 static int hf_bthci_evt_le_features_periodic_advertising_responses_scanner;
414 static int hf_bthci_evt_le_features_unsegmented_framed_mode;
415 static int hf_bthci_evt_le_features_channel_sounding;
416 static int hf_bthci_evt_le_features_channel_sounding_host_support;
417 static int hf_bthci_evt_le_features_channel_sounding_tone_quality_indication;
418 static int hf_bthci_evt_le_features_ext_feature_set;
419 static int hf_bthci_evt_le_features_reserved;
420 static int hf_bthci_evt_le_ext_features_1;
421 static int hf_bthci_evt_le_ext_features_1_monitoring_advertisers;
422 static int hf_bthci_evt_le_ext_features_1_frame_space_update;
423 static int hf_bthci_evt_le_ext_features_1_reserved;
424 static int hf_bthci_evt_mws_number_of_transports;
425 static int hf_bthci_evt_mws_transport_layers;
426 static int hf_bthci_evt_mws_transport_layers_item;
427 static int hf_bthci_evt_mws_transport_layer;
428 static int hf_bthci_evt_mws_number_of_baud_rates;
429 static int hf_bthci_evt_mws_to_mws_baud_rates;
430 static int hf_bthci_evt_mws_to_mws_baud_rates_tranport_item;
431 static int hf_bthci_evt_mws_to_mws_baud_rate;
432 static int hf_bthci_evt_mws_from_mws_baud_rates;
433 static int hf_bthci_evt_mws_from_mws_baud_rates_tranport_item;
434 static int hf_bthci_evt_mws_from_mws_baud_rate;
435 static int hf_bthci_evt_selected_tx_power;
436 static int hf_bthci_evt_which_clock;
437 static int hf_bthci_evt_slot_offset;
438 static int hf_bthci_evt_lt_addr;
439 static int hf_bthci_evt_next_broadcast_instant;
440 static int hf_bthci_evt_connectionless_peripheral_broadcast_interval;
441 static int hf_bthci_evt_service_data;
442 static int hf_bthci_evt_local_sam_index;
443 static int hf_bthci_evt_local_sam_tx_availability;
444 static int hf_bthci_evt_local_sam_rx_availability;
445 static int hf_bthci_evt_remote_sam_index;
446 static int hf_bthci_evt_remote_sam_tx_availability;
447 static int hf_bthci_evt_remote_sam_rx_availability;
448 static int hf_bthci_evt_receive_status;
449 static int hf_bthci_evt_fragment;
450 static int hf_bthci_evt_data;
451 static int hf_bthci_evt_le_number_of_reports;
452 static int hf_bthci_evt_le_report;
453 static int hf_bthci_evt_le_event_type;
454 static int hf_bthci_evt_le_direct_address_type;
455 static int hf_bthci_evt_le_direct_bd_addr;
456 static int hf_bthci_evt_le_address_type;
457 static int hf_bthci_evt_le_rssi;
458 static int hf_bthci_evt_le_tx_phy;
459 static int hf_bthci_evt_le_rx_phy;
460 static int hf_bthci_evt_max_adv_data_length;
461 static int hf_bthci_evt_num_supported_adv_sets;
462 static int hf_bthci_evt_number_of_supported_codecs;
463 static int hf_bthci_evt_number_of_supported_vendor_codecs;
464 static int hf_bthci_evt_codecs;
465 static int hf_bthci_evt_vendor_codecs;
466 static int hf_bthci_evt_vendor_codecs_item;
467 static int hf_bthci_evt_codec_id;
468 static int hf_bthci_evt_vendor_codec_id;
469 static int hf_bthci_evt_mws_bt_rx_priority_assert_offset;
470 static int hf_bthci_evt_mws_bt_rx_priority_assert_jitter;
471 static int hf_bthci_evt_mws_bt_rx_priority_deassert_offset;
472 static int hf_bthci_evt_mws_bt_rx_priority_deassert_jitter;
473 static int hf_bthci_evt_mws_bt_tx_priority_assert_offset;
474 static int hf_bthci_evt_mws_bt_tx_priority_assert_jitter;
475 static int hf_bthci_evt_mws_bt_tx_priority_deassert_offset;
476 static int hf_bthci_evt_mws_bt_tx_priority_deassert_jitter;
477 static int hf_bthci_evt_mws_802_rx_priority_assert_offset;
478 static int hf_bthci_evt_mws_802_rx_priority_assert_jitter;
479 static int hf_bthci_evt_mws_802_rx_priority_deassert_offset;
480 static int hf_bthci_evt_mws_802_rx_priority_deassert_jitter;
481 static int hf_bthci_evt_mws_802_tx_priority_assert_offset;
482 static int hf_bthci_evt_mws_802_tx_priority_assert_jitter;
483 static int hf_bthci_evt_mws_802_tx_priority_deassert_offset;
484 static int hf_bthci_evt_mws_802_tx_priority_deassert_jitter;
485 static int hf_bthci_evt_sync_train_interval;
486 static int hf_bthci_evt_sync_train_to;
487 static int hf_bthci_evt_secure_connection_host_support;
488 static int hf_bthci_evt_authenticated_payload_timeout;
489 static int hf_bthci_evt_c192;
490 static int hf_bthci_evt_r192;
491 static int hf_bthci_evt_c256;
492 static int hf_bthci_evt_r256;
493 static int hf_bthci_evt_extended_inquiry_length;
494 static int hf_bthci_evt_suggested_max_tx_octets;
495 static int hf_bthci_evt_suggested_max_tx_time;
496 static int hf_bthci_evt_suggested_max_rx_octets;
497 static int hf_bthci_evt_suggested_max_rx_time;
498 static int hf_bthci_evt_resolving_list_size;
499 static int hf_bthci_evt_primary_phy;
500 static int hf_bthci_evt_secondary_phy;
501 static int hf_bthci_evt_advertising_sid;
502 static int hf_bthci_evt_tx_power;
503 static int hf_bthci_evt_periodic_advertising_interval;
504 static int hf_bthci_evt_num_compl_ext_advertising_events;
505 static int hf_bthci_evt_channel_selection_algorithm;
506 static int hf_bthci_evt_advertiser_clock_accuracy;
507 static int hf_bthci_evt_advertiser_phy;
508 static int hf_bthci_evt_periodic_adv_list_size;
509 static int hf_bthci_evt_min_tx_power;
510 static int hf_bthci_evt_max_tx_power;
511 static int hf_bthci_evt_rf_tx_path_compensation;
512 static int hf_bthci_evt_rf_rx_path_compensation;
513 static int hf_bthci_evt_sync_handle;
514 static int hf_bthci_evt_data_status;
515 static int hf_bthci_evt_advertising_handle;
516 static int hf_bthci_evt_channel_index;
517 static int hf_bthci_evt_cte_rssi;
518 static int hf_bthci_evt_antenna_id;
519 static int hf_bthci_evt_cte_type;
520 static int hf_bthci_evt_slot_durations;
521 static int hf_bthci_evt_packet_status;
522 static int hf_bthci_evt_event_counter;
523 static int hf_bthci_evt_sample_count;
524 static int hf_bthci_evt_i_sample;
525 static int hf_bthci_evt_q_sample;
526 static int hf_bthci_evt_service_data_past;
527 static int hf_bthci_evt_number_antennae;
528 static int hf_bthci_evt_max_cte_length;
529 static int hf_bthci_evt_max_length_antenna_switching_pattern;
530 static int hf_bthci_evt_max_encryption_key_size;
531 static int hf_bthci_evt_sdu_packet_seq_num;
532 static int hf_bthci_evt_sdu_packet_timestamp;
533 static int hf_bthci_evt_sdu_packet_offset;
534 static int hf_bthci_evt_cig_id;
535 static int hf_bthci_evt_cis_id;
536 static int hf_bthci_evt_cis_count;
537 static int hf_bthci_evt_cis_handle;
538 static int hf_bthci_evt_cis_bis_handle;
539 static int hf_bthci_evt_big_handle;
540 static int hf_bthci_evt_received_packet_counter;
541 static int hf_bthci_evt_missed_packet_counter;
542 static int hf_bthci_evt_failed_packet_counter;
543 static int hf_bthci_evt_pkt_count_tx_unacked;
544 static int hf_bthci_evt_pkt_count_tx_flushed;
545 static int hf_bthci_evt_pkt_count_tx_last_subevent;
546 static int hf_bthci_evt_pkt_count_tx_retransmitted;
547 static int hf_bthci_evt_pkt_count_rx_crc_error;
548 static int hf_bthci_evt_pkt_count_rx_unreceived;
549 static int hf_bthci_evt_pkt_count_rx_duplicate;
550 static int hf_bthci_evt_phy_and_coding;
551 static int hf_bthci_evt_cig_sync_delay;
552 static int hf_bthci_evt_big_sync_delay;
553 static int hf_bthci_evt_cis_sync_delay;
554 static int hf_bthci_evt_transport_latency_c_to_p;
555 static int hf_bthci_evt_transport_latency_p_to_c;
556 static int hf_bthci_evt_big_transport_latency;
557 static int hf_bthci_evt_phy_c_to_p;
558 static int hf_bthci_evt_phy_p_to_c;
559 static int hf_bthci_evt_bn_c_to_p;
560 static int hf_bthci_evt_bn_p_to_c;
561 static int hf_bthci_evt_ft_c_to_p;
562 static int hf_bthci_evt_ft_p_to_c;
563 static int hf_bthci_evt_max_pdu_c_to_p;
564 static int hf_bthci_evt_max_pdu_p_to_c;
565 static int hf_bthci_evt_sub_interval;
566 static int hf_bthci_evt_max_sdu_c_to_p;
567 static int hf_bthci_evt_max_sdu_p_to_c;
568 static int hf_bthci_evt_sdu_interval_c_to_p;
569 static int hf_bthci_evt_sdu_interval_p_to_c;
570 static int hf_bthci_evt_phy;
571 static int hf_bthci_evt_nse;
572 static int hf_bthci_evt_bn;
573 static int hf_bthci_evt_pto;
574 static int hf_bthci_evt_irc;
575 static int hf_bthci_evt_max_pdu;
576 static int hf_bthci_evt_iso_interval;
577 static int hf_bthci_evt_num_bis;
578 static int hf_bthci_evt_bis_handle;
579 static int hf_bthci_evt_current_path_loss;
580 static int hf_bthci_evt_zone_entered;
581 static int hf_bthci_evt_power_report_reason;
582 static int hf_bthci_evt_power_level_delta;
583 static int hf_bthci_evt_sdu_interval;
584 static int hf_bthci_evt_max_sdu;
585 static int hf_bthci_evt_framing;
586 static int hf_bthci_evt_peer_clock_accuracy;
587 static int hf_bthci_evt_subrate_factor;
588 static int hf_bthci_evt_continuation_number;
589 static int hf_bthci_evt_subevent_start;
590 static int hf_bthci_evt_subevent_count;
591 static int hf_bthci_evt_subevent;
592 static int hf_bthci_evt_subevent_tx_status;
593 static int hf_bthci_evt_subevent_responses;
594 static int hf_bthci_evt_response_slot;
595 static int hf_bthci_evt_num_subevents;
596 static int hf_bthci_evt_subevent_interval;
597 static int hf_bthci_evt_response_slot_delay;
598 static int hf_bthci_evt_response_slot_spacing;
599 static int hf_bthci_evt_periodic_event_counter;
600 static int hf_packet_type_acl;
601 static int hf_packet_type_acl_dh5;
602 static int hf_packet_type_acl_dm5;
603 static int hf_packet_type_acl_3dh5;
604 static int hf_packet_type_acl_2dh5;
605 static int hf_packet_type_acl_dh3;
606 static int hf_packet_type_acl_dm3;
607 static int hf_packet_type_acl_3dh3;
608 static int hf_packet_type_acl_2dh3;
609 static int hf_packet_type_acl_reserved_5_7;
610 static int hf_packet_type_acl_dh1;
611 static int hf_packet_type_acl_dm1;
612 static int hf_packet_type_acl_3dh1;
613 static int hf_packet_type_acl_2dh1;
614 static int hf_packet_type_acl_reserved_0;
615 static int hf_packet_type_sco;
616 static int hf_packet_type_sco_reserved_15_8;
617 static int hf_packet_type_sco_hv3;
618 static int hf_packet_type_sco_hv2;
619 static int hf_packet_type_sco_hv1;
620 static int hf_packet_type_sco_reserved_4_0;
621 static int hf_bthci_evt_max_remote_page;
622 static int hf_bthci_evt_max_valid_page;
623 static int hf_bthci_evt_monitoring_adv_list_size;
624 static int hf_bthci_evt_config_id;
625 static int hf_bthci_evt_num_config;
626 static int hf_bthci_evt_max_consecutive_procedures;
627 static int hf_bthci_evt_remote_fae_table;
628 static int hf_bthci_evt_channel_map;
629 static int hf_bthci_evt_cs_action;
630 static int hf_bthci_evt_main_mode_type;
631 static int hf_bthci_evt_sub_mode_type;
632 static int hf_bthci_evt_min_main_mode_steps;
633 static int hf_bthci_evt_max_main_mode_steps;
634 static int hf_bthci_evt_main_mode_repetition;
635 static int hf_bthci_evt_mode_0_steps;
636 static int hf_bthci_evt_cs_role;
637 static int hf_bthci_evt_rtt_type;
638 static int hf_bthci_evt_cs_sync_phy;
639 static int hf_bthci_evt_channel_map_repetition;
640 static int hf_bthci_evt_channel_selection_type;
641 static int hf_bthci_evt_ch3c_shape;
642 static int hf_bthci_evt_ch3c_jump;
643 static int hf_bthci_evt_companion_signal_enable;
644 static int hf_bthci_evt_t_ip1_time;
645 static int hf_bthci_evt_t_ip2_time;
646 static int hf_bthci_evt_t_fcs_time;
647 static int hf_bthci_evt_t_pm_time;
648 static int hf_bthci_evt_cs_state;
649 static int hf_bthci_evt_tone_antenna_selection;
650 static int hf_bthci_evt_cs_subevent_len;
651 static int hf_bthci_evt_cs_subevents_per_event;
652 static int hf_bthci_evt_cs_subevent_interval;
653 static int hf_bthci_evt_cs_event_interval;
654 static int hf_bthci_evt_cs_procedure_interval;
655 static int hf_bthci_evt_cs_procedure_count;
656 static int hf_bthci_evt_max_procedure_len;
657 static int hf_bthci_evt_start_acl_conn_event;
658 static int hf_bthci_evt_procedure_counter;
659 static int hf_bthci_evt_freq_compensation;
660 static int hf_bthci_evt_ref_power_level;
661 static int hf_bthci_evt_procedure_done_status;
662 static int hf_bthci_evt_subevent_done_status;
663 static int hf_bthci_evt_cs_abort_reason;
664 static int hf_bthci_evt_cs_abort_reason_procedure;
665 static int hf_bthci_evt_cs_abort_reason_subevent;
666 static int hf_bthci_evt_num_antenna_paths;
667 static int hf_bthci_evt_cs_roles;
668 static int hf_bthci_evt_cs_roles_initiator;
669 static int hf_bthci_evt_cs_roles_reflector;
670 static int hf_bthci_evt_cs_roles_reserved;
671 static int hf_bthci_evt_cs_modes_supported;
672 static int hf_bthci_evt_cs_modes_supported_3;
673 static int hf_bthci_evt_cs_modes_supported_reserved;
674 static int hf_bthci_evt_rtt_capability;
675 static int hf_bthci_evt_rtt_capability_coarse_precision;
676 static int hf_bthci_evt_rtt_capability_sounding_precision;
677 static int hf_bthci_evt_rtt_capability_random_precision;
678 static int hf_bthci_evt_rtt_capability_reserved;
679 static int hf_bthci_evt_rtt_aa_only_n;
680 static int hf_bthci_evt_rtt_sounding_n;
681 static int hf_bthci_evt_rtt_random_n;
682 static int hf_bthci_evt_nadm_sounding_capability;
683 static int hf_bthci_evt_nadm_sounding_capability_supported;
684 static int hf_bthci_evt_nadm_sounding_capability_reserved;
685 static int hf_bthci_evt_nadm_random_capability;
686 static int hf_bthci_evt_nadm_random_capability_supported;
687 static int hf_bthci_evt_nadm_random_capability_reserved;
688 static int hf_bthci_evt_cs_sync_phys_supported;
689 static int hf_bthci_evt_cs_sync_phys_supported_2m;
690 static int hf_bthci_evt_cs_sync_phys_supported_2m2bt;
691 static int hf_bthci_evt_cs_sync_phys_supported_reserved;
692 static int hf_bthci_evt_cs_subfeatures;
693 static int hf_bthci_evt_cs_subfeatures_companion_signal;
694 static int hf_bthci_evt_cs_subfeatures_freq_actuation_error;
695 static int hf_bthci_evt_cs_subfeatures_channel_selection_3c;
696 static int hf_bthci_evt_cs_subfeatures_pbr_from_rtt;
697 static int hf_bthci_evt_cs_subfeatures_reserved;
698 static int hf_bthci_evt_tip1_times_supported;
699 static int hf_bthci_evt_tip2_times_supported;
700 static int hf_bthci_evt_tip_times_supported_10us;
701 static int hf_bthci_evt_tip_times_supported_20us;
702 static int hf_bthci_evt_tip_times_supported_30us;
703 static int hf_bthci_evt_tip_times_supported_40us;
704 static int hf_bthci_evt_tip_times_supported_50us;
705 static int hf_bthci_evt_tip_times_supported_60us;
706 static int hf_bthci_evt_tip_times_supported_80us;
707 static int hf_bthci_evt_tip_times_supported_reserved;
708 static int hf_bthci_evt_tfcs_times_supported;
709 static int hf_bthci_evt_tfcs_times_supported_15us;
710 static int hf_bthci_evt_tfcs_times_supported_20us;
711 static int hf_bthci_evt_tfcs_times_supported_30us;
712 static int hf_bthci_evt_tfcs_times_supported_40us;
713 static int hf_bthci_evt_tfcs_times_supported_50us;
714 static int hf_bthci_evt_tfcs_times_supported_60us;
715 static int hf_bthci_evt_tfcs_times_supported_80us;
716 static int hf_bthci_evt_tfcs_times_supported_100us;
717 static int hf_bthci_evt_tfcs_times_supported_120us;
718 static int hf_bthci_evt_tfcs_times_supported_reserved;
719 static int hf_bthci_evt_tpm_times_supported;
720 static int hf_bthci_evt_tpm_times_supported_10us;
721 static int hf_bthci_evt_tpm_times_supported_20us;
722 static int hf_bthci_evt_tpm_times_supported_reserved;
723 static int hf_bthci_evt_tsw_time_supported;
724 static int hf_bthci_evt_tx_snr_capability;
725 static int hf_bthci_evt_tx_snr_capability_18dB;
726 static int hf_bthci_evt_tx_snr_capability_21dB;
727 static int hf_bthci_evt_tx_snr_capability_24dB;
728 static int hf_bthci_evt_tx_snr_capability_27dB;
729 static int hf_bthci_evt_tx_snr_capability_30dB;
730 static int hf_bthci_evt_tx_snr_capability_reserved;
731 static int hf_bthci_evt_num_steps_reported;
732 static int hf_bthci_evt_cs_step;
733 static int hf_bthci_evt_step_mode;
734 static int hf_bthci_evt_step_channel;
735 static int hf_bthci_evt_step_data_length;
736 static int hf_bthci_evt_packet_quality;
737 static int hf_bthci_evt_packet_quality_aa_check;
738 static int hf_bthci_evt_packet_quality_bit_errors;
739 static int hf_bthci_evt_measured_freq_offset;
740 static int hf_bthci_evt_nadm_attack_chance;
741 static int hf_bthci_evt_toa_tod_initiator;
742 static int hf_bthci_evt_tod_toa_reflector;
743 static int hf_bthci_evt_pct1;
744 static int hf_bthci_evt_pct2;
745 static int hf_bthci_evt_pct_not_available;
746 static int hf_bthci_evt_tone_pct;
747 static int hf_bthci_evt_pct_i_sample;
748 static int hf_bthci_evt_pct_q_sample;
749 static int hf_bthci_evt_antenna_permutation_index;
750 static int hf_bthci_evt_tone_quality;
751 static int hf_bthci_evt_tone_extension_presence;
752 static int hf_bthci_evt_cs_tone;
753 static int hf_bthci_evt_monitoring_condition;
754 static int hf_bthci_evt_initiator;
755 static int hf_bthci_evt_frame_space;
756 static int hf_bthci_evt_spacing_types;
757 static int hf_bthci_evt_spacing_types_tifs_acl_cp;
758 static int hf_bthci_evt_spacing_types_tifs_acl_pc;
759 static int hf_bthci_evt_spacing_types_tmces;
760 static int hf_bthci_evt_spacing_types_tifs_cis;
761 static int hf_bthci_evt_spacing_types_tmss_cis;
762 static int hf_bthci_evt_spacing_types_reserved;
763 static int hf_bthci_evt_le_phys;
764 static int hf_bthci_evt_le_phys_le_1m;
765 static int hf_bthci_evt_le_phys_le_2m;
766 static int hf_bthci_evt_le_phys_le_coded;
767 static int hf_bthci_evt_le_phys_reserved;
769 static int * const hfx_bthci_evt_le_features[] = {
770 &hf_bthci_evt_le_features_encryption,
771 &hf_bthci_evt_le_features_connection_parameters_request_procedure,
772 &hf_bthci_evt_le_features_extended_reject_indication,
773 &hf_bthci_evt_le_features_peripheral_initiated_features_exchange,
774 &hf_bthci_evt_le_features_ping,
775 &hf_bthci_evt_le_features_data_packet_length_extension,
776 &hf_bthci_evt_le_features_ll_privacy,
777 &hf_bthci_evt_le_features_extended_scanner_filter_policies,
778 &hf_bthci_evt_le_features_2m_phy,
779 &hf_bthci_evt_le_features_stable_modulation_index_tx,
780 &hf_bthci_evt_le_features_stable_modulation_index_rx,
781 &hf_bthci_evt_le_features_coded_phy,
782 &hf_bthci_evt_le_features_extended_advertising,
783 &hf_bthci_evt_le_features_periodic_advertising,
784 &hf_bthci_evt_le_features_channel_selection_algorithm_2,
785 &hf_bthci_evt_le_features_power_class_1,
786 &hf_bthci_evt_le_features_minimum_number_of_used_channels_procedure,
787 &hf_bthci_evt_le_features_connection_cte_request,
788 &hf_bthci_evt_le_features_connection_cte_response,
789 &hf_bthci_evt_le_features_connectionless_cte_tx,
790 &hf_bthci_evt_le_features_connectionless_cte_rx,
791 &hf_bthci_evt_le_features_antenna_switching_during_cte_tx_aod,
792 &hf_bthci_evt_le_features_antenna_switching_during_cte_rx_aoa,
793 &hf_bthci_evt_le_features_receiving_cte,
794 &hf_bthci_evt_le_features_periodic_advertising_sync_transfer_sender,
795 &hf_bthci_evt_le_features_periodic_advertising_sync_transfer_receiver,
796 &hf_bthci_evt_le_features_sleep_clock_accuracy_updates,
797 &hf_bthci_evt_le_features_remote_public_key_validation,
798 &hf_bthci_evt_le_features_cis_central,
799 &hf_bthci_evt_le_features_cis_peripheral,
800 &hf_bthci_evt_le_features_isochronous_broadcaster,
801 &hf_bthci_evt_le_features_synchronized_receiver,
802 &hf_bthci_evt_le_features_isochronous_channels_host_support,
803 &hf_bthci_evt_le_features_power_control_request,
804 &hf_bthci_evt_le_features_power_change_indication,
805 &hf_bthci_evt_le_features_path_loss_monitoring,
806 &hf_bthci_evt_le_features_periodic_advertising_adi,
807 &hf_bthci_evt_le_features_connection_subrating,
808 &hf_bthci_evt_le_features_connection_subrating_host_support,
809 &hf_bthci_evt_le_features_channel_classification,
810 &hf_bthci_evt_le_features_coding_selection,
811 &hf_bthci_evt_le_features_coding_selection_host_support,
812 &hf_bthci_evt_le_features_decision_based_advertising_filtering,
813 &hf_bthci_evt_le_features_periodic_advertising_responses_advertiser,
814 &hf_bthci_evt_le_features_periodic_advertising_responses_scanner,
815 &hf_bthci_evt_le_features_unsegmented_framed_mode,
816 &hf_bthci_evt_le_features_channel_sounding,
817 &hf_bthci_evt_le_features_channel_sounding_host_support,
818 &hf_bthci_evt_le_features_channel_sounding_tone_quality_indication,
819 &hf_bthci_evt_le_features_ext_feature_set,
820 &hf_bthci_evt_le_features_reserved,
821 NULL
824 static int * const hfx_bthci_evt_le_ext_features_1[] = {
825 &hf_bthci_evt_le_ext_features_1_monitoring_advertisers,
826 &hf_bthci_evt_le_ext_features_1_frame_space_update,
827 &hf_bthci_evt_le_ext_features_1_reserved,
828 NULL
831 static int * const hfx_packet_type_acl[] = {
832 &hf_packet_type_acl_dh5,
833 &hf_packet_type_acl_dm5,
834 &hf_packet_type_acl_3dh5,
835 &hf_packet_type_acl_2dh5,
836 &hf_packet_type_acl_dh3,
837 &hf_packet_type_acl_dm3,
838 &hf_packet_type_acl_3dh3,
839 &hf_packet_type_acl_2dh3,
840 &hf_packet_type_acl_reserved_5_7,
841 &hf_packet_type_acl_dh1,
842 &hf_packet_type_acl_dm1,
843 &hf_packet_type_acl_3dh1,
844 &hf_packet_type_acl_2dh1,
845 &hf_packet_type_acl_reserved_0,
846 NULL
849 static int * const hfx_packet_type_sco[] = {
850 &hf_packet_type_sco_reserved_15_8,
851 &hf_packet_type_sco_hv3,
852 &hf_packet_type_sco_hv2,
853 &hf_packet_type_sco_hv1,
854 &hf_packet_type_sco_reserved_4_0,
855 NULL
858 static int * const hfx_bthci_evt_cs_roles[] = {
859 &hf_bthci_evt_cs_roles_initiator,
860 &hf_bthci_evt_cs_roles_reflector,
861 &hf_bthci_evt_cs_roles_reserved,
862 NULL
865 static int * const hfx_bthci_evt_cs_modes_supported[] = {
866 &hf_bthci_evt_cs_modes_supported_3,
867 &hf_bthci_evt_cs_modes_supported_reserved,
868 NULL
871 static int * const hfx_bthci_evt_rtt_capability[] = {
872 &hf_bthci_evt_rtt_capability_coarse_precision,
873 &hf_bthci_evt_rtt_capability_sounding_precision,
874 &hf_bthci_evt_rtt_capability_random_precision,
875 &hf_bthci_evt_rtt_capability_reserved,
876 NULL
879 static int * const hfx_bthci_evt_nadm_sounding_capability[] = {
880 &hf_bthci_evt_nadm_sounding_capability_supported,
881 &hf_bthci_evt_nadm_sounding_capability_reserved,
882 NULL
885 static int * const hfx_bthci_evt_nadm_random_capability[] = {
886 &hf_bthci_evt_nadm_random_capability_supported,
887 &hf_bthci_evt_nadm_random_capability_reserved,
888 NULL
891 static int * const hfx_bthci_evt_cs_sync_phys_supported[] = {
892 &hf_bthci_evt_cs_sync_phys_supported_2m,
893 &hf_bthci_evt_cs_sync_phys_supported_2m2bt,
894 &hf_bthci_evt_cs_sync_phys_supported_reserved,
895 NULL
898 static int * const hfx_bthci_evt_cs_subfeatures[] = {
899 &hf_bthci_evt_cs_subfeatures_companion_signal,
900 &hf_bthci_evt_cs_subfeatures_freq_actuation_error,
901 &hf_bthci_evt_cs_subfeatures_channel_selection_3c,
902 &hf_bthci_evt_cs_subfeatures_pbr_from_rtt,
903 &hf_bthci_evt_cs_subfeatures_reserved,
904 NULL
907 static int * const hfx_bthci_evt_tip_times_supported[] = {
908 &hf_bthci_evt_tip_times_supported_10us,
909 &hf_bthci_evt_tip_times_supported_20us,
910 &hf_bthci_evt_tip_times_supported_30us,
911 &hf_bthci_evt_tip_times_supported_40us,
912 &hf_bthci_evt_tip_times_supported_50us,
913 &hf_bthci_evt_tip_times_supported_60us,
914 &hf_bthci_evt_tip_times_supported_80us,
915 &hf_bthci_evt_tip_times_supported_reserved,
916 NULL
919 static int * const hfx_bthci_evt_tfcs_times_supported[] = {
920 &hf_bthci_evt_tfcs_times_supported_15us,
921 &hf_bthci_evt_tfcs_times_supported_20us,
922 &hf_bthci_evt_tfcs_times_supported_30us,
923 &hf_bthci_evt_tfcs_times_supported_40us,
924 &hf_bthci_evt_tfcs_times_supported_50us,
925 &hf_bthci_evt_tfcs_times_supported_60us,
926 &hf_bthci_evt_tfcs_times_supported_80us,
927 &hf_bthci_evt_tfcs_times_supported_100us,
928 &hf_bthci_evt_tfcs_times_supported_120us,
929 &hf_bthci_evt_tfcs_times_supported_reserved,
930 NULL
933 static int * const hfx_bthci_evt_tpm_times_supported[] = {
934 &hf_bthci_evt_tpm_times_supported_10us,
935 &hf_bthci_evt_tpm_times_supported_20us,
936 &hf_bthci_evt_tpm_times_supported_reserved,
937 NULL
940 static int * const hfx_bthci_evt_tx_snr_capability[] = {
941 &hf_bthci_evt_tx_snr_capability_18dB,
942 &hf_bthci_evt_tx_snr_capability_21dB,
943 &hf_bthci_evt_tx_snr_capability_24dB,
944 &hf_bthci_evt_tx_snr_capability_27dB,
945 &hf_bthci_evt_tx_snr_capability_30dB,
946 &hf_bthci_evt_tx_snr_capability_reserved,
947 NULL
950 static int * const hfx_bthci_evt_cs_abort_reason[] = {
951 &hf_bthci_evt_cs_abort_reason_procedure,
952 &hf_bthci_evt_cs_abort_reason_subevent,
953 NULL
956 static int * const hfx_bthci_evt_spacing_types[] = {
957 &hf_bthci_evt_spacing_types_tifs_acl_cp,
958 &hf_bthci_evt_spacing_types_tifs_acl_pc,
959 &hf_bthci_evt_spacing_types_tmces,
960 &hf_bthci_evt_spacing_types_tifs_cis,
961 &hf_bthci_evt_spacing_types_tmss_cis,
962 &hf_bthci_evt_spacing_types_reserved,
963 NULL
966 static int * const hfx_bthci_evt_le_phys[] = {
967 &hf_bthci_evt_le_phys_le_1m,
968 &hf_bthci_evt_le_phys_le_2m,
969 &hf_bthci_evt_le_phys_le_coded,
970 &hf_bthci_evt_le_phys_reserved,
971 NULL
974 static expert_field ei_event_undecoded;
975 static expert_field ei_event_unknown_event;
976 static expert_field ei_event_unexpected_event;
977 static expert_field ei_event_unexpected_parameter;
978 static expert_field ei_event_unknown_command;
979 static expert_field ei_parameter_unexpected;
980 static expert_field ei_manufacturer_data_changed;
981 static expert_field ei_hci_revision_changed;
982 static expert_field ei_lmp_subversion_changed;
983 static expert_field ei_bad_link_type;
985 static dissector_table_t hci_cmd_vendor_dissector_table;
986 static dissector_table_t hci_evt_vendor_dissector_table;
987 static dissector_table_t hci_vendor_table;
989 static int hf_bthci_evt_ext_advts_event_type;
990 static int hf_bthci_evt_ext_advts_event_type_connectable;
991 static int hf_bthci_evt_ext_advts_event_type_scannable;
992 static int hf_bthci_evt_ext_advts_event_type_directed;
993 static int hf_bthci_evt_ext_advts_event_type_scan_response;
994 static int hf_bthci_evt_ext_advts_event_type_legacy;
995 static int hf_bthci_evt_ext_advts_event_type_data_status;
996 static int hf_bthci_evt_ext_advts_event_type_reserved;
998 static int * const hfx_bthci_evt_le_ext_advts_evt_type[] = {
999 &hf_bthci_evt_ext_advts_event_type_connectable,
1000 &hf_bthci_evt_ext_advts_event_type_scannable,
1001 &hf_bthci_evt_ext_advts_event_type_directed,
1002 &hf_bthci_evt_ext_advts_event_type_scan_response,
1003 &hf_bthci_evt_ext_advts_event_type_legacy,
1004 &hf_bthci_evt_ext_advts_event_type_data_status,
1005 &hf_bthci_evt_ext_advts_event_type_reserved,
1006 NULL
1009 static int hf_bthci_evt_supported_switching_sample_rates;
1010 static int hf_bthci_evt_supported_switching_sample_rates_1us_switching_aod_tx;
1011 static int hf_bthci_evt_supported_switching_sample_rates_1us_sampling_aod_rx;
1012 static int hf_bthci_evt_supported_switching_sample_rates_1us_switching_and_sampling_aoa_rx;
1013 static int hf_bthci_evt_supported_switching_sample_rates_reserved;
1015 static int * const hfx_bthci_evt_supported_switching_sample_rates[] = {
1016 &hf_bthci_evt_supported_switching_sample_rates_1us_switching_aod_tx,
1017 &hf_bthci_evt_supported_switching_sample_rates_1us_sampling_aod_rx,
1018 &hf_bthci_evt_supported_switching_sample_rates_1us_switching_and_sampling_aoa_rx,
1019 &hf_bthci_evt_supported_switching_sample_rates_reserved,
1020 NULL
1023 static int hf_bthci_evt_simple_pairing_options;
1024 static int hf_bthci_evt_simple_pairing_options_remote_public_key_validation;
1025 static int hf_bthci_evt_simple_pairing_options_reserved;
1027 static int * const hfx_bthci_evt_simple_pairing_options[] = {
1028 &hf_bthci_evt_simple_pairing_options_remote_public_key_validation,
1029 &hf_bthci_evt_simple_pairing_options_reserved,
1030 NULL
1033 static int hf_bthci_evt_transmit_power_level_flags;
1034 static int hf_bthci_evt_transmit_power_level_flags_minimum_power;
1035 static int hf_bthci_evt_transmit_power_level_flags_maximum_power;
1036 static int hf_bthci_evt_transmit_power_level_flags_reserved;
1038 static int * const hfx_bthci_evt_transmit_power_level_flags[] = {
1039 &hf_bthci_evt_transmit_power_level_flags_minimum_power,
1040 &hf_bthci_evt_transmit_power_level_flags_maximum_power,
1041 &hf_bthci_evt_transmit_power_level_flags_reserved,
1042 NULL
1045 /* Initialize the subtree pointers */
1046 static int ett_bthci_evt;
1047 static int ett_opcode;
1048 static int ett_lmp_subtree;
1049 static int ett_ptype_subtree;
1050 static int ett_le_state_subtree;
1051 static int ett_le_channel_map;
1052 static int ett_le_features;
1053 static int ett_le_report;
1054 static int ett_codecs;
1055 static int ett_mws_transport_layers;
1056 static int ett_mws_transport_layers_item;
1057 static int ett_mws_to_mws_baud_rates;
1058 static int ett_mws_to_mws_baud_rates_transport_item;
1059 static int ett_mws_from_mws_baud_rates;
1060 static int ett_mws_from_mws_baud_rates_transport_item;
1061 static int ett_expert;
1062 static int ett_le_ext_advts_event_type;
1063 static int ett_iq_sample_list;
1064 static int ett_iq_samples;
1065 static int ett_simple_pairing_options;
1066 static int ett_supported_switching_sample_rates;
1067 static int ett_transmit_power_level_flags;
1068 static int ett_adv_subevent_responses;
1069 static int ett_cs_abort_reason;
1070 static int ett_cs_step;
1071 static int ett_packet_quality;
1072 static int ett_cs_tone;
1073 static int ett_cs_pct_sample;
1074 static int ett_cs_roles;
1075 static int ett_cs_modes;
1076 static int ett_cs_capability;
1077 static int ett_cs_times;
1078 static int ett_spacing_types;
1079 static int ett_phys;
1081 extern value_string_ext ext_usb_vendors_vals;
1082 extern value_string_ext ext_usb_products_vals;
1083 extern value_string_ext did_vendor_id_source_vals_ext;
1085 enum command_status {
1086 COMMAND_STATUS_NORMAL,
1087 COMMAND_STATUS_PENDING,
1088 COMMAND_STATUS_RESULT
1091 typedef struct _opcode_list_data_t {
1092 uint16_t opcode;
1093 enum command_status command_status;
1094 } opcode_list_data_t;
1096 static const value_string evt_code_vals[] = {
1097 {0x01, "Inquiry Complete"},
1098 {0x02, "Inquiry Result"},
1099 {0x03, "Connect Complete"},
1100 {0x04, "Connect Request"},
1101 {0x05, "Disconnect Complete"},
1102 {0x06, "Authentication Complete"},
1103 {0x07, "Remote Name Request Complete"},
1104 {0x08, "Encryption Change [v1]"},
1105 {0x09, "Change Connection Link Key Complete"},
1106 {0x0a, "Link Key Type Changed"},
1107 {0x0b, "Read Remote Supported Features"},
1108 {0x0c, "Read Remote Version Information Complete"},
1109 {0x0d, "QoS Setup Complete"},
1110 {0x0e, "Command Complete"},
1111 {0x0f, "Command Status"},
1112 {0x10, "Hardware Error"},
1113 {0x11, "Flush Occurred"},
1114 {0x12, "Role Change"},
1115 {0x13, "Number of Completed Packets"},
1116 {0x14, "Mode Change"},
1117 {0x15, "Return Link Keys"},
1118 {0x16, "PIN Code Request"},
1119 {0x17, "Link Key Request"},
1120 {0x18, "Link Key Notification"},
1121 {0x19, "Loopback Command"},
1122 {0x1a, "Data Buffer Overflow"},
1123 {0x1b, "Max Slots Change"},
1124 {0x1c, "Read Clock Offset Complete"},
1125 {0x1d, "Connection Packet Type Changed"},
1126 {0x1e, "QoS Violation"},
1127 {0x1f, "Page Scan Mode Change"},
1128 {0x20, "Page Scan Repetition Mode Change"},
1129 {0x21, "Flow Specification Complete"},
1130 {0x22, "Inquiry Result With RSSI"},
1131 {0x23, "Read Remote Extended Features Complete"},
1132 {0x2c, "Synchronous Connection Complete"},
1133 {0x2d, "Synchronous Connection Changed"},
1134 {0x2e, "Sniff Subrating"},
1135 {0x2f, "Extended Inquiry Result"},
1136 {0x30, "Encryption Key Refresh Complete"},
1137 {0x31, "IO Capability Request"},
1138 {0x32, "IO Capability Response"},
1139 {0x33, "User Confirmation Request"},
1140 {0x34, "User Passkey Request"},
1141 {0x35, "Remote OOB Data Request"},
1142 {0x36, "Simple Pairing Complete"},
1143 {0x38, "Link Supervision Timeout Changed"},
1144 {0x39, "Enhanced Flush Complete"},
1145 {0x3b, "User Passkey Notification"},
1146 {0x3c, "Keypress Notification"},
1147 {0x3d, "Remote Host Supported Features Notification"},
1148 {0x3e, "LE Meta"},
1149 {0x40, "Physical Link Complete"},
1150 {0x41, "Channel Selected"},
1151 {0x42, "Disconnect Physical Link Complete"},
1152 {0x43, "Physical Link Loss Early Warning"},
1153 {0x44, "Physical Link Recovery"},
1154 {0x45, "Logical Link Complete"},
1155 {0x46, "Disconnect Logical Link Complete"},
1156 {0x47, "Flow Spec Modify Complete"},
1157 {0x48, "Number Of Completed Data Blocks"},
1158 {0x49, "AMP Start Test"},
1159 {0x4a, "AMP Test End"},
1160 {0x4b, "AMP Receiver Report"},
1161 {0x4c, "Short Range Mode Change Complete"},
1162 {0x4d, "AMP Status Change"},
1163 /* From "Bluetooth Core Specification Addendum 4 */
1164 {0x4e, "Triggered Clock Capture"},
1165 {0x4f, "Synchronization Train Complete"},
1166 {0x50, "Synchronization Train Received"},
1167 {0x51, "Connectionless Peripheral Broadcast Receive"},
1168 {0x52, "Connectionless Peripheral Broadcast Timeout"},
1169 {0x53, "Truncated Page Complete"},
1170 {0x54, "Peripheral Page Response Timeout"},
1171 {0x55, "Connectionless Peripheral Broadcast Channel Map Change"},
1172 {0x56, "Inquiry Response Notification"},
1173 /* Core 4 */
1174 {0x57, "Authenticated Payload Timeout Expired"},
1175 /* Core 5 */
1176 {0x58, "SAM Status Change"},
1177 {0x59, "Encryption Change [v2]"},
1178 /* Other */
1179 /*{0xfe, "Bluetooth Logo Testing"}, // According to ESR05 it is not assigned */
1180 {0xff, "Vendor-Specific"},
1181 {0, NULL}
1183 value_string_ext bthci_evt_evt_code_vals_ext = VALUE_STRING_EXT_INIT(evt_code_vals);
1185 static const value_string bthci_cmd_status_pending_vals[] = {
1186 {0x00, "Pending"},
1187 {0, NULL }
1190 static const value_string evt_link_types[] = {
1191 {0x00, "SCO connection (Voice Channels)"},
1192 {0x01, "ACL connection (Data Channels)"},
1193 {0x02, "eSCO connection (Voice Channels)"},
1194 {0, NULL }
1197 static const value_string evt_sync_link_types[] = {
1198 {0x00, "SCO connection"},
1199 {0x02, "eSCO connection"},
1200 {0, NULL }
1203 static const value_string evt_encryption_modes[] = {
1204 {0x00, "Encryption Disabled"},
1205 {0x01, "Encryption only for point-to-point packets"},
1206 {0x02, "Encryption for both point-to-point and broadcast packets"},
1207 {0, NULL }
1210 static const value_string evt_encryption_enable[] = {
1211 {0x00, "Link Level Encryption is OFF"},
1212 {0x01, "Link Level Encryption is ON"},
1213 {0, NULL }
1216 static const value_string evt_key_flag[] = {
1217 {0x00, "Using Semi-permanent Link Key"},
1218 {0x01, "Using Temporary Link Key"},
1219 {0, NULL }
1222 /* Taken from https://www.bluetooth.org/Technical/AssignedNumbers/link_manager.htm */
1223 const value_string bthci_evt_lmp_version[] = {
1224 {0x00, "1.0b"},
1225 {0x01, "1.1"},
1226 {0x02, "1.2"},
1227 {0x03, "2.0 + EDR"},
1228 {0x04, "2.1 + EDR"},
1229 {0x05, "3.0 + HS"},
1230 {0x06, "4.0"},
1231 {0x07, "4.1"},
1232 {0x08, "4.2"},
1233 {0x09, "5.0"},
1234 {0x0a, "5.1"},
1235 {0x0b, "5.2"},
1236 {0x0c, "5.3"},
1237 {0x0d, "5.4"},
1238 {0x0e, "6.0"},
1239 {0, NULL }
1242 /* Taken from https://www.bluetooth.org/Technical/AssignedNumbers/hci.htm
1243 * (requires a login/password)
1245 const value_string bthci_evt_hci_version[] = {
1246 {0x00, "1.0b"},
1247 {0x01, "1.1"},
1248 {0x02, "1.2"},
1249 {0x03, "2.0 + EDR"},
1250 {0x04, "2.1 + EDR"},
1251 {0x05, "3.0 + HS"},
1252 {0x06, "4.0"},
1253 {0x07, "4.1"},
1254 {0x08, "4.2"},
1255 {0x09, "5.0"},
1256 {0x0a, "5.1"},
1257 {0x0b, "5.2"},
1258 {0x0c, "5.3"},
1259 {0x0d, "5.4"},
1260 {0x0e, "6.0"},
1261 {0, NULL }
1264 static const value_string evt_service_types[] = {
1265 {0x00, "No Traffic Available"},
1266 {0x01, "Best Effort Available"},
1267 {0x02, "Guaranteed Available"},
1268 {0, NULL }
1271 static const value_string evt_role_vals[] = {
1272 {0x00, "Currently the Central for specified BD_ADDR"},
1273 {0x01, "Currently the Peripheral for specified BD_ADDR"},
1274 {0, NULL }
1277 static const value_string evt_role_vals_handle[] = {
1278 {0x00, "Currently the Central for this connection handle"},
1279 {0x01, "Currently the Peripheral for this connection handle"},
1280 {0, NULL }
1283 static const value_string evt_modes[] = {
1284 {0x00, "Active Mode"},
1285 {0x01, "Hold Mode"},
1286 {0x02, "Sniff Mode"},
1287 {0x03, "Park Mode"},
1288 {0, NULL }
1291 static const value_string evt_key_types[] = {
1292 {0x00, "Combination Key"},
1293 {0x01, "Local Unit Key"},
1294 {0x02, "Remote Unit Key"},
1295 {0x03, "Debug Combination Key"},
1296 {0x04, "Unauthenticated Combination Key, P-192"},
1297 {0x05, "Authenticated Combination Key, P-192"},
1298 {0x06, "Changed Combination Key"},
1299 {0x07, "Unauthenticated Combination Key, P-256"},
1300 {0x08, "Authenticated Combination Key, P-256"},
1301 {0, NULL }
1304 static const value_string evt_scan_types[] = {
1305 {0x00, "Standard Scan" },
1306 {0x01, "Interlaced Scan" },
1307 {0, NULL }
1310 static const value_string evt_power_level_types[] = {
1311 {0x00, "Read Current Transmission Power Level" },
1312 {0x01, "Read Maximum Transmission Power Level" },
1313 {0, NULL }
1316 static const value_string evt_pin_types[] = {
1317 {0x00, "Variable PIN" },
1318 {0x01, "Fixed PIN" },
1319 {0, NULL }
1322 static const value_string evt_auth_enable_values[] = {
1323 {0x00, "Disabled" },
1324 {0x01, "Enabled for all connections "},
1325 {0, NULL }
1328 static const value_string evt_enable_values[] = {
1329 {0x00, "Disabled" },
1330 {0x01, "Enabled"},
1331 {0, NULL }
1334 static const value_string evt_loopback_modes[] = {
1335 {0x00, "No Loopback mode enabled" },
1336 {0x01, "Enable Local Loopback" },
1337 {0x02, "Enable Remote Loopback" },
1338 {0, NULL }
1341 static const value_string evt_country_code_values[] = {
1342 {0x0, "North America & Europe (except France) and Japan" },
1343 {0x1, "France" },
1344 {0, NULL }
1347 static const value_string evt_flow_direction_values[] = {
1348 {0x0, "Outgoing Traffic" },
1349 {0x1, "Incoming Traffic" },
1350 {0, NULL }
1353 static const value_string evt_flow_ctrl_mode[] = {
1354 { 0x00, "Packet based" },
1355 { 0x01, "Data Block based" },
1356 { 0, NULL }
1359 static const value_string evt_amp_status[] = {
1360 { 0x00, "Controller available but currently physically powered down" },
1361 { 0x01, "Controller available exclusively for Bluetooth" },
1362 { 0x02, "No capacity available for Bluetooth operation" },
1363 { 0x03, "Low capacity available for Bluetooth operation" },
1364 { 0x04, "Medium capacity available for Bluetooth operation" },
1365 { 0x05, "High capacity available for Bluetooth operation" },
1366 { 0x06, "Full capacity available for Bluetooth operation" },
1367 { 0, NULL }
1370 const value_string bthci_evt_controller_types[] = {
1371 { 0x00, "Primary BR/EDR" },
1372 { 0x01, "802.11 AMP" },
1373 { 0, NULL }
1376 static const value_string evt_link_loss_reasons[] = {
1377 { 0x00, "Unknown" },
1378 { 0x01, "Range related" },
1379 { 0x02, "Bandwidth related" },
1380 { 0x03, "Resolving Conflict" },
1381 { 0x04, "Interference" },
1382 { 0, NULL }
1385 static const value_string evt_report_reasons[] = {
1386 { 0x00, "Configured Interval" },
1387 { 0x01, "Test Ended" },
1388 { 0, NULL }
1391 static const value_string evt_report_event_types[] = {
1392 { 0x00, "Frames Received" },
1393 { 0x01, "Frames Received & Bits in Error" },
1394 { 0, NULL }
1397 static const value_string evt_le_meta_subevent[] = {
1398 { 0x01, "LE Connection Complete" },
1399 { 0x02, "LE Advertising Report" },
1400 { 0x03, "LE Connection Update Complete" },
1401 { 0x04, "LE Read Remote Features Complete" },
1402 { 0x05, "LE Long Term Key Request" },
1403 { 0x06, "LE Remote Connection Parameter Request" },
1404 { 0x07, "LE Data Length Change" },
1405 { 0x08, "LE Read Local P-256 Public Key Complete" },
1406 { 0x09, "LE Generate DHKey Complete" },
1407 { 0x0A, "LE Enhanced Connection Complete [v1]" },
1408 { 0x0B, "LE Direct Advertising Report" },
1409 { 0x0C, "LE PHY Update Complete" },
1410 { 0x0D, "LE Extended Advertising Report" },
1411 { 0x0E, "LE Periodic Advertising Sync Established [v1]" },
1412 { 0x0F, "LE Periodic Advertising Report [v1]" },
1413 { 0x10, "LE Periodic Advertising Sync Lost" },
1414 { 0x11, "LE Scan Timeout" },
1415 { 0x12, "LE Advertising Set Terminated" },
1416 { 0x13, "LE Scan Request Received" },
1417 { 0x14, "LE Channel Selection Algorithm" },
1418 { 0x15, "LE Connectionless IQ Report" },
1419 { 0x16, "LE Connection IQ Report" },
1420 { 0x17, "LE CTE Request Failed" },
1421 { 0x18, "LE Periodic Advertising Sync Transfer Received [v1]" },
1422 { 0x19, "LE CIS Established [v1]" },
1423 { 0x1A, "LE CIS Request" },
1424 { 0x1B, "LE Create BIG Complete" },
1425 { 0x1C, "LE Terminate BIG Complete" },
1426 { 0x1D, "LE BIG Sync Established" },
1427 { 0x1E, "LE BIG Sync Lost" },
1428 { 0x1F, "LE Request Peer SCA Complete" },
1429 { 0x20, "LE Path Loss Threshold" },
1430 { 0x21, "LE Transmit Power Reporting" },
1431 { 0x22, "LE BIGInfo Advertising Report" },
1432 { 0x23, "LE Subrate Change" },
1433 { 0x24, "LE Periodic Advertising Sync Established [v2]" },
1434 { 0x25, "LE Periodic Advertising Report [v2]" },
1435 { 0x26, "LE Periodic Advertising Sync Transfer Received [v2]" },
1436 { 0x27, "LE Periodic Advertising Subevent Data Request" },
1437 { 0x28, "LE Periodic Advertising Response Report" },
1438 { 0x29, "LE Enhanced Connection Complete [v2]" },
1439 { 0x2A, "LE CIS Established [v2]" },
1440 { 0x2B, "LE Read All Remote Features Complete" },
1441 { 0x2C, "LE CS Read Remote Supported Capabilities Complete" },
1442 { 0x2D, "LE CS Read Remote FAE Table Complete" },
1443 { 0x2E, "LE CS Security Enable Complete" },
1444 { 0x2F, "LE CS Config Complete" },
1445 { 0x30, "LE CS Procedure Enable Complete" },
1446 { 0x31, "LE CS Subevent Result" },
1447 { 0x32, "LE CS Subevent Result Continue" },
1448 { 0x33, "LE CS Test End Complete" },
1449 { 0x34, "LE Monitored Advertisers Report" },
1450 { 0x35, "LE Frame Space Update Complete" },
1451 { 0, NULL }
1454 static const value_string evt_le_advertising_evt_types[] = {
1455 { 0x00, "Connectable Undirected Advertising" },
1456 { 0x01, "Connectable Directed Advertising" },
1457 { 0x02, "Scannable Undirected Advertising" },
1458 { 0x03, "Non-Connectable Undirected Advertising" },
1459 { 0x04, "Scan Response" },
1460 { 0, NULL }
1463 static const value_string evt_air_mode_vals[] = {
1464 { 0x00, UTF8_MICRO_SIGN "-law log" },
1465 { 0x01, "A-law log" },
1466 { 0x02, "CVSD" },
1467 { 0x03, "Transparent Data" },
1468 { 0, NULL }
1471 const value_string bthci_evt_mws_transport_layer_vals[] = {
1472 { 0x00, "Disabled" },
1473 { 0x01, "WCI-1 Transport" },
1474 { 0x02, "WCI-2 Transport" },
1475 { 0, NULL }
1478 static const value_string which_clock_vals[] = {
1479 { 0x00, "Local Clock" },
1480 { 0x01, "Piconet Clock" },
1481 { 0, NULL }
1484 static const value_string receive_status_vals[] = {
1485 { 0x00, "Packet Received Successfully" },
1486 { 0x01, "Fragment, Data_Length or Data Fields Invalid" },
1487 { 0, NULL }
1490 static const value_string fragment_vals[] = {
1491 { 0x00, "Continuation" },
1492 { 0x01, "Start" },
1493 { 0x02, "End" },
1494 { 0x03, "No Fragmentation" },
1495 { 0, NULL }
1498 static const value_string event_type_vals[] = {
1499 { 0x01, "Connectable directed advertising (ADV_DIRECT_IND)" },
1500 { 0, NULL }
1503 const value_string bthci_evt_codec_id_vals[] = {
1504 { 0x00, "u-Law log" },
1505 { 0x01, "A-law log" },
1506 { 0x02, "CVSD" },
1507 { 0x03, "Transparent" },
1508 { 0x04, "Linear PCM" },
1509 { 0x05, "mSBC" },
1510 { 0x06, "LC3" },
1511 { 0x07, "G.729A" },
1512 { 0xFF, "Vendor Specific" },
1513 { 0, NULL }
1516 static const value_string ext_adv_data_status_vals[] = {
1517 {0x00, "Complete" },
1518 {0x01, "Incomplete, more to come"},
1519 {0x02, "Incomplete, truncated, no more to come"},
1520 {0x03, "Reserved"},
1521 {0, NULL }
1524 static const value_string bthci_evt_primary_phy_vals[] = {
1525 {0x01, "LE 1M"},
1526 {0x03, "LE Coded"},
1527 {0x04, "LE Coded, S=2"},
1528 {0, NULL }
1531 static const value_string bthci_evt_secondary_phy_vals[] = {
1532 {0x00, "No packets on the secondary advertising channel"},
1533 {0x01, "LE 1M"},
1534 {0x02, "LE 2M"},
1535 {0x03, "LE Coded"},
1536 {0x04, "LE Coded, S=2"},
1537 {0, NULL }
1540 static const value_string channel_selection_algo_vals[] = {
1541 { 0x00, "#1" },
1542 { 0x01, "#2" },
1543 { 0, NULL }
1546 static const value_string unique_sam_disabled[] = {
1547 { 0xFF, "SAM disabled, all slots available" },
1548 { 0, NULL }
1551 static const value_string packet_status_vals[] = {
1552 { 0x00, "CRC correct" },
1553 { 0x01, "CRC incorrect, Length and CTETime fields used to determine sampling points" },
1554 { 0x02, "CRC incorrect, position and length of the CTE determined in some other way" },
1555 { 0xFF, "Insufficient resources, Channel Index, CTE Type, and Slot Durations invalid" },
1556 { 0, NULL }
1559 static const value_string zone_entered_vals[] = {
1560 { 0x00, "Low" },
1561 { 0x01, "Medium" },
1562 { 0x02, "High" },
1563 { 0, NULL }
1566 static const value_string power_report_reason_vals[] = {
1567 { 0x00, "Local Transmit Power Changed" },
1568 { 0x01, "Remote Transmit Power Changed" },
1569 { 0x02, "Host Requested Read Command Completed" },
1570 { 0, NULL }
1573 static const unit_name_string units_number_events = { " (connection events)", NULL };
1575 static const value_string tx_status_vals[] = {
1576 {0x00, "Transmitted"},
1577 {0x01, "Not Transmitted"},
1578 {0, NULL }
1581 static const value_string cs_done_status_vals[] = {
1582 {0x0, "Completed"},
1583 {0x1, "Partial, more follows"},
1584 {0xf, "Aborted"},
1585 {0, NULL }
1588 static const value_string cs_procedure_abort_reason_vals[] = {
1589 {0x0, "-"},
1590 {0x1, "Host/Peer Requested"},
1591 {0x2, "<15 Channels"},
1592 {0x3, "Channel Map Instant Passed"},
1593 {0xf, "Unspecified"},
1594 {0, NULL }
1597 static const value_string cs_subevent_abort_reason_vals[] = {
1598 {0x0, "-"},
1599 {0x1, "Host/Peer Requested"},
1600 {0x2, "No Mode-0 Sync"},
1601 {0x3, "Scheduling Conflict/Limited Resources"},
1602 {0xf, "Unspecified"},
1603 {0, NULL }
1606 static const value_string cs_action_vals[] = {
1607 {0x0, "CS Configuration Removed"},
1608 {0x1, "CS Configuration Created"},
1609 {0, NULL }
1612 static const value_string uint8_no_handle[] = {
1613 {0xFF, "No Handle"},
1614 {0, NULL}
1617 static const value_string uint16_no_handle[] = {
1618 {0xFFFF, "No Handle"},
1619 {0, NULL}
1622 static const value_string access_address_check_vals[] = {
1623 {0x00, "Matching"},
1624 {0x01, "Contain bit errors"},
1625 {0x02, "Not Found"},
1626 {0, NULL}
1629 static const value_string nadm_attack_chance_vals[] = {
1630 {0x00, "Extremely Unlikely"},
1631 {0x01, "Very Unlikely"},
1632 {0x02, "Unlikely"},
1633 {0x03, "Possible"},
1634 {0x04, "Likely"},
1635 {0x05, "Very Likely"},
1636 {0x06, "Extremely Likely"},
1637 {0xff, "Unknown"},
1638 {0, NULL}
1641 static const value_string tone_quality_vals[] = {
1642 {0x0, "High"},
1643 {0x1, "Medium"},
1644 {0x2, "Low"},
1645 {0x3, "Unavailable"},
1646 {0, NULL}
1649 static const value_string tone_ext_presence_vals[] = {
1650 {0x0, "-"},
1651 {0x1, "Not Present"},
1652 {0x2, "Present"},
1653 {0, NULL}
1656 static const value_string monitoring_condition_vals[] = {
1657 {0x00, "RSSI below threshold for timeout period"},
1658 {0x01, "RSSI greater or equal threshold"},
1659 {0, NULL}
1662 static const value_string initiator_vals[] = {
1663 {0x00, "Local Host"},
1664 {0x01, "Local Controller"},
1665 {0x02, "Peer"},
1666 {0, NULL}
1669 static void freq_compensation(char *buf, int16_t value) {
1670 if (value != -16384)
1671 snprintf(buf, ITEM_LABEL_LENGTH, "%g ppm", 0.01 * value);
1672 else
1673 snprintf(buf, ITEM_LABEL_LENGTH, "Not Available");
1676 static void ref_power_level(char *buf, int8_t value) {
1677 if (value != 127)
1678 snprintf(buf, ITEM_LABEL_LENGTH, "%i dBm", value);
1679 else
1680 snprintf(buf, ITEM_LABEL_LENGTH, "Not Available");
1683 static void convert_time_unit_0p5_ns(char *buf, uint16_t value) {
1684 snprintf(buf, ITEM_LABEL_LENGTH, "%g ns (%u)", 0.5 * value, value);
1687 static void sint12_convert(char *buf, uint16_t value) {
1688 if (value > 0x800)
1689 snprintf(buf, ITEM_LABEL_LENGTH, "%i", (int16_t)(0xf000 + value));
1690 else
1691 snprintf(buf, ITEM_LABEL_LENGTH, "%i", value);
1694 void proto_register_bthci_evt(void);
1695 void proto_reg_handoff_bthci_evt(void);
1697 static void bthci_evt_vendor_prompt(packet_info *pinfo _U_, char* result)
1699 snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Vendor as");
1702 static void *bthci_evt_vendor_value(packet_info *pinfo _U_)
1704 return NULL;
1707 static void add_opcode(wmem_allocator_t *scope, wmem_list_t *opcode_list, uint16_t opcode, enum command_status command_status) {
1708 opcode_list_data_t *opcode_list_data;
1710 opcode_list_data = wmem_new(scope, opcode_list_data_t);
1711 if (opcode_list_data) {
1712 opcode_list_data->opcode = opcode;
1713 opcode_list_data->command_status = command_status;
1714 wmem_list_append(opcode_list, opcode_list_data);
1718 static void
1719 save_remote_device_name(tvbuff_t *tvb, int offset, packet_info *pinfo,
1720 uint8_t size, uint8_t *bd_addr, bluetooth_data_t *bluetooth_data)
1722 int i = 0;
1723 uint8_t length;
1724 wmem_tree_key_t key[6];
1725 uint32_t interface_id;
1726 uint32_t adapter_id;
1727 uint32_t bd_addr_oui;
1728 uint32_t bd_addr_id;
1729 uint32_t frame_number;
1730 char *name;
1731 device_name_t *device_name;
1733 if (!(!pinfo->fd->visited && bd_addr)) return;
1735 interface_id = bluetooth_data->interface_id;
1736 adapter_id = bluetooth_data->adapter_id;
1738 while (i < size) {
1739 length = tvb_get_uint8(tvb, offset + i);
1740 if (length == 0) break;
1742 switch(tvb_get_uint8(tvb, offset + i + 1)) {
1743 case 0x08: /* Device Name, shortened */
1744 case 0x09: /* Device Name, full */
1745 name = tvb_get_string_enc(pinfo->pool, tvb, offset + i + 2, length - 1, ENC_UTF_8);
1747 frame_number = pinfo->num;
1748 bd_addr_oui = bd_addr[0] << 16 | bd_addr[1] << 8 | bd_addr[2];
1749 bd_addr_id = bd_addr[3] << 16 | bd_addr[4] << 8 | bd_addr[5];
1751 key[0].length = 1;
1752 key[0].key = &interface_id;
1753 key[1].length = 1;
1754 key[1].key = &adapter_id;
1755 key[2].length = 1;
1756 key[2].key = &bd_addr_id;
1757 key[3].length = 1;
1758 key[3].key = &bd_addr_oui;
1759 key[4].length = 1;
1760 key[4].key = &frame_number;
1761 key[5].length = 0;
1762 key[5].key = NULL;
1764 device_name = (device_name_t *) wmem_new(wmem_file_scope(), device_name_t);
1765 device_name->bd_addr_oui = bd_addr[0] << 16 | bd_addr[1] << 8 | bd_addr[2];
1766 device_name->bd_addr_id = bd_addr[3] << 16 | bd_addr[4] << 8 | bd_addr[5];
1767 device_name->name = wmem_strdup(wmem_file_scope(), name);
1769 wmem_tree_insert32_array(bluetooth_data->bdaddr_to_name, key, device_name);
1771 break;
1774 i += length + 1;
1778 static void send_hci_summary_status_tap(uint8_t status, packet_info *pinfo, bluetooth_data_t *bluetooth_data)
1780 if (have_tap_listener(bluetooth_hci_summary_tap)) {
1781 bluetooth_hci_summary_tap_t *tap_hci_summary;
1783 tap_hci_summary = wmem_new(pinfo->pool, bluetooth_hci_summary_tap_t);
1785 tap_hci_summary->interface_id = bluetooth_data->interface_id;
1786 tap_hci_summary->adapter_id = bluetooth_data->adapter_id;
1788 tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_STATUS;
1789 tap_hci_summary->status = status;
1790 if (try_val_to_str_ext(status, &bthci_cmd_status_vals_ext))
1791 tap_hci_summary->name = val_to_str_ext(status, &bthci_cmd_status_vals_ext, "Unknown 0x%02x");
1792 else
1793 tap_hci_summary->name = NULL;
1794 tap_queue_packet(bluetooth_hci_summary_tap, pinfo, tap_hci_summary);
1798 static void send_hci_summary_pending_tap(packet_info *pinfo, bluetooth_data_t *bluetooth_data)
1800 if (have_tap_listener(bluetooth_hci_summary_tap)) {
1801 bluetooth_hci_summary_tap_t *tap_hci_summary;
1803 tap_hci_summary = wmem_new(pinfo->pool, bluetooth_hci_summary_tap_t);
1805 tap_hci_summary->interface_id = bluetooth_data->interface_id;
1806 tap_hci_summary->adapter_id = bluetooth_data->adapter_id;
1808 tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_STATUS_PENDING;
1809 tap_hci_summary->status = 0;
1810 tap_hci_summary->name = "Pending";
1811 tap_queue_packet(bluetooth_hci_summary_tap, pinfo, tap_hci_summary);
1815 static void send_hci_summary_reason_tap(uint8_t reason, packet_info *pinfo, bluetooth_data_t *bluetooth_data)
1817 if (have_tap_listener(bluetooth_hci_summary_tap)) {
1818 bluetooth_hci_summary_tap_t *tap_hci_summary;
1820 tap_hci_summary = wmem_new(pinfo->pool, bluetooth_hci_summary_tap_t);
1822 tap_hci_summary->interface_id = bluetooth_data->interface_id;
1823 tap_hci_summary->adapter_id = bluetooth_data->adapter_id;
1825 tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_REASON;
1826 tap_hci_summary->reason = reason;
1827 if (try_val_to_str_ext(reason, &bthci_cmd_status_vals_ext))
1828 tap_hci_summary->name = val_to_str_ext(reason, &bthci_cmd_status_vals_ext, "Unknown 0x%02x");
1829 else
1830 tap_hci_summary->name = NULL;
1831 tap_queue_packet(bluetooth_hci_summary_tap, pinfo, tap_hci_summary);
1835 static int
1836 dissect_iq_sample_list(tvbuff_t *tvb, int offset, proto_tree *tree)
1838 uint8_t samples;
1840 proto_tree_add_item(tree, hf_bthci_evt_sample_count, tvb, offset, 1, ENC_NA);
1841 samples = tvb_get_uint8(tvb, offset);
1842 offset += 1;
1844 if (samples > 0) {
1845 uint8_t i;
1846 proto_item *sub_item;
1847 proto_tree *sub_tree;
1849 sub_item = proto_tree_add_none_format(tree, hf_bthci_evt_le_report, tvb, offset, 2 * samples, "IQ Samples");
1850 sub_tree = proto_item_add_subtree(sub_item, ett_iq_sample_list);
1852 for (i = 0; i < samples; i++) {
1853 proto_item *sample_item;
1854 proto_tree *sample_tree;
1856 sample_item = proto_tree_add_none_format(sub_tree, hf_bthci_evt_le_report, tvb, offset, 2, "Sample %2d, I:%4d, Q:%4d",
1857 i, tvb_get_int8(tvb, offset), tvb_get_int8(tvb, offset+1));
1858 sample_tree = proto_item_add_subtree(sample_item, ett_iq_samples);
1860 proto_tree_add_item(sample_tree, hf_bthci_evt_i_sample, tvb, offset, 1, ENC_NA);
1861 offset += 1;
1862 proto_tree_add_item(sample_tree, hf_bthci_evt_q_sample, tvb, offset, 1, ENC_NA);
1863 offset += 1;
1866 return offset;
1870 static int
1871 dissect_bthci_evt_inquire_complete(tvbuff_t *tvb, int offset, packet_info *pinfo,
1872 proto_tree *tree, bluetooth_data_t *bluetooth_data)
1874 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1875 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
1876 offset += 1;
1878 return offset;
1881 static int
1882 dissect_bthci_evt_connect_complete(tvbuff_t *tvb, int offset, packet_info *pinfo,
1883 proto_tree *tree, bluetooth_data_t *bluetooth_data)
1885 uint32_t connection_handle;
1886 uint8_t bd_addr[6];
1887 uint8_t status;
1889 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1890 status = tvb_get_uint8(tvb, offset);
1891 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
1892 offset += 1;
1894 connection_handle = tvb_get_letohs(tvb, offset) & 0x0FFF;
1895 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1896 offset += 2;
1898 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, bd_addr);
1899 if (!pinfo->fd->visited && status == STATUS_SUCCESS) {
1900 wmem_tree_key_t key[5];
1901 uint32_t k_interface_id;
1902 uint32_t k_adapter_id;
1903 uint32_t k_connection_handle;
1904 uint32_t k_frame_number;
1905 remote_bdaddr_t *remote_bdaddr;
1906 chandle_session_t *chandle_session;
1907 connection_mode_t *connection_mode;
1909 k_interface_id = bluetooth_data->interface_id;
1910 k_adapter_id = bluetooth_data->adapter_id;
1911 k_connection_handle = connection_handle;
1912 k_frame_number = pinfo->num;
1914 key[0].length = 1;
1915 key[0].key = &k_interface_id;
1916 key[1].length = 1;
1917 key[1].key = &k_adapter_id;
1918 key[2].length = 1;
1919 key[2].key = &k_connection_handle;
1920 key[3].length = 1;
1921 key[3].key = &k_frame_number;
1922 key[4].length = 0;
1923 key[4].key = NULL;
1925 remote_bdaddr = (remote_bdaddr_t *) wmem_new(wmem_file_scope(), remote_bdaddr_t);
1926 remote_bdaddr->interface_id = bluetooth_data->interface_id;
1927 remote_bdaddr->adapter_id = bluetooth_data->adapter_id;
1928 remote_bdaddr->chandle = connection_handle;
1929 memcpy(remote_bdaddr->bd_addr, bd_addr, 6);
1931 wmem_tree_insert32_array(bluetooth_data->chandle_to_bdaddr, key, remote_bdaddr);
1933 chandle_session = (chandle_session_t *) wmem_new(wmem_file_scope(), chandle_session_t);
1934 chandle_session->connect_in_frame = k_frame_number;
1935 chandle_session->disconnect_in_frame = bluetooth_max_disconnect_in_frame;
1936 chandle_session->link_type = BT_LINK_TYPE_ACL;
1937 wmem_tree_insert32_array(bluetooth_data->chandle_sessions, key, chandle_session);
1939 connection_mode = (connection_mode_t *) wmem_new(wmem_file_scope(), connection_mode_t);
1940 connection_mode->mode = 0;
1941 connection_mode->change_in_frame = k_frame_number;
1943 wmem_tree_insert32_array(bluetooth_data->chandle_to_mode, key, connection_mode);
1946 proto_tree_add_item(tree, hf_bthci_evt_link_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1947 offset += 1;
1949 proto_tree_add_item(tree, hf_bthci_evt_encryption_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1950 offset += 1;
1952 return offset;
1955 static int
1956 dissect_bthci_evt_connect_request(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
1958 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
1960 call_dissector(btcommon_cod_handle, tvb_new_subset_length(tvb, offset, 3), pinfo, tree);
1961 offset += 3;
1963 proto_tree_add_item(tree, hf_bthci_evt_link_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1964 offset += 1;
1966 return offset;
1969 static int
1970 dissect_bthci_evt_disconnect_complete(tvbuff_t *tvb, int offset, packet_info *pinfo,
1971 proto_tree *tree, bluetooth_data_t *bluetooth_data)
1973 uint32_t connection_handle;
1974 uint8_t status;
1976 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1977 status = tvb_get_uint8(tvb, offset);
1978 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
1979 offset += 1;
1981 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1982 connection_handle = tvb_get_letohs(tvb, offset) & 0x0FFF;
1983 offset += 2;
1985 proto_tree_add_item(tree, hf_bthci_evt_reason, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1986 send_hci_summary_reason_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
1987 offset += 1;
1989 if (!pinfo->fd->visited && status == STATUS_SUCCESS) {
1990 wmem_tree_key_t key[4];
1991 uint32_t interface_id;
1992 uint32_t adapter_id;
1993 chandle_session_t *chandle_session;
1994 wmem_tree_t *subtree;
1996 interface_id = bluetooth_data->interface_id;
1997 adapter_id = bluetooth_data->adapter_id;
1999 key[0].length = 1;
2000 key[0].key = &interface_id;
2001 key[1].length = 1;
2002 key[1].key = &adapter_id;
2003 key[2].length = 1;
2004 key[2].key = &connection_handle;
2005 key[3].length = 0;
2006 key[3].key = NULL;
2008 subtree = (wmem_tree_t *) wmem_tree_lookup32_array(bluetooth_data->chandle_sessions, key);
2009 chandle_session = (subtree) ? (chandle_session_t *) wmem_tree_lookup32_le(subtree, pinfo->num) : NULL;
2010 if (chandle_session && chandle_session->connect_in_frame < pinfo->num)
2011 chandle_session->disconnect_in_frame = pinfo->num;
2014 return offset;
2017 static int
2018 dissect_bthci_evt_auth_complete(tvbuff_t *tvb, int offset, packet_info *pinfo,
2019 proto_tree *tree, bluetooth_data_t *bluetooth_data)
2021 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2022 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
2023 offset += 1;
2025 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2026 offset += 2;
2028 return offset;
2031 static int
2032 dissect_bthci_evt_lmp_features(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, uint8_t page_numer)
2034 uint8_t fc_lag;
2035 proto_item *fl_lag_item;
2036 proto_tree *lmp_tree = NULL;
2038 if (tree) {
2039 proto_item *lmp_item;
2041 lmp_item = proto_tree_add_item(tree, hf_lmp_features, tvb, offset, 8, ENC_NA);
2042 lmp_tree = proto_item_add_subtree(lmp_item, ett_lmp_subtree);
2045 switch (page_numer) {
2046 case 0:
2047 proto_tree_add_item(lmp_tree, hf_lmp_feature_3slot_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2048 proto_tree_add_item(lmp_tree, hf_lmp_feature_5slot_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2049 proto_tree_add_item(lmp_tree, hf_lmp_feature_encryption, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2050 proto_tree_add_item(lmp_tree, hf_lmp_feature_slot_offset, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2051 proto_tree_add_item(lmp_tree, hf_lmp_feature_timing_accuracy, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2052 proto_tree_add_item(lmp_tree, hf_lmp_feature_role_switch, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2053 proto_tree_add_item(lmp_tree, hf_lmp_feature_hold_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2054 proto_tree_add_item(lmp_tree, hf_lmp_feature_sniff_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2055 offset += 1;
2057 proto_tree_add_item(lmp_tree, hf_lmp_feature_park_state, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2058 proto_tree_add_item(lmp_tree, hf_lmp_feature_power_control_requests, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2059 proto_tree_add_item(lmp_tree, hf_lmp_feature_channel_quality_driven_data_rate, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2060 proto_tree_add_item(lmp_tree, hf_lmp_feature_sco_link, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2061 proto_tree_add_item(lmp_tree, hf_lmp_feature_hv2_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2062 proto_tree_add_item(lmp_tree, hf_lmp_feature_hv3_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2063 proto_tree_add_item(lmp_tree, hf_lmp_feature_u_law_log_synchronous_data, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2064 proto_tree_add_item(lmp_tree, hf_lmp_feature_a_law_log_synchronous_data, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2065 offset += 1;
2067 proto_tree_add_item(lmp_tree, hf_lmp_feature_cvsd_synchronous_data, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2068 proto_tree_add_item(lmp_tree, hf_lmp_feature_paging_parameter_negotiation, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2069 proto_tree_add_item(lmp_tree, hf_lmp_feature_power_control, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2070 proto_tree_add_item(lmp_tree, hf_lmp_feature_transparent_synchronous_data, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2071 fl_lag_item = proto_tree_add_item(lmp_tree,hf_lmp_feature_flow_control_lag, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2072 fc_lag = (tvb_get_uint8(tvb, offset) & 0x70) >> 4;
2073 proto_item_append_text(fl_lag_item, " (%i bytes)", 256 * fc_lag);
2075 proto_tree_add_item(lmp_tree,hf_lmp_feature_broadcast_encryption, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2076 offset += 1;
2078 proto_tree_add_item(lmp_tree, hf_lmp_feature_reserved_24, tvb, offset, 1, ENC_NA);
2079 proto_tree_add_item(lmp_tree, hf_lmp_feature_edr_acl_2mbps_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2080 proto_tree_add_item(lmp_tree, hf_lmp_feature_edr_acl_3mbps_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2081 proto_tree_add_item(lmp_tree, hf_lmp_feature_enhanced_inquiry_scan, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2082 proto_tree_add_item(lmp_tree, hf_lmp_feature_interlaced_inquiry_scan, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2083 proto_tree_add_item(lmp_tree, hf_lmp_feature_interlaced_page_scan, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2084 proto_tree_add_item(lmp_tree, hf_lmp_feature_rssi_with_inquiry_results, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2085 proto_tree_add_item(lmp_tree, hf_lmp_feature_ev3_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2086 offset += 1;
2088 proto_tree_add_item(lmp_tree, hf_lmp_feature_ev4_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2089 proto_tree_add_item(lmp_tree, hf_lmp_feature_ev5_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2090 proto_tree_add_item(lmp_tree, hf_lmp_feature_reserved_34, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2091 proto_tree_add_item(lmp_tree, hf_lmp_feature_afh_capable_peripheral, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2092 proto_tree_add_item(lmp_tree, hf_lmp_feature_afh_classification_peripheral, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2093 proto_tree_add_item(lmp_tree, hf_lmp_feature_br_edr_not_supported, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2094 proto_tree_add_item(lmp_tree, hf_lmp_feature_le_supported_controller, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2095 proto_tree_add_item(lmp_tree, hf_lmp_feature_3slot_edr_acl_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2096 offset += 1;
2098 proto_tree_add_item(lmp_tree, hf_lmp_feature_5slot_edr_acl_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2099 proto_tree_add_item(lmp_tree, hf_lmp_feature_sniff_subrating, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2100 proto_tree_add_item(lmp_tree, hf_lmp_feature_pause_encryption, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2101 proto_tree_add_item(lmp_tree, hf_lmp_feature_afh_capable_central, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2102 proto_tree_add_item(lmp_tree, hf_lmp_feature_afh_classification_central, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2103 proto_tree_add_item(lmp_tree, hf_lmp_feature_edr_esco_2mbps_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2104 proto_tree_add_item(lmp_tree, hf_lmp_feature_edr_esco_3mbps_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2105 proto_tree_add_item(lmp_tree, hf_lmp_feature_3slot_edr_esco_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2106 offset += 1;
2108 proto_tree_add_item(lmp_tree, hf_lmp_feature_extended_inquiry_response, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2109 proto_tree_add_item(lmp_tree, hf_lmp_feature_simultaneous_le_and_br_edr_controller, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2110 proto_tree_add_item(lmp_tree, hf_lmp_feature_reserved_50, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2111 proto_tree_add_item(lmp_tree, hf_lmp_feature_secure_simple_pairing, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2112 proto_tree_add_item(lmp_tree, hf_lmp_feature_encapsulated_pdu, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2113 proto_tree_add_item(lmp_tree, hf_lmp_feature_erroneous_data_reporting, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2114 proto_tree_add_item(lmp_tree, hf_lmp_feature_non_flushable_packet_boundary_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2115 proto_tree_add_item(lmp_tree, hf_lmp_feature_reserved_55, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2116 offset += 1;
2118 proto_tree_add_item(lmp_tree, hf_lmp_feature_link_supervision_timeout_changed_event, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2119 proto_tree_add_item(lmp_tree, hf_lmp_feature_inquiry_tx_power_level, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2120 proto_tree_add_item(lmp_tree, hf_lmp_feature_enhanced_power_control, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2121 proto_tree_add_item(lmp_tree, hf_lmp_feature_reserved_59_62, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2122 proto_tree_add_item(lmp_tree, hf_lmp_feature_extended_features, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2123 offset += 1;
2125 break;
2126 case 1:
2127 proto_tree_add_item(lmp_tree, hf_lmp_feature_secure_simple_pairing_host, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2128 proto_tree_add_item(lmp_tree, hf_lmp_feature_le_supported_host, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2129 proto_tree_add_item(lmp_tree, hf_lmp_feature_simultaneous_le_and_br_edr_host, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2130 proto_tree_add_item(lmp_tree, hf_lmp_feature_secure_connections_host, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2131 proto_tree_add_item(lmp_tree, hf_lmp_feature_reserved_68_71, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2132 offset += 1;
2134 proto_tree_add_item(lmp_tree, hf_lmp_feature_reserved, tvb, offset, 7, ENC_NA);
2135 offset += 7;
2137 break;
2138 case 2:
2139 proto_tree_add_item(lmp_tree, hf_lmp_feature_cpb_central_operation, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2140 proto_tree_add_item(lmp_tree, hf_lmp_feature_cpb_peripheral_operation, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2141 proto_tree_add_item(lmp_tree, hf_lmp_feature_synchronization_train, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2142 proto_tree_add_item(lmp_tree, hf_lmp_feature_synchronization_scan, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2143 proto_tree_add_item(lmp_tree, hf_lmp_feature_inquiry_response_notification_event, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2144 proto_tree_add_item(lmp_tree, hf_lmp_feature_generalized_interlaced_scan, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2145 proto_tree_add_item(lmp_tree, hf_lmp_feature_coarse_clock_adjustment, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2146 proto_tree_add_item(lmp_tree, hf_lmp_feature_reserved_135, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2147 offset += 1;
2149 proto_tree_add_item(lmp_tree, hf_lmp_feature_secure_connections_controller, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2150 proto_tree_add_item(lmp_tree, hf_lmp_feature_ping, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2151 proto_tree_add_item(lmp_tree, hf_lmp_feature_reserved_138, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2152 proto_tree_add_item(lmp_tree, hf_lmp_feature_train_nudging, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2153 proto_tree_add_item(lmp_tree, hf_lmp_feature_slot_availability_mask, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2154 offset += 1;
2156 proto_tree_add_item(lmp_tree, hf_lmp_feature_reserved, tvb, offset, 6, ENC_NA);
2157 offset += 6;
2159 break;
2160 default:
2161 proto_tree_add_item(lmp_tree, hf_lmp_feature_reserved, tvb, offset, 8, ENC_NA);
2162 offset += 8;
2165 return offset;
2168 static int
2169 dissect_bthci_evt_pin_code_request(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
2171 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
2173 return offset;
2176 static int
2177 dissect_bthci_evt_link_key_request(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
2179 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
2181 return offset;
2184 static int
2185 dissect_bthci_evt_link_key_notification(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
2187 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
2189 proto_tree_add_item(tree, hf_bthci_evt_link_key, tvb, offset, 16, ENC_NA);
2190 offset += 16;
2192 proto_tree_add_item(tree, hf_bthci_evt_key_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2193 offset += 1;
2195 return offset;
2198 static int
2199 dissect_bthci_evt_return_link_keys(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
2201 uint8_t evt_num_keys;
2203 evt_num_keys = tvb_get_uint8(tvb, offset);
2204 proto_tree_add_item(tree, hf_bthci_evt_num_keys, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2205 offset += 1;
2207 while (evt_num_keys--) {
2208 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
2210 proto_tree_add_item(tree, hf_bthci_evt_link_key, tvb, offset, 16, ENC_NA);
2211 offset += 16;
2215 return offset;
2218 static int
2219 dissect_bthci_evt_read_remote_support_features_complete(tvbuff_t *tvb, int offset,
2220 packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
2222 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2223 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
2224 offset += 1;
2226 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2227 offset += 2;
2229 offset = dissect_bthci_evt_lmp_features(tvb, offset, pinfo, tree, 0);
2231 return offset;
2234 static int
2235 dissect_bthci_evt_remote_name_req_complete(tvbuff_t *tvb, int offset,
2236 packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
2238 uint8_t bd_addr[6];
2240 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2241 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
2242 offset += 1;
2244 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, bd_addr);
2246 proto_tree_add_item(tree, hf_bthci_evt_remote_name, tvb, offset, 248, ENC_UTF_8);
2247 if (!pinfo->fd->visited) {
2248 wmem_tree_key_t key[6];
2249 uint32_t interface_id;
2250 uint32_t adapter_id;
2251 uint32_t bd_addr_oui;
2252 uint32_t bd_addr_id;
2253 uint32_t frame_number;
2254 char *name;
2255 device_name_t *device_name;
2257 name = tvb_get_string_enc(wmem_file_scope(), tvb, offset, 248, ENC_UTF_8);
2258 interface_id = bluetooth_data->interface_id;
2259 adapter_id = bluetooth_data->adapter_id;
2260 frame_number = pinfo->num;
2261 bd_addr_oui = bd_addr[0] << 16 | bd_addr[1] << 8 | bd_addr[2];
2262 bd_addr_id = bd_addr[3] << 16 | bd_addr[4] << 8 | bd_addr[5];
2264 key[0].length = 1;
2265 key[0].key = &interface_id;
2266 key[1].length = 1;
2267 key[1].key = &adapter_id;
2268 key[2].length = 1;
2269 key[2].key = &bd_addr_id;
2270 key[3].length = 1;
2271 key[3].key = &bd_addr_oui;
2272 key[4].length = 1;
2273 key[4].key = &frame_number;
2274 key[5].length = 0;
2275 key[5].key = NULL;
2277 device_name = (device_name_t *) wmem_new(wmem_file_scope(), device_name_t);
2278 device_name->bd_addr_oui = bd_addr[0] << 16 | bd_addr[1] << 8 | bd_addr[2];
2279 device_name->bd_addr_id = bd_addr[3] << 16 | bd_addr[4] << 8 | bd_addr[5];
2280 device_name->name = name;
2282 wmem_tree_insert32_array(bluetooth_data->bdaddr_to_name, key, device_name);
2285 if (have_tap_listener(bluetooth_device_tap)) {
2286 bluetooth_device_tap_t *tap_device;
2288 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
2289 tap_device->interface_id = bluetooth_data->interface_id;
2290 tap_device->adapter_id = bluetooth_data->adapter_id;
2291 memcpy(tap_device->bd_addr, bd_addr, 6);
2292 tap_device->has_bd_addr = true;
2293 tap_device->is_local = false;
2294 tap_device->type = BLUETOOTH_DEVICE_NAME;
2295 tap_device->data.name = tvb_get_string_enc(pinfo->pool, tvb, offset, 248, ENC_UTF_8);
2296 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
2299 offset += 248;
2301 return offset;
2304 static int
2305 dissect_bthci_evt_read_remote_version_information_complete(tvbuff_t *tvb, int offset,
2306 packet_info *pinfo, bluetooth_data_t *bluetooth_data, proto_tree *tree)
2308 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2309 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
2310 offset += 1;
2312 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2313 offset += 2;
2315 proto_tree_add_item(tree, hf_bthci_evt_vers_nr, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2316 offset += 1;
2318 proto_tree_add_item(tree, hf_bthci_evt_comp_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2319 offset += 2;
2321 proto_tree_add_item(tree, hf_bthci_evt_sub_vers_nr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2322 offset += 2;
2324 if (have_tap_listener(bluetooth_device_tap)) {
2325 wmem_tree_t *subtree;
2326 wmem_tree_key_t key[4];
2327 uint32_t interface_id;
2328 uint32_t adapter_id;
2329 uint32_t connection_handle;
2330 remote_bdaddr_t *remote_bdaddr;
2331 bluetooth_device_tap_t *tap_device;
2332 uint8_t lmp_version;
2333 uint16_t lmp_subversion;
2334 uint16_t manufacturer;
2336 lmp_version = tvb_get_uint8(tvb, offset - 5);
2337 manufacturer = tvb_get_letohs(tvb, offset - 4);
2338 lmp_subversion = tvb_get_letohs(tvb, offset - 2);
2340 interface_id = bluetooth_data->interface_id;
2341 adapter_id = bluetooth_data->adapter_id;
2342 connection_handle = tvb_get_uint16(tvb, offset - 7, ENC_LITTLE_ENDIAN) & 0x0fff;
2344 key[0].length = 1;
2345 key[0].key = &interface_id;
2346 key[1].length = 1;
2347 key[1].key = &adapter_id;
2348 key[2].length = 1;
2349 key[2].key = &connection_handle;
2350 key[3].length = 0;
2351 key[3].key = NULL;
2353 subtree = (wmem_tree_t *) wmem_tree_lookup32_array(bluetooth_data->chandle_to_bdaddr, key);
2354 remote_bdaddr = (subtree) ? (remote_bdaddr_t *) wmem_tree_lookup32_le(subtree, pinfo->num) : NULL;
2356 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
2357 tap_device->type = BLUETOOTH_DEVICE_REMOTE_VERSION;
2358 tap_device->interface_id = bluetooth_data->interface_id;
2359 tap_device->adapter_id = bluetooth_data->adapter_id;
2361 if (remote_bdaddr) {
2362 tap_device->has_bd_addr = true;
2363 memcpy(tap_device->bd_addr, remote_bdaddr->bd_addr, 6);
2364 } else {
2365 tap_device->has_bd_addr = false;
2367 tap_device->is_local = false;
2368 tap_device->data.remote_version.lmp_version = lmp_version;
2369 tap_device->data.remote_version.lmp_subversion = lmp_subversion;
2370 tap_device->data.remote_version.manufacturer = manufacturer;
2371 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
2374 return offset;
2377 static int
2378 dissect_bthci_evt_flush_occurred(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2380 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2381 offset += 2;
2383 return offset;
2386 static int
2387 dissect_bthci_evt_number_of_completed_packets(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2389 uint8_t evt_num_handles;
2391 evt_num_handles = tvb_get_uint8(tvb, offset);
2392 proto_tree_add_item(tree, hf_bthci_evt_num_handles, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2393 offset += 1;
2395 while (evt_num_handles--) {
2396 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2397 offset += 2;
2399 proto_tree_add_item(tree, hf_bthci_evt_num_compl_packets, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2400 offset += 2;
2404 return offset;
2407 static int
2408 dissect_bthci_evt_mode_change(tvbuff_t *tvb, int offset, packet_info *pinfo,
2409 proto_tree *tree, bluetooth_data_t *bluetooth_data)
2411 uint32_t connection_handle;
2412 uint8_t mode;
2413 uint8_t status;
2415 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2416 status = tvb_get_uint8(tvb, offset);
2417 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
2418 offset += 1;
2420 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2421 connection_handle = tvb_get_letohs(tvb, offset) & 0x0FFF;
2422 offset += 2;
2424 proto_tree_add_item(tree, hf_bthci_evt_curr_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2425 mode = tvb_get_uint8(tvb, offset);
2426 offset += 1;
2428 proto_tree_add_item(tree, hf_bthci_evt_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2429 offset += 2;
2431 if (!pinfo->fd->visited && status == STATUS_SUCCESS) {
2432 wmem_tree_key_t key[5];
2433 uint32_t interface_id;
2434 uint32_t adapter_id;
2435 uint32_t frame_number;
2436 connection_mode_t *connection_mode;
2438 interface_id = bluetooth_data->interface_id;
2439 adapter_id = bluetooth_data->adapter_id;
2440 frame_number = pinfo->num;
2442 key[0].length = 1;
2443 key[0].key = &interface_id;
2444 key[1].length = 1;
2445 key[1].key = &adapter_id;
2446 key[2].length = 1;
2447 key[2].key = &connection_handle;
2448 key[3].length = 1;
2449 key[3].key = &frame_number;
2450 key[4].length = 0;
2451 key[4].key = NULL;
2453 connection_mode = (connection_mode_t *) wmem_new(wmem_file_scope(), connection_mode_t);
2454 connection_mode->mode = mode;
2455 connection_mode->change_in_frame = frame_number;
2457 wmem_tree_insert32_array(bluetooth_data->chandle_to_mode, key, connection_mode);
2460 return offset;
2463 static int
2464 dissect_bthci_evt_role_change(tvbuff_t *tvb, int offset, packet_info *pinfo,
2465 proto_tree *tree, bluetooth_data_t *bluetooth_data)
2467 uint8_t bd_addr[6];
2468 uint8_t role;
2469 uint8_t status;
2471 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2472 status = tvb_get_uint8(tvb, offset);
2473 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
2474 offset += 1;
2476 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, bd_addr);
2478 proto_tree_add_item(tree, hf_bthci_evt_role, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2479 role = tvb_get_uint8(tvb, offset);
2480 offset += 1;
2482 if (!pinfo->fd->visited && status == STATUS_SUCCESS) {
2483 uint32_t interface_id;
2484 uint32_t adapter_id;
2485 uint32_t bd_addr_oui;
2486 uint32_t bd_addr_id;
2487 uint32_t frame_number;
2488 wmem_tree_key_t key[6];
2489 device_role_t *device_role;
2491 interface_id = bluetooth_data->interface_id;
2492 adapter_id = bluetooth_data->adapter_id;
2493 frame_number = pinfo->num;
2494 bd_addr_oui = bd_addr[0] << 16 | bd_addr[1] << 8 | bd_addr[2];
2495 bd_addr_id = bd_addr[3] << 16 | bd_addr[4] << 8 | bd_addr[5];
2497 key[0].length = 1;
2498 key[0].key = &interface_id;
2499 key[1].length = 1;
2500 key[1].key = &adapter_id;
2501 key[2].length = 1;
2502 key[2].key = &bd_addr_id;
2503 key[3].length = 1;
2504 key[3].key = &bd_addr_oui;
2505 key[4].length = 1;
2506 key[4].key = &frame_number;
2507 key[5].length = 0;
2508 key[5].key = NULL;
2510 device_role = (device_role_t *) wmem_new(wmem_file_scope(), device_role_t);
2511 device_role->change_in_frame = frame_number;
2512 if (role == 0)
2513 device_role->role = ROLE_PERIPHERAL;
2514 else if (role == 1)
2515 device_role->role = ROLE_CENTRAL;
2516 else
2517 device_role->role = ROLE_UNKNOWN;
2519 wmem_tree_insert32_array(bluetooth_data->bdaddr_to_role, key, device_role);
2522 return offset;
2525 static int
2526 dissect_bthci_evt_hardware_error(tvbuff_t *tvb, int offset, packet_info *pinfo,
2527 proto_tree *tree, bluetooth_data_t *bluetooth_data)
2529 proto_tree_add_item(tree, hf_bthci_evt_hardware_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2530 offset += 1;
2532 if (have_tap_listener(bluetooth_hci_summary_tap)) {
2533 bluetooth_hci_summary_tap_t *tap_hci_summary;
2535 tap_hci_summary = wmem_new(pinfo->pool, bluetooth_hci_summary_tap_t);
2537 tap_hci_summary->interface_id = bluetooth_data->interface_id;
2538 tap_hci_summary->adapter_id = bluetooth_data->adapter_id;
2540 tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_HARDWARE_ERROR;
2541 tap_hci_summary->hardware_error = tvb_get_uint8(tvb, offset - 1);
2542 tap_hci_summary->name = NULL;
2543 tap_queue_packet(bluetooth_hci_summary_tap, pinfo, tap_hci_summary);
2546 return offset;
2549 static int
2550 dissect_bthci_evt_loopback_command(tvbuff_t *tvb, int offset,
2551 packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
2553 tvbuff_t *next_tvb;
2555 next_tvb = tvb_new_subset_remaining(tvb, offset);
2556 call_dissector_with_data(bthci_cmd_handle, next_tvb, pinfo, tree, bluetooth_data);
2558 offset += tvb_reported_length_remaining(tvb, offset);
2560 return offset;
2563 static int
2564 dissect_bthci_evt_data_buffer_overflow(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2566 proto_tree_add_item(tree, hf_bthci_evt_link_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2567 offset += 1;
2569 return offset;
2572 static int
2573 dissect_bthci_evt_read_clock_offset_complete(tvbuff_t *tvb, int offset,
2574 packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
2576 proto_item *handle_item;
2577 int16_t clk;
2579 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2580 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
2581 offset += 1;
2583 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2584 offset += 2;
2586 handle_item = proto_tree_add_item(tree, hf_bthci_evt_clock_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2587 clk = tvb_get_letohs(tvb, offset) & 0x7FFF; /* only bits 0-14 are valid */
2588 proto_item_append_text(handle_item, " (%g ms)", 1.25*clk);
2589 offset += 2;
2591 return offset;
2594 static int
2595 dissect_bthci_evt_max_slots_change(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2597 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2598 offset += 2;
2600 proto_tree_add_item(tree, hf_bthci_evt_max_slots, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2601 offset += 1;
2603 return offset;
2606 static int
2607 dissect_bthci_evt_qos_violation(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2609 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2610 offset += 2;
2612 return offset;
2615 static int
2616 dissect_bthci_evt_conn_packet_type_changed(tvbuff_t *tvb, int offset,
2617 packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
2619 proto_item *connection_handle_subtree;
2620 uint32_t connection_handle;
2621 uint32_t link_type = BT_LINK_TYPE_UNKNOWN;
2622 wmem_tree_key_t key[4];
2623 uint32_t interface_id;
2624 uint32_t adapter_id;
2625 chandle_session_t *chandle_session;
2626 wmem_tree_t *subtree;
2629 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2630 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
2631 offset += 1;
2633 connection_handle_subtree = proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2634 connection_handle = tvb_get_letohs(tvb, offset) & 0x0FFF;
2635 offset += 2;
2637 interface_id = bluetooth_data->interface_id;
2638 adapter_id = bluetooth_data->adapter_id;
2640 key[0].length = 1;
2641 key[0].key = &interface_id;
2642 key[1].length = 1;
2643 key[1].key = &adapter_id;
2644 key[2].length = 1;
2645 key[2].key = &connection_handle;
2646 key[3].length = 0;
2647 key[3].key = NULL;
2649 subtree = (wmem_tree_t *) wmem_tree_lookup32_array(bluetooth_data->chandle_sessions, key);
2650 chandle_session = (subtree) ? (chandle_session_t *) wmem_tree_lookup32_le(subtree, pinfo->num) : NULL;
2651 if (chandle_session && chandle_session->connect_in_frame < pinfo->num)
2652 link_type = chandle_session->link_type;
2654 if (link_type == BT_LINK_TYPE_ACL) {
2655 proto_tree_add_bitmask(tree, tvb, offset, hf_packet_type_acl, ett_ptype_subtree, hfx_packet_type_acl, ENC_LITTLE_ENDIAN);
2656 } else if (link_type == BT_LINK_TYPE_SCO) {
2657 proto_tree_add_bitmask(tree, tvb, offset, hf_packet_type_sco, ett_ptype_subtree, hfx_packet_type_sco, ENC_LITTLE_ENDIAN);
2658 } else {
2659 /* Unknown or wrong link type (Link Layer from BTLE), show mix or ACL and SCO */
2660 expert_add_info(pinfo, connection_handle_subtree, &ei_bad_link_type);
2662 proto_tree_add_bitmask(tree, tvb, offset, hf_packet_type_acl, ett_ptype_subtree, hfx_packet_type_acl, ENC_LITTLE_ENDIAN);
2663 proto_tree_add_bitmask(tree, tvb, offset, hf_packet_type_sco, ett_ptype_subtree, hfx_packet_type_sco, ENC_LITTLE_ENDIAN);
2665 offset += 2;
2667 return offset;
2670 static int
2671 dissect_bthci_evt_command_status(tvbuff_t *tvb, int offset, packet_info *pinfo,
2672 proto_tree *main_tree, proto_tree *tree, wmem_list_t *opcode_list,
2673 bluetooth_data_t *bluetooth_data)
2675 proto_item *ti_opcode;
2676 proto_tree *opcode_tree;
2677 uint8_t status_code;
2678 uint16_t opcode;
2679 uint8_t ogf;
2680 int hfx;
2682 status_code = tvb_get_uint8(tvb, offset);
2684 if (status_code != 0) {
2685 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2686 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
2688 else {
2689 proto_tree_add_item(tree, hf_bthci_evt_status_pending, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2690 send_hci_summary_pending_tap(pinfo, bluetooth_data);
2692 offset += 1;
2694 proto_tree_add_item(tree, hf_bthci_evt_num_command_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2695 offset += 1;
2697 opcode = tvb_get_letohs(tvb, offset);
2698 ogf = opcode >> 10;
2700 if (have_tap_listener(bluetooth_hci_summary_tap)) {
2701 bluetooth_hci_summary_tap_t *tap_hci_summary;
2703 tap_hci_summary = wmem_new(pinfo->pool, bluetooth_hci_summary_tap_t);
2705 tap_hci_summary->interface_id = bluetooth_data->interface_id;
2706 tap_hci_summary->adapter_id = bluetooth_data->adapter_id;
2708 tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_EVENT_OPCODE;
2709 tap_hci_summary->ogf = ogf;
2710 tap_hci_summary->ocf = opcode & 0x03ff;
2711 tap_hci_summary->event = 0x0f; /* Command Status */
2712 if (try_val_to_str_ext(opcode, &bthci_cmd_opcode_vals_ext))
2713 tap_hci_summary->name = val_to_str_ext(opcode, &bthci_cmd_opcode_vals_ext, "Unknown 0x%04x");
2714 else
2715 tap_hci_summary->name = NULL;
2716 tap_queue_packet(bluetooth_hci_summary_tap, pinfo, tap_hci_summary);
2719 if (status_code != 0)
2720 add_opcode(pinfo->pool, opcode_list, opcode, COMMAND_STATUS_RESULT);
2721 else
2722 add_opcode(pinfo->pool, opcode_list, opcode, COMMAND_STATUS_PENDING);
2724 ti_opcode = proto_tree_add_item(tree, hf_bthci_evt_opcode, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2725 opcode_tree = proto_item_add_subtree(ti_opcode, ett_opcode);
2726 proto_tree_add_item(opcode_tree, hf_bthci_evt_ogf, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2728 if (ogf == HCI_OGF_LINK_CONTROL)
2729 hfx = hf_bthci_evt_ocf_link_control;
2730 else if (ogf == HCI_OGF_LINK_POLICY)
2731 hfx = hf_bthci_evt_ocf_link_policy;
2732 else if (ogf == HCI_OGF_HOST_CONTROLLER)
2733 hfx = hf_bthci_evt_ocf_host_controller_and_baseband;
2734 else if (ogf == HCI_OGF_INFORMATIONAL)
2735 hfx = hf_bthci_evt_ocf_informational;
2736 else if (ogf == HCI_OGF_STATUS)
2737 hfx = hf_bthci_evt_ocf_status;
2738 else if (ogf == HCI_OGF_TESTING)
2739 hfx = hf_bthci_evt_ocf_testing;
2740 else if (ogf == HCI_OGF_LOW_ENERGY)
2741 hfx = hf_bthci_evt_ocf_low_energy;
2742 else if (ogf == HCI_OGF_LOGO_TESTING)
2743 hfx = hf_bthci_evt_ocf_logo_testing;
2744 else
2745 hfx = hf_bthci_evt_ocf;
2746 proto_tree_add_item(opcode_tree, hfx, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2747 offset += 2;
2749 if (ogf == HCI_OGF_VENDOR_SPECIFIC) {
2750 col_append_fstr(pinfo->cinfo, COL_INFO, " (Vendor Command 0x%04X [(opcode 0x%04X])", opcode & 0x03ff, opcode);
2752 if (!dissector_try_payload_with_data(hci_cmd_vendor_dissector_table, tvb, pinfo, main_tree, true, bluetooth_data)) {
2753 if (bluetooth_data) {
2754 hci_vendor_data_t *hci_vendor_data;
2755 wmem_tree_key_t key[3];
2756 uint32_t interface_id;
2757 uint32_t adapter_id;
2759 interface_id = bluetooth_data->interface_id;
2760 adapter_id = bluetooth_data->adapter_id;
2762 key[0].length = 1;
2763 key[0].key = &interface_id;
2764 key[1].length = 1;
2765 key[1].key = &adapter_id;
2766 key[2].length = 0;
2767 key[2].key = NULL;
2769 hci_vendor_data = (hci_vendor_data_t *) wmem_tree_lookup32_array(bluetooth_data->hci_vendors, key);
2770 if (hci_vendor_data) {
2771 int sub_offset = 0;
2773 if (bthci_vendor_android) {
2774 sub_offset = dissector_try_uint_with_data(hci_vendor_table, bthci_vendor_manufacturer_android, tvb, pinfo, tree, true, bluetooth_data);
2775 } else {
2776 sub_offset = dissector_try_uint_with_data(hci_vendor_table, hci_vendor_data->manufacturer, tvb, pinfo, main_tree, true, bluetooth_data);
2779 if (sub_offset > 0 && sub_offset < tvb_captured_length_remaining(tvb, offset))
2780 proto_tree_add_expert(tree, pinfo, &ei_parameter_unexpected, tvb, offset + sub_offset, tvb_captured_length_remaining(tvb, sub_offset + offset));
2785 return tvb_captured_length(tvb);
2786 } else {
2787 col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)",
2788 val_to_str_ext(opcode, &bthci_cmd_opcode_vals_ext, "Unknown 0x%04x"));
2791 return offset;
2794 static int
2795 dissect_bthci_evt_page_scan_mode_change(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
2797 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
2799 proto_tree_add_item(tree, hf_bthci_evt_page_scan_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2800 offset += 1;
2802 return offset;
2805 static int
2806 dissect_bthci_evt_page_scan_repetition_mode_change(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
2808 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
2810 proto_tree_add_item(tree, hf_bthci_evt_page_scan_repetition_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2811 offset += 1;
2813 return offset;
2816 static int
2817 dissect_bthci_evt_inquire_result_with_rssi(tvbuff_t *tvb, int offset,
2818 packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data, uint8_t *bd_addr)
2820 uint8_t num, evt_num_responses;
2822 evt_num_responses = tvb_get_uint8(tvb, offset);
2823 proto_tree_add_item(tree, hf_bthci_evt_num_responses, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2824 offset += 1;
2826 for (num = 0; num < evt_num_responses; num++) {
2827 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, (num == 0) ? bd_addr : NULL);
2829 proto_tree_add_item(tree, hf_bthci_evt_page_scan_repetition_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2830 offset += 1;
2832 proto_tree_add_item(tree, hf_bthci_evt_reserved, tvb, offset, 1, ENC_NA);
2833 offset += 1;
2835 call_dissector(btcommon_cod_handle, tvb_new_subset_length(tvb, offset, 3), pinfo, tree);
2836 offset += 3;
2838 proto_tree_add_item(tree, hf_bthci_evt_clock_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2839 offset += 2;
2841 proto_tree_add_item(tree, hf_bthci_evt_rssi, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2842 offset += 1;
2846 return offset;
2849 static int
2850 dissect_bthci_evt_io_capability_request(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
2852 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
2854 return offset;
2857 static int
2858 dissect_bthci_evt_io_capability_response(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
2860 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
2862 proto_tree_add_item(tree, hf_bthci_evt_io_capability, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2863 offset += 1;
2865 proto_tree_add_item(tree, hf_bthci_evt_oob_data_present, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2866 offset += 1;
2868 proto_tree_add_item(tree, hf_bthci_evt_auth_requirements, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2869 offset += 1;
2871 return offset;
2874 static int
2875 dissect_bthci_evt_user_confirmation_request(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
2877 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
2879 proto_tree_add_item(tree, hf_bthci_evt_numeric_value, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2880 offset += 4;
2882 return offset;
2885 static int
2886 dissect_bthci_evt_user_passkey_request(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
2888 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
2890 return offset;
2893 static int
2894 dissect_bthci_evt_remote_oob_data_request(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
2896 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
2898 return offset;
2901 static int
2902 dissect_bthci_evt_simple_pairing_complete(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
2904 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2905 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
2906 offset += 1;
2908 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
2910 return offset;
2913 static int
2914 dissect_bthci_evt_user_passkey_notification(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
2916 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
2918 proto_tree_add_item(tree, hf_bthci_evt_passkey, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2919 offset += 4;
2921 return offset;
2924 static int
2925 dissect_bthci_evt_keypress_notification(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
2927 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
2929 proto_tree_add_item(tree, hf_bthci_evt_notification_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2930 offset += 1;
2932 return offset;
2935 static int
2936 dissect_bthci_evt_remote_host_sup_feat_notification(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
2938 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
2939 offset = dissect_bthci_evt_lmp_features(tvb, offset, pinfo, tree, 0);
2941 return offset;
2944 static int
2945 dissect_bthci_evt_cs_capabilities(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
2947 proto_tree_add_item(tree, hf_bthci_evt_num_config, tvb, offset, 1, ENC_NA);
2948 offset += 1;
2949 proto_tree_add_item(tree, hf_bthci_evt_max_consecutive_procedures, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2950 offset += 2;
2951 proto_tree_add_item(tree, hf_bthci_evt_number_antennae, tvb, offset, 1, ENC_NA);
2952 offset += 1;
2953 proto_tree_add_item(tree, hf_bthci_evt_num_antenna_paths, tvb, offset, 1, ENC_NA);
2954 offset += 1;
2955 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_cs_roles, ett_cs_roles, hfx_bthci_evt_cs_roles, ENC_NA);
2956 offset += 1;
2957 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_cs_modes_supported, ett_cs_modes, hfx_bthci_evt_cs_modes_supported, ENC_NA);
2958 offset += 1;
2959 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_rtt_capability, ett_cs_capability, hfx_bthci_evt_rtt_capability, ENC_NA);
2960 offset += 1;
2961 proto_tree_add_item(tree, hf_bthci_evt_rtt_aa_only_n, tvb, offset, 1, ENC_NA);
2962 offset += 1;
2963 proto_tree_add_item(tree, hf_bthci_evt_rtt_sounding_n, tvb, offset, 1, ENC_NA);
2964 offset += 1;
2965 proto_tree_add_item(tree, hf_bthci_evt_rtt_random_n, tvb, offset, 1, ENC_NA);
2966 offset += 1;
2967 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_nadm_sounding_capability, ett_cs_capability, hfx_bthci_evt_nadm_sounding_capability, ENC_LITTLE_ENDIAN);
2968 offset += 2;
2969 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_nadm_random_capability, ett_cs_capability, hfx_bthci_evt_nadm_random_capability, ENC_LITTLE_ENDIAN);
2970 offset += 2;
2971 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_cs_sync_phys_supported, ett_cs_capability, hfx_bthci_evt_cs_sync_phys_supported, ENC_NA);
2972 offset += 1;
2973 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_cs_subfeatures, ett_cs_capability, hfx_bthci_evt_cs_subfeatures, ENC_LITTLE_ENDIAN);
2974 offset += 2;
2975 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_tip1_times_supported, ett_cs_times, hfx_bthci_evt_tip_times_supported, ENC_LITTLE_ENDIAN);
2976 offset += 2;
2977 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_tip2_times_supported, ett_cs_times, hfx_bthci_evt_tip_times_supported, ENC_LITTLE_ENDIAN);
2978 offset += 2;
2979 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_tfcs_times_supported, ett_cs_times, hfx_bthci_evt_tfcs_times_supported, ENC_LITTLE_ENDIAN);
2980 offset += 2;
2981 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_tpm_times_supported, ett_cs_times, hfx_bthci_evt_tpm_times_supported, ENC_LITTLE_ENDIAN);
2982 offset += 2;
2983 proto_tree_add_item(tree, hf_bthci_evt_tsw_time_supported, tvb, offset, 1, ENC_NA);
2984 offset += 1;
2985 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_tx_snr_capability, ett_cs_capability, hfx_bthci_evt_tx_snr_capability, ENC_NA);
2986 offset += 1;
2987 return offset;
2990 static int
2991 dissect_bthci_evt_cs_mode1_step(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, bool initiator, bool sounding_seq)
2993 proto_tree_add_item(tree, hf_bthci_evt_nadm_attack_chance, tvb, offset, 1, ENC_NA);
2994 offset += 1;
2995 proto_tree_add_item(tree, hf_bthci_evt_rssi, tvb, offset, 1, ENC_NA);
2996 offset += 1;
2997 if (initiator) {
2998 proto_tree_add_item(tree, hf_bthci_evt_toa_tod_initiator, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2999 } else {
3000 proto_tree_add_item(tree, hf_bthci_evt_tod_toa_reflector, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3002 offset += 2;
3003 proto_tree_add_item(tree, hf_bthci_evt_antenna_id, tvb, offset, 1, ENC_NA);
3004 offset += 1;
3005 if (sounding_seq) {
3006 proto_tree *pct_tree;
3007 proto_item *pct_item;
3008 pct_item = proto_tree_add_string_format(tree, hf_bthci_evt_pct1, tvb, offset, 4, "", "PCT1 I/Q Sample");
3009 pct_tree = proto_item_add_subtree(pct_item, ett_cs_pct_sample);
3010 if (tvb_get_uint32(tvb, offset, ENC_LITTLE_ENDIAN) != 0xffffffff) {
3011 proto_tree_add_item(pct_tree, hf_bthci_evt_pct_i_sample, tvb, offset, 3, ENC_LITTLE_ENDIAN);
3012 proto_tree_add_item(pct_tree, hf_bthci_evt_pct_q_sample, tvb, offset, 3, ENC_LITTLE_ENDIAN);
3013 } else {
3014 proto_tree_add_item(pct_tree, hf_bthci_evt_pct_not_available, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3016 offset += 4;
3018 pct_item = proto_tree_add_string_format(tree, hf_bthci_evt_pct2, tvb, offset, 4, "", "PCT2 I/Q Sample");
3019 pct_tree = proto_item_add_subtree(pct_item, ett_cs_pct_sample);
3020 if (tvb_get_uint32(tvb, offset, ENC_LITTLE_ENDIAN) != 0xffffffff) {
3021 proto_tree_add_item(pct_tree, hf_bthci_evt_pct_i_sample, tvb, offset, 3, ENC_LITTLE_ENDIAN);
3022 proto_tree_add_item(pct_tree, hf_bthci_evt_pct_q_sample, tvb, offset, 3, ENC_LITTLE_ENDIAN);
3023 } else {
3024 proto_tree_add_item(pct_tree, hf_bthci_evt_pct_not_available, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3026 offset += 4;
3028 return offset;
3031 static int
3032 dissect_bthci_evt_cs_mode2_step(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, uint8_t step_data_length)
3034 proto_tree *tone_tree, *pct_tree;
3035 proto_item *tone_item, *pct_item;
3036 proto_tree_add_item(tree, hf_bthci_evt_antenna_permutation_index, tvb, offset, 1, ENC_NA);
3037 offset += 1;
3038 uint8_t tone_count = (step_data_length - 1) / 4;
3039 while (tone_count--) {
3040 tone_item = proto_tree_add_string_format(tree, hf_bthci_evt_cs_tone, tvb, offset, 4, "", "Tone");
3041 tone_tree = proto_item_add_subtree(tone_item, ett_cs_tone);
3042 pct_item = proto_tree_add_string_format(tone_tree, hf_bthci_evt_tone_pct, tvb, offset, 3, "", "PCT I/Q Sample");
3043 pct_tree = proto_item_add_subtree(pct_item, ett_cs_pct_sample);
3044 proto_tree_add_item(pct_tree, hf_bthci_evt_pct_i_sample, tvb, offset, 3, ENC_LITTLE_ENDIAN);
3045 proto_tree_add_item(pct_tree, hf_bthci_evt_pct_q_sample, tvb, offset, 3, ENC_LITTLE_ENDIAN);
3046 offset += 3;
3047 proto_tree_add_item(tone_tree, hf_bthci_evt_tone_quality, tvb, offset, 1, ENC_NA);
3048 proto_tree_add_item(tone_tree, hf_bthci_evt_tone_extension_presence, tvb, offset, 1, ENC_NA);
3049 offset += 1;
3051 return offset;
3054 static int
3055 dissect_bthci_evt_cs_result_steps(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, uint8_t step_counter, bool initiator, bool sounding_seq)
3057 uint8_t step_data_length, step_mode;
3058 proto_tree *step_tree, *pq_tree;
3059 proto_item *step_item, *pq_item;
3061 step_data_length = tvb_get_uint8(tvb, offset + 2);
3062 step_item = proto_tree_add_string_format(tree, hf_bthci_evt_cs_step, tvb, offset, step_data_length + 3, "", "Step %u, Mode %u, Channel %u",
3063 step_counter, tvb_get_uint8(tvb, offset), tvb_get_uint8(tvb, offset + 1));
3064 step_tree = proto_item_add_subtree(step_item, ett_cs_step);
3066 step_mode = tvb_get_uint8(tvb, offset);
3067 proto_tree_add_item(step_tree, hf_bthci_evt_step_mode, tvb, offset, 1, ENC_NA);
3068 offset += 1;
3069 proto_tree_add_item(step_tree, hf_bthci_evt_step_channel, tvb, offset, 1, ENC_NA);
3070 offset += 1;
3071 proto_tree_add_item(step_tree, hf_bthci_evt_step_data_length, tvb, offset, 1, ENC_NA);
3072 offset += 1;
3074 if (step_mode > 3) {
3075 proto_tree_add_item(tree, hf_bthci_evt_data, tvb, offset, step_data_length, ENC_NA);
3076 offset += step_data_length;
3077 return offset;
3080 if (step_mode != 2) {
3081 pq_item = proto_tree_add_item(step_tree, hf_bthci_evt_packet_quality, tvb, offset, 1, ENC_NA);
3082 pq_tree = proto_item_add_subtree(pq_item, ett_packet_quality);
3083 proto_tree_add_item(pq_tree, hf_bthci_evt_packet_quality_aa_check, tvb, offset, 1, ENC_NA);
3084 proto_tree_add_item(pq_tree, hf_bthci_evt_packet_quality_bit_errors, tvb, offset, 1, ENC_NA);
3085 proto_item_append_text(step_item, ", AA %s", val_to_str(tvb_get_uint8(tvb, offset) & 0xf, access_address_check_vals, "Unknown 0x%x"));
3086 offset += 1;
3089 if (step_mode == 0) {
3090 proto_tree_add_item(step_tree, hf_bthci_evt_rssi, tvb, offset, 1, ENC_NA);
3091 offset += 1;
3092 proto_tree_add_item(step_tree, hf_bthci_evt_antenna_id, tvb, offset, 1, ENC_NA);
3093 offset += 1;
3094 if (step_data_length == 5) {
3095 proto_tree_add_item(step_tree, hf_bthci_evt_measured_freq_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3096 offset += 2;
3099 else if (step_mode == 1) {
3100 offset = dissect_bthci_evt_cs_mode1_step(tvb, offset, pinfo, step_tree, initiator, sounding_seq);
3102 else if (step_mode == 2) {
3103 offset = dissect_bthci_evt_cs_mode2_step(tvb, offset, pinfo, step_tree, step_data_length);
3105 else {
3106 offset = dissect_bthci_evt_cs_mode1_step(tvb, offset, pinfo, step_tree, initiator, sounding_seq);
3107 offset = dissect_bthci_evt_cs_mode2_step(tvb, offset, pinfo, step_tree, step_data_length);
3109 return offset;
3112 static int
3113 dissect_bthci_evt_le_meta(tvbuff_t *tvb, int offset, packet_info *pinfo,
3114 proto_tree *tree, wmem_list_t *opcode_list, bluetooth_data_t *bluetooth_data)
3116 proto_item *item;
3117 uint8_t subevent_code;
3118 uint16_t connection_handle;
3119 uint8_t bd_addr[6];
3120 uint8_t status;
3122 subevent_code = tvb_get_uint8(tvb, offset);
3123 proto_tree_add_item(tree, hf_bthci_evt_le_meta_subevent, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3125 if (have_tap_listener(bluetooth_hci_summary_tap)) {
3126 bluetooth_hci_summary_tap_t *tap_hci_summary;
3128 tap_hci_summary = wmem_new(pinfo->pool, bluetooth_hci_summary_tap_t);
3130 tap_hci_summary->interface_id = bluetooth_data->interface_id;
3131 tap_hci_summary->adapter_id = bluetooth_data->adapter_id;
3133 tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_SUBEVENT;
3134 tap_hci_summary->event = 0x3E; /* LE Meta */
3135 tap_hci_summary->subevent = subevent_code;
3136 if (try_val_to_str(subevent_code, evt_le_meta_subevent))
3137 tap_hci_summary->name = val_to_str(subevent_code, evt_le_meta_subevent, "Unknown 0x%04x");
3138 else
3139 tap_hci_summary->name = NULL;
3140 tap_queue_packet(bluetooth_hci_summary_tap, pinfo, tap_hci_summary);
3143 col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", val_to_str(subevent_code, evt_le_meta_subevent, "Unknown 0x%02x"));
3145 offset += 1;
3147 switch(subevent_code) {
3148 case 0x01: /* LE Connection Complete */
3149 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3150 status = tvb_get_uint8(tvb, offset);
3151 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
3152 offset += 1;
3154 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3155 connection_handle = tvb_get_letohs(tvb, offset) & 0x0FFF;
3156 offset += 2;
3158 proto_tree_add_item(tree, hf_bthci_evt_role, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3159 offset += 1;
3161 proto_tree_add_item(tree, hf_bthci_evt_le_peer_address_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3162 offset += 1;
3164 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, bd_addr);
3166 proto_tree_add_item(tree, hf_bthci_evt_le_con_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3167 offset += 2;
3169 proto_tree_add_item(tree, hf_bthci_evt_le_con_latency, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3170 offset += 2;
3172 proto_tree_add_item(tree, hf_bthci_evt_le_supervision_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3173 offset += 2;
3175 proto_tree_add_item(tree, hf_bthci_evt_le_central_clock_accuracy, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3176 offset += 1;
3178 if (!pinfo->fd->visited && status == STATUS_SUCCESS) {
3179 wmem_tree_key_t key[5];
3180 uint32_t k_interface_id;
3181 uint32_t k_adapter_id;
3182 uint32_t k_connection_handle;
3183 uint32_t k_frame_number;
3184 remote_bdaddr_t *remote_bdaddr;
3185 chandle_session_t *chandle_session;
3187 k_interface_id = bluetooth_data->interface_id;
3188 k_adapter_id = bluetooth_data->adapter_id;
3189 k_connection_handle = connection_handle;
3190 k_frame_number = pinfo->num;
3192 key[0].length = 1;
3193 key[0].key = &k_interface_id;
3194 key[1].length = 1;
3195 key[1].key = &k_adapter_id;
3196 key[2].length = 1;
3197 key[2].key = &k_connection_handle;
3198 key[3].length = 1;
3199 key[3].key = &k_frame_number;
3200 key[4].length = 0;
3201 key[4].key = NULL;
3203 remote_bdaddr = (remote_bdaddr_t *) wmem_new(wmem_file_scope(), remote_bdaddr_t);
3204 remote_bdaddr->interface_id = bluetooth_data->interface_id;
3205 remote_bdaddr->adapter_id = bluetooth_data->adapter_id;
3206 remote_bdaddr->chandle = connection_handle;
3207 memcpy(remote_bdaddr->bd_addr, bd_addr, 6);
3209 wmem_tree_insert32_array(bluetooth_data->chandle_to_bdaddr, key, remote_bdaddr);
3211 chandle_session = (chandle_session_t *) wmem_new(wmem_file_scope(), chandle_session_t);
3212 chandle_session->connect_in_frame = k_frame_number;
3213 chandle_session->disconnect_in_frame = bluetooth_max_disconnect_in_frame;
3214 chandle_session->link_type = BT_LINK_TYPE_LL;
3215 wmem_tree_insert32_array(bluetooth_data->chandle_sessions, key, chandle_session);
3218 add_opcode(pinfo->pool, opcode_list, 0x200D, COMMAND_STATUS_NORMAL); /* LE Create Connection */
3220 break;
3221 case 0x02: /* LE Advertising Report */
3223 uint8_t i, num_reports, length;
3225 num_reports = tvb_get_uint8(tvb, offset);
3226 proto_tree_add_item(tree, hf_bthci_evt_num_reports, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3227 offset += 1;
3228 for (i = 0; i < num_reports; i++) {
3229 proto_tree_add_item(tree, hf_bthci_evt_advts_event_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3230 offset += 1;
3231 proto_tree_add_item(tree, hf_bthci_evt_le_peer_address_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3232 offset += 1;
3233 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, bd_addr);
3234 length = tvb_get_uint8(tvb, offset);
3235 proto_tree_add_item(tree, hf_bthci_evt_data_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3236 offset += 1;
3238 if (length > 0) {
3239 bluetooth_eir_ad_data_t *ad_data;
3241 ad_data = wmem_new0(pinfo->pool, bluetooth_eir_ad_data_t);
3242 ad_data->interface_id = bluetooth_data->interface_id;
3243 ad_data->adapter_id = bluetooth_data->adapter_id;
3244 ad_data->bd_addr = bd_addr;
3246 call_dissector_with_data(btcommon_ad_handle, tvb_new_subset_length(tvb, offset, length), pinfo, tree, ad_data);
3247 save_remote_device_name(tvb, offset, pinfo, length, bd_addr, bluetooth_data);
3248 offset += length;
3251 proto_tree_add_item(tree, hf_bthci_evt_rssi, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3252 offset += 1;
3255 break;
3256 case 0x03: /* LE Connection Update Complete */
3257 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3258 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
3259 offset += 1;
3261 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3262 offset += 2;
3263 proto_tree_add_item(tree, hf_bthci_evt_le_con_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3264 offset += 2;
3265 proto_tree_add_item(tree, hf_bthci_evt_le_con_latency, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3266 offset += 2;
3267 proto_tree_add_item(tree, hf_bthci_evt_le_supervision_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3268 offset += 2;
3270 add_opcode(pinfo->pool, opcode_list, 0x2013, COMMAND_STATUS_NORMAL); /* LE Connection Update */
3271 break;
3272 case 0x04: /* LE Read Remote Features Complete */
3273 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3274 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
3275 offset += 1;
3277 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3278 offset += 2;
3280 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_le_features, ett_le_features, hfx_bthci_evt_le_features, ENC_LITTLE_ENDIAN);
3281 offset += 8;
3283 add_opcode(pinfo->pool, opcode_list, 0x2016, COMMAND_STATUS_NORMAL); /* LE Read Remote Features */
3284 break;
3285 case 0x05: /* LE Long Term Key Request */
3286 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3287 offset += 2;
3288 proto_tree_add_item(tree, hf_bthci_evt_random_number, tvb, offset, 8, ENC_NA);
3289 offset += 8;
3290 proto_tree_add_item(tree, hf_bthci_evt_encrypted_diversifier, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3291 offset += 2;
3292 break;
3293 case 0x06: /* LE Remote Connection Parameter Request */
3294 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3295 offset += 2;
3297 proto_tree_add_item(tree, hf_bthci_evt_le_min_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3298 offset += 2;
3300 proto_tree_add_item(tree, hf_bthci_evt_le_max_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3301 offset += 2;
3303 proto_tree_add_item(tree, hf_bthci_evt_le_con_latency, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3304 offset += 2;
3306 proto_tree_add_item(tree, hf_bthci_evt_le_supervision_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3307 offset += 2;
3309 break;
3310 case 0x07: /* LE Data Length Change */
3311 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3312 offset += 2;
3314 proto_tree_add_item(tree, hf_bthci_evt_le_max_tx_octets, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3315 offset += 2;
3317 proto_tree_add_item(tree, hf_bthci_evt_le_max_tx_time, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3318 offset += 2;
3320 proto_tree_add_item(tree, hf_bthci_evt_le_max_rx_octets, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3321 offset += 2;
3323 proto_tree_add_item(tree, hf_bthci_evt_le_max_rx_time, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3324 offset += 2;
3326 break;
3327 case 0x08: /* LE Read Local P-256 Public Key Complete */
3328 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3329 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
3330 offset += 1;
3332 proto_tree_add_item(tree, hf_bthci_evt_le_local_p_256_public_key, tvb, offset, 64, ENC_NA);
3333 offset += 64;
3335 add_opcode(pinfo->pool, opcode_list, 0x2025, COMMAND_STATUS_NORMAL); /* LE Read Local P-256 Public Key */
3337 break;
3338 case 0x09: /* LE Generate DHKey Complete */
3339 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3340 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
3341 offset += 1;
3343 proto_tree_add_item(tree, hf_bthci_evt_le_dhkey, tvb, offset, 32, ENC_NA);
3344 offset += 32;
3346 add_opcode(pinfo->pool, opcode_list, 0x2026, COMMAND_STATUS_NORMAL); /* LE Generate DHKey */
3348 break;
3349 case 0x0A: /* LE Enhanced Connection Complete [v1] */
3350 case 0x29: /* LE Enhanced Connection Complete [v2] */
3351 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3352 status = tvb_get_uint8(tvb, offset);
3353 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
3354 offset += 1;
3356 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3357 connection_handle = tvb_get_letohs(tvb, offset) & 0x0FFF;
3358 offset += 2;
3360 proto_tree_add_item(tree, hf_bthci_evt_role, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3361 offset += 1;
3363 proto_tree_add_item(tree, hf_bthci_evt_le_peer_address_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3364 offset += 1;
3366 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, bd_addr);
3367 offset = dissect_bd_addr(hf_bthci_evt_le_local_rpa, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
3368 offset = dissect_bd_addr(hf_bthci_evt_le_peer_rpa, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
3370 proto_tree_add_item(tree, hf_bthci_evt_le_con_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3371 offset += 2;
3373 proto_tree_add_item(tree, hf_bthci_evt_le_con_latency, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3374 offset += 2;
3376 proto_tree_add_item(tree, hf_bthci_evt_le_supervision_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3377 offset += 2;
3379 proto_tree_add_item(tree, hf_bthci_evt_le_central_clock_accuracy, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3380 offset += 1;
3382 if (subevent_code == 0x29) {
3383 proto_tree_add_item(tree, hf_bthci_evt_advertising_handle, tvb, offset, 1, ENC_NA);
3384 offset += 1;
3385 proto_tree_add_item(tree, hf_bthci_evt_sync_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3386 offset += 2;
3389 if (!pinfo->fd->visited && status == STATUS_SUCCESS) {
3390 wmem_tree_key_t key[5];
3391 uint32_t k_interface_id;
3392 uint32_t k_adapter_id;
3393 uint32_t k_connection_handle;
3394 uint32_t k_frame_number;
3395 remote_bdaddr_t *remote_bdaddr;
3396 chandle_session_t *chandle_session;
3398 k_interface_id = bluetooth_data->interface_id;
3399 k_adapter_id = bluetooth_data->adapter_id;
3400 k_connection_handle = connection_handle;
3401 k_frame_number = pinfo->num;
3403 key[0].length = 1;
3404 key[0].key = &k_interface_id;
3405 key[1].length = 1;
3406 key[1].key = &k_adapter_id;
3407 key[2].length = 1;
3408 key[2].key = &k_connection_handle;
3409 key[3].length = 1;
3410 key[3].key = &k_frame_number;
3411 key[4].length = 0;
3412 key[4].key = NULL;
3414 remote_bdaddr = (remote_bdaddr_t *) wmem_new(wmem_file_scope(), remote_bdaddr_t);
3415 remote_bdaddr->interface_id = bluetooth_data->interface_id;
3416 remote_bdaddr->adapter_id = bluetooth_data->adapter_id;
3417 remote_bdaddr->chandle = connection_handle;
3418 memcpy(remote_bdaddr->bd_addr, bd_addr, 6);
3420 wmem_tree_insert32_array(bluetooth_data->chandle_to_bdaddr, key, remote_bdaddr);
3422 chandle_session = (chandle_session_t *) wmem_new(wmem_file_scope(), chandle_session_t);
3423 chandle_session->connect_in_frame = k_frame_number;
3424 chandle_session->disconnect_in_frame = bluetooth_max_disconnect_in_frame;
3425 chandle_session->link_type = BT_LINK_TYPE_LL;
3426 wmem_tree_insert32_array(bluetooth_data->chandle_sessions, key, chandle_session);
3429 add_opcode(pinfo->pool, opcode_list, 0x200D, COMMAND_STATUS_NORMAL); /* LE Create Connection */
3431 break;
3432 case 0x0B: /* LE Direct Advertising Report */
3434 uint8_t number_of_reports;
3435 uint8_t report_id = 1;
3437 proto_tree_add_item(tree, hf_bthci_evt_le_number_of_reports, tvb, offset, 1, ENC_NA);
3438 number_of_reports = tvb_get_uint8(tvb, offset);
3439 offset += 1;
3441 while (number_of_reports) {
3442 proto_item *report_item;
3443 proto_tree *report_tree;
3445 report_item = proto_tree_add_none_format(tree, hf_bthci_evt_le_report, tvb, offset, 16, "Item %u",
3446 report_id);
3447 report_tree = proto_item_add_subtree(report_item, ett_le_report);
3449 proto_tree_add_item(report_tree, hf_bthci_evt_le_event_type, tvb, offset, 1, ENC_NA);
3450 offset += 1;
3452 proto_tree_add_item(report_tree, hf_bthci_evt_le_direct_address_type, tvb, offset, 1, ENC_NA);
3453 offset += 1;
3455 offset = dissect_bd_addr(hf_bthci_evt_le_direct_bd_addr, pinfo, report_tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
3457 proto_tree_add_item(report_tree, hf_bthci_evt_le_address_type, tvb, offset, 1, ENC_NA);
3458 offset += 1;
3460 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, report_tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
3462 proto_tree_add_item(report_tree, hf_bthci_evt_le_rssi, tvb, offset, 1, ENC_NA);
3463 offset += 1;
3465 report_id += 1;
3466 number_of_reports--;
3470 break;
3471 case 0x0C: /* LE PHY Update Complete */
3472 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3473 status = tvb_get_uint8(tvb, offset);
3474 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
3475 offset += 1;
3477 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3478 offset += 2;
3480 proto_tree_add_item(tree, hf_bthci_evt_le_tx_phy, tvb, offset, 1, ENC_NA);
3481 offset += 1;
3483 proto_tree_add_item(tree, hf_bthci_evt_le_rx_phy, tvb, offset, 1, ENC_NA);
3484 offset += 1;
3486 break;
3487 case 0x0D: /* LE Extended Advertising Report */
3489 uint8_t i, num_reports, length;
3491 num_reports = tvb_get_uint8(tvb, offset);
3492 proto_tree_add_item(tree, hf_bthci_evt_num_reports, tvb, offset, 1, ENC_NA);
3493 offset += 1;
3494 for (i = 0; i < num_reports; i++) {
3496 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_ext_advts_event_type, ett_le_ext_advts_event_type, hfx_bthci_evt_le_ext_advts_evt_type, ENC_LITTLE_ENDIAN);
3497 offset += 2;
3498 proto_tree_add_item(tree, hf_bthci_evt_le_peer_address_type, tvb, offset, 1, ENC_NA);
3499 offset += 1;
3500 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, bd_addr);
3502 proto_tree_add_item(tree, hf_bthci_evt_primary_phy, tvb, offset, 1, ENC_NA);
3503 offset += 1;
3504 proto_tree_add_item(tree, hf_bthci_evt_secondary_phy, tvb, offset, 1, ENC_NA);
3505 offset += 1;
3506 item = proto_tree_add_item(tree, hf_bthci_evt_advertising_sid, tvb, offset, 1, ENC_NA);
3507 if (tvb_get_uint8(tvb, offset) == 0xFF)
3508 proto_item_append_text(item, " (not available)");
3509 offset += 1;
3511 item = proto_tree_add_item(tree, hf_bthci_evt_tx_power, tvb, offset, 1, ENC_NA);
3512 if (tvb_get_uint8(tvb, offset) == 127)
3513 proto_item_append_text(item, " (not available)");
3514 offset += 1;
3516 item = proto_tree_add_item(tree, hf_bthci_evt_rssi, tvb, offset, 1, ENC_NA);
3517 if (tvb_get_uint8(tvb, offset) == 127)
3518 proto_item_append_text(item, " (not available)");
3519 offset += 1;
3521 item = proto_tree_add_item(tree, hf_bthci_evt_periodic_advertising_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3522 if (tvb_get_uint16(tvb, offset, ENC_LITTLE_ENDIAN) == 0x0000)
3523 proto_item_append_text(item, " (no periodic advertising)");
3524 offset += 2;
3526 proto_tree_add_item(tree, hf_bthci_evt_le_direct_address_type, tvb, offset, 1, ENC_NA);
3527 offset += 1;
3529 offset = dissect_bd_addr(hf_bthci_evt_le_direct_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
3531 length = tvb_get_uint8(tvb, offset);
3532 proto_tree_add_item(tree, hf_bthci_evt_data_length, tvb, offset, 1, ENC_NA);
3533 offset += 1;
3535 if (length > 0) {
3536 bluetooth_eir_ad_data_t *ad_data;
3538 ad_data = wmem_new0(pinfo->pool, bluetooth_eir_ad_data_t);
3539 ad_data->interface_id = bluetooth_data->interface_id;
3540 ad_data->adapter_id = bluetooth_data->adapter_id;
3541 ad_data->bd_addr = bd_addr;
3543 call_dissector_with_data(btcommon_ad_handle, tvb_new_subset_length(tvb, offset, length), pinfo, tree, ad_data);
3544 save_remote_device_name(tvb, offset, pinfo, length, bd_addr, bluetooth_data);
3545 offset += length;
3549 break;
3550 case 0x0E: /* LE Periodic Advertising Sync Established [v1] */
3551 case 0x24: /* LE Periodic Advertising Sync Established [v2] */
3552 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
3553 status = tvb_get_uint8(tvb, offset);
3554 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
3555 offset += 1;
3556 proto_tree_add_item(tree, hf_bthci_evt_sync_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3557 offset += 2;
3558 proto_tree_add_item(tree, hf_bthci_evt_advertising_sid, tvb, offset, 1, ENC_NA);
3559 offset += 1;
3560 proto_tree_add_item(tree, hf_bthci_evt_le_peer_address_type, tvb, offset, 1, ENC_NA);
3561 offset += 1;
3562 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, bd_addr);
3563 proto_tree_add_item(tree, hf_bthci_evt_advertiser_phy, tvb, offset, 1, ENC_NA);
3564 offset += 1;
3565 proto_tree_add_item(tree, hf_bthci_evt_periodic_advertising_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3566 offset += 2;
3567 proto_tree_add_item(tree, hf_bthci_evt_advertiser_clock_accuracy, tvb, offset, 1, ENC_NA);
3568 offset += 1;
3569 if (subevent_code == 0x24) {
3570 proto_tree_add_item(tree, hf_bthci_evt_num_subevents, tvb, offset, 1, ENC_NA);
3571 offset+=1;
3572 proto_tree_add_item(tree, hf_bthci_evt_subevent_interval, tvb, offset, 1, ENC_NA);
3573 offset+=1;
3574 proto_tree_add_item(tree, hf_bthci_evt_response_slot_delay, tvb, offset, 1, ENC_NA);
3575 offset+=1;
3576 proto_tree_add_item(tree, hf_bthci_evt_response_slot_spacing, tvb, offset, 1, ENC_NA);
3577 offset+=1;
3579 break;
3580 case 0x0F: /* LE Periodic Advertising Report [v1] */
3581 case 0x25: /* LE Periodic Advertising Report [v2] */
3583 uint8_t length;
3584 proto_tree_add_item(tree, hf_bthci_evt_sync_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3585 offset += 2;
3586 item = proto_tree_add_item(tree, hf_bthci_evt_tx_power, tvb, offset, 1, ENC_NA);
3587 if (tvb_get_uint8(tvb, offset) == 127)
3588 proto_item_append_text(item, " (not available)");
3589 offset += 1;
3590 item = proto_tree_add_item(tree, hf_bthci_evt_rssi, tvb, offset, 1, ENC_NA);
3591 if (tvb_get_uint8(tvb, offset) == 127)
3592 proto_item_append_text(item, " (not available)");
3593 offset += 1;
3594 proto_tree_add_item(tree, hf_bthci_evt_cte_type, tvb, offset, 1, ENC_NA);
3595 offset += 1;
3596 if (subevent_code == 0x25) {
3597 proto_tree_add_item(tree, hf_bthci_evt_periodic_event_counter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3598 offset += 2;
3599 proto_tree_add_item(tree, hf_bthci_evt_subevent, tvb, offset, 1, ENC_NA);
3600 offset += 1;
3602 item = proto_tree_add_item(tree, hf_bthci_evt_data_status, tvb, offset, 1, ENC_NA);
3603 if (tvb_get_uint8(tvb, offset) == 0xff)
3604 proto_item_append_text(item, " (Failed to receive)");
3605 offset += 1;
3606 proto_tree_add_item(tree, hf_bthci_evt_data_length, tvb, offset, 1, ENC_NA);
3607 length = tvb_get_uint8(tvb, offset);
3608 offset += 1;
3609 proto_tree_add_item(tree, hf_bthci_evt_data, tvb, offset, length, ENC_NA);
3610 offset += length;
3612 break;
3613 case 0x10: /* LE Periodic Advertising Sync Lost */
3614 proto_tree_add_item(tree, hf_bthci_evt_sync_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3615 offset += 2;
3616 break;
3617 case 0x12: /* LE Advertising Set Terminated */
3618 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
3619 status = tvb_get_uint8(tvb, offset);
3620 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
3621 offset += 1;
3622 proto_tree_add_item(tree, hf_bthci_evt_advertising_handle, tvb, offset, 1, ENC_NA);
3623 offset += 1;
3624 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3625 offset += 2;
3626 proto_tree_add_item(tree, hf_bthci_evt_num_compl_ext_advertising_events, tvb, offset, 1, ENC_NA);
3627 offset += 1;
3628 break;
3629 case 0x13: /* LE Scan Request Received */
3630 proto_tree_add_item(tree, hf_bthci_evt_advertising_handle, tvb, offset, 1, ENC_NA);
3631 offset += 1;
3632 proto_tree_add_item(tree, hf_bthci_evt_le_address_type, tvb, offset, 1, ENC_NA);
3633 offset += 1;
3635 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
3636 break;
3637 case 0x14: /* LE Channel Selection Algorithm */
3638 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3639 offset += 2;
3640 proto_tree_add_item(tree, hf_bthci_evt_channel_selection_algorithm, tvb, offset, 1, ENC_NA);
3641 offset += 1;
3642 break;
3643 case 0x15: /* LE Connectionless IQ Report */
3644 proto_tree_add_item(tree, hf_bthci_evt_sync_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3645 offset += 2;
3646 proto_tree_add_item(tree, hf_bthci_evt_channel_index, tvb, offset, 1, ENC_NA);
3647 offset += 1;
3648 item = proto_tree_add_item(tree, hf_bthci_evt_cte_rssi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3649 proto_item_append_text(item, " (%g dBm)", tvb_get_letohis(tvb, offset)*0.1);
3650 offset += 2;
3651 proto_tree_add_item(tree, hf_bthci_evt_antenna_id, tvb, offset, 1, ENC_NA);
3652 offset += 1;
3653 proto_tree_add_item(tree, hf_bthci_evt_cte_type, tvb, offset, 1, ENC_NA);
3654 offset += 1;
3655 proto_tree_add_item(tree, hf_bthci_evt_slot_durations, tvb, offset, 1, ENC_NA);
3656 offset += 1;
3657 proto_tree_add_item(tree, hf_bthci_evt_packet_status, tvb, offset, 1, ENC_NA);
3658 offset += 1;
3659 proto_tree_add_item(tree, hf_bthci_evt_event_counter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3660 offset += 2;
3661 offset = dissect_iq_sample_list(tvb, offset, tree);
3662 break;
3663 case 0x16: /* LE Connection IQ Report */
3664 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3665 offset += 2;
3666 proto_tree_add_item(tree, hf_bthci_evt_le_rx_phy, tvb, offset, 1, ENC_NA);
3667 offset += 1;
3668 proto_tree_add_item(tree, hf_bthci_evt_channel_index, tvb, offset, 1, ENC_NA);
3669 offset += 1;
3670 item = proto_tree_add_item(tree, hf_bthci_evt_cte_rssi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3671 proto_item_append_text(item, " (%g dBm)", tvb_get_letohis(tvb, offset)*0.1);
3672 offset += 2;
3673 proto_tree_add_item(tree, hf_bthci_evt_antenna_id, tvb, offset, 1, ENC_NA);
3674 offset += 1;
3675 proto_tree_add_item(tree, hf_bthci_evt_cte_type, tvb, offset, 1, ENC_NA);
3676 offset += 1;
3677 proto_tree_add_item(tree, hf_bthci_evt_slot_durations, tvb, offset, 1, ENC_NA);
3678 offset += 1;
3679 proto_tree_add_item(tree, hf_bthci_evt_packet_status, tvb, offset, 1, ENC_NA);
3680 offset += 1;
3681 proto_tree_add_item(tree, hf_bthci_evt_event_counter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3682 offset += 2;
3683 offset = dissect_iq_sample_list(tvb, offset, tree);
3684 break;
3685 case 0x17: /* LE CTE Request Failed */
3686 case 0x2E: /* LE CS Security Enable Complete */
3687 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
3688 status = tvb_get_uint8(tvb, offset);
3689 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
3690 offset += 1;
3691 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3692 offset += 2;
3693 break;
3694 case 0x18: /* LE Periodic Advertising Sync Transfer Received [v1] */
3695 case 0x26: /* LE Periodic Advertising Sync Transfer Received [v2] */
3696 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
3697 status = tvb_get_uint8(tvb, offset);
3698 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
3699 offset += 1;
3700 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3701 offset += 2;
3702 proto_tree_add_item(tree, hf_bthci_evt_service_data_past, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3703 offset += 2;
3704 proto_tree_add_item(tree, hf_bthci_evt_sync_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3705 offset += 2;
3706 proto_tree_add_item(tree, hf_bthci_evt_advertising_sid, tvb, offset, 1, ENC_NA);
3707 offset += 1;
3708 proto_tree_add_item(tree, hf_bthci_evt_le_peer_address_type, tvb, offset, 1, ENC_NA);
3709 offset += 1;
3710 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, bd_addr);
3711 proto_tree_add_item(tree, hf_bthci_evt_advertiser_phy, tvb, offset, 1, ENC_NA);
3712 offset += 1;
3713 proto_tree_add_item(tree, hf_bthci_evt_periodic_advertising_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3714 offset += 2;
3715 proto_tree_add_item(tree, hf_bthci_evt_advertiser_clock_accuracy, tvb, offset, 1, ENC_NA);
3716 offset += 1;
3717 if (subevent_code == 0x26) {
3718 proto_tree_add_item(tree, hf_bthci_evt_num_subevents, tvb, offset, 1, ENC_NA);
3719 offset+=1;
3720 proto_tree_add_item(tree, hf_bthci_evt_subevent_interval, tvb, offset, 1, ENC_NA);
3721 offset+=1;
3722 proto_tree_add_item(tree, hf_bthci_evt_response_slot_delay, tvb, offset, 1, ENC_NA);
3723 offset+=1;
3724 proto_tree_add_item(tree, hf_bthci_evt_response_slot_spacing, tvb, offset, 1, ENC_NA);
3725 offset+=1;
3727 break;
3728 case 0x19: /* LE CIS Established [v1] */
3729 case 0x2A: /* LE CIS Established [v2] */
3730 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
3731 status = tvb_get_uint8(tvb, offset);
3732 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
3733 offset += 1;
3734 proto_tree_add_item(tree, hf_bthci_evt_cis_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3735 connection_handle = tvb_get_letohs(tvb, offset) & 0x0FFF;
3736 offset += 2;
3738 if (!pinfo->fd->visited && status == STATUS_SUCCESS) {
3739 wmem_tree_key_t key[5];
3740 uint32_t k_interface_id;
3741 uint32_t k_adapter_id;
3742 uint32_t k_connection_handle;
3743 uint32_t k_frame_number;
3744 chandle_session_t *chandle_session;
3746 k_interface_id = bluetooth_data->interface_id;
3747 k_adapter_id = bluetooth_data->adapter_id;
3748 k_connection_handle = connection_handle;
3749 k_frame_number = pinfo->num;
3751 key[0].length = 1;
3752 key[0].key = &k_interface_id;
3753 key[1].length = 1;
3754 key[1].key = &k_adapter_id;
3755 key[2].length = 1;
3756 key[2].key = &k_connection_handle;
3757 key[3].length = 1;
3758 key[3].key = &k_frame_number;
3759 key[4].length = 0;
3760 key[4].key = NULL;
3762 chandle_session = (chandle_session_t *) wmem_new(wmem_file_scope(), chandle_session_t);
3763 chandle_session->connect_in_frame = k_frame_number;
3764 chandle_session->disconnect_in_frame = bluetooth_max_disconnect_in_frame;
3765 chandle_session->link_type = BT_LINK_TYPE_ISO;
3766 wmem_tree_insert32_array(bluetooth_data->chandle_sessions, key, chandle_session);
3769 proto_tree_add_item(tree, hf_bthci_evt_cig_sync_delay, tvb, offset, 3, ENC_LITTLE_ENDIAN);
3770 offset += 3;
3771 proto_tree_add_item(tree, hf_bthci_evt_cis_sync_delay, tvb, offset, 3, ENC_LITTLE_ENDIAN);
3772 offset += 3;
3773 proto_tree_add_item(tree, hf_bthci_evt_transport_latency_c_to_p, tvb, offset, 3, ENC_LITTLE_ENDIAN);
3774 offset += 3;
3775 proto_tree_add_item(tree, hf_bthci_evt_transport_latency_p_to_c, tvb, offset, 3, ENC_LITTLE_ENDIAN);
3776 offset += 3;
3777 proto_tree_add_item(tree, hf_bthci_evt_phy_c_to_p, tvb, offset, 1, ENC_NA);
3778 offset += 1;
3779 proto_tree_add_item(tree, hf_bthci_evt_phy_p_to_c, tvb, offset, 1, ENC_NA);
3780 offset += 1;
3781 proto_tree_add_item(tree, hf_bthci_evt_nse, tvb, offset, 1, ENC_NA);
3782 offset += 1;
3783 proto_tree_add_item(tree, hf_bthci_evt_bn_c_to_p, tvb, offset, 1, ENC_NA);
3784 offset += 1;
3785 proto_tree_add_item(tree, hf_bthci_evt_bn_p_to_c, tvb, offset, 1, ENC_NA);
3786 offset += 1;
3787 proto_tree_add_item(tree, hf_bthci_evt_ft_c_to_p, tvb, offset, 1, ENC_NA);
3788 offset += 1;
3789 proto_tree_add_item(tree, hf_bthci_evt_ft_p_to_c, tvb, offset, 1, ENC_NA);
3790 offset += 1;
3791 proto_tree_add_item(tree, hf_bthci_evt_max_pdu_c_to_p, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3792 offset += 2;
3793 proto_tree_add_item(tree, hf_bthci_evt_max_pdu_p_to_c, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3794 offset += 2;
3795 proto_tree_add_item(tree, hf_bthci_evt_iso_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3796 offset += 2;
3797 if (subevent_code == 0x2A) {
3798 proto_tree_add_item(tree, hf_bthci_evt_sub_interval, tvb, offset, 3, ENC_LITTLE_ENDIAN);
3799 offset += 3;
3800 proto_tree_add_item(tree, hf_bthci_evt_max_sdu_c_to_p, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3801 offset += 2;
3802 proto_tree_add_item(tree, hf_bthci_evt_max_sdu_p_to_c, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3803 offset += 2;
3804 proto_tree_add_item(tree, hf_bthci_evt_sdu_interval_c_to_p, tvb, offset, 3, ENC_LITTLE_ENDIAN);
3805 offset += 3;
3806 proto_tree_add_item(tree, hf_bthci_evt_sdu_interval_p_to_c, tvb, offset, 3, ENC_LITTLE_ENDIAN);
3807 offset += 3;
3808 proto_tree_add_item(tree, hf_bthci_evt_framing, tvb, offset, 1, ENC_NA);
3809 offset += 1;
3811 break;
3812 case 0x1A: /* LE CIS Request */
3814 uint32_t chandle, k_shandle;
3815 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3816 chandle = tvb_get_letohs(tvb, offset) & 0xfff;
3817 offset += 2;
3818 proto_tree_add_item(tree, hf_bthci_evt_cis_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3819 k_shandle = tvb_get_letohs(tvb, offset) & 0xfff;
3820 offset += 2;
3821 proto_tree_add_item(tree, hf_bthci_evt_cig_id, tvb, offset, 1, ENC_NA);
3822 offset += 1;
3823 proto_tree_add_item(tree, hf_bthci_evt_cis_id, tvb, offset, 1, ENC_NA);
3824 offset += 1;
3826 if (!pinfo->fd->visited) {
3827 wmem_tree_key_t key[5];
3828 uint32_t interface_id;
3829 uint32_t adapter_id;
3830 uint32_t frame_number;
3831 stream_connection_handle_pair_t *stream_connection_handle_pair;
3833 interface_id = bluetooth_data->interface_id;
3834 adapter_id = bluetooth_data->adapter_id;
3835 frame_number = pinfo->num;
3837 key[0].length = 1;
3838 key[0].key = &interface_id;
3839 key[1].length = 1;
3840 key[1].key = &adapter_id;
3841 key[2].length = 1;
3842 key[2].key = &k_shandle;
3843 key[3].length = 1;
3844 key[3].key = &frame_number;
3845 key[4].length = 0;
3846 key[4].key = NULL;
3848 stream_connection_handle_pair = (stream_connection_handle_pair_t *) wmem_new(wmem_file_scope(), stream_connection_handle_pair_t);
3849 stream_connection_handle_pair->chandle = chandle;
3850 stream_connection_handle_pair->change_in_frame = frame_number;
3852 wmem_tree_insert32_array(bluetooth_data->shandle_to_chandle, key, stream_connection_handle_pair);
3855 break;
3856 case 0x1B: /* LE Create BIG Complete */
3858 uint8_t num_bis;
3860 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
3861 status = tvb_get_uint8(tvb, offset);
3862 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
3863 offset += 1;
3864 proto_tree_add_item(tree, hf_bthci_evt_big_handle, tvb, offset, 1, ENC_NA);
3865 offset += 1;
3866 proto_tree_add_item(tree, hf_bthci_evt_big_sync_delay, tvb, offset, 3, ENC_LITTLE_ENDIAN);
3867 offset += 3;
3868 proto_tree_add_item(tree, hf_bthci_evt_big_transport_latency, tvb, offset, 3, ENC_LITTLE_ENDIAN);
3869 offset += 3;
3870 proto_tree_add_item(tree, hf_bthci_evt_phy, tvb, offset, 1, ENC_NA);
3871 offset += 1;
3872 proto_tree_add_item(tree, hf_bthci_evt_nse, tvb, offset, 1, ENC_NA);
3873 offset += 1;
3874 proto_tree_add_item(tree, hf_bthci_evt_bn, tvb, offset, 1, ENC_NA);
3875 offset += 1;
3876 proto_tree_add_item(tree, hf_bthci_evt_pto, tvb, offset, 1, ENC_NA);
3877 offset += 1;
3878 proto_tree_add_item(tree, hf_bthci_evt_irc, tvb, offset, 1, ENC_NA);
3879 offset += 1;
3880 proto_tree_add_item(tree, hf_bthci_evt_max_pdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3881 offset += 2;
3882 proto_tree_add_item(tree, hf_bthci_evt_iso_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3883 offset += 2;
3884 proto_tree_add_item(tree, hf_bthci_evt_num_bis, tvb, offset, 1, ENC_NA);
3885 num_bis = tvb_get_uint8(tvb, offset);
3886 offset += 1;
3887 while (num_bis) {
3888 proto_tree_add_item(tree, hf_bthci_evt_bis_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3889 offset += 2;
3890 num_bis -= 1;
3893 break;
3894 case 0x1C: /* LE Terminate BIG Complete */
3895 case 0x1E: /* LE BIG Sync Lost */
3896 proto_tree_add_item(tree, hf_bthci_evt_big_handle, tvb, offset, 1, ENC_NA);
3897 offset += 1;
3898 proto_tree_add_item(tree, hf_bthci_evt_reason, tvb, offset, 1, ENC_NA);
3899 send_hci_summary_reason_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
3900 offset += 1;
3901 break;
3902 case 0x1D: /* LE BIG Sync Established */
3904 uint8_t num_bis;
3906 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
3907 status = tvb_get_uint8(tvb, offset);
3908 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
3909 offset += 1;
3910 proto_tree_add_item(tree, hf_bthci_evt_big_handle, tvb, offset, 1, ENC_NA);
3911 offset += 1;
3912 proto_tree_add_item(tree, hf_bthci_evt_big_transport_latency, tvb, offset, 3, ENC_LITTLE_ENDIAN);
3913 offset += 3;
3914 proto_tree_add_item(tree, hf_bthci_evt_nse, tvb, offset, 1, ENC_NA);
3915 offset += 1;
3916 proto_tree_add_item(tree, hf_bthci_evt_bn, tvb, offset, 1, ENC_NA);
3917 offset += 1;
3918 proto_tree_add_item(tree, hf_bthci_evt_pto, tvb, offset, 1, ENC_NA);
3919 offset += 1;
3920 proto_tree_add_item(tree, hf_bthci_evt_irc, tvb, offset, 1, ENC_NA);
3921 offset += 1;
3922 proto_tree_add_item(tree, hf_bthci_evt_max_pdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3923 offset += 2;
3924 proto_tree_add_item(tree, hf_bthci_evt_iso_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3925 offset += 2;
3926 proto_tree_add_item(tree, hf_bthci_evt_num_bis, tvb, offset, 1, ENC_NA);
3927 num_bis = tvb_get_uint8(tvb, offset);
3928 offset += 1;
3929 while (num_bis) {
3930 proto_tree_add_item(tree, hf_bthci_evt_bis_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3931 offset += 2;
3932 num_bis -= 1;
3935 break;
3936 case 0x1F: /* LE Request Peer SCA Complete */
3937 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
3938 status = tvb_get_uint8(tvb, offset);
3939 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
3940 offset += 1;
3941 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3942 offset += 2;
3943 proto_tree_add_item(tree, hf_bthci_evt_peer_clock_accuracy, tvb, offset, 1, ENC_NA);
3944 offset += 1;
3945 break;
3946 case 0x20: /* LE Path Loss Threshold */
3947 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3948 offset += 2;
3949 proto_tree_add_item(tree, hf_bthci_evt_current_path_loss, tvb, offset, 1, ENC_NA);
3950 offset += 1;
3951 proto_tree_add_item(tree, hf_bthci_evt_zone_entered, tvb, offset, 1, ENC_NA);
3952 offset += 1;
3953 break;
3954 case 0x21: /* LE Transmit Power Reporting */
3955 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
3956 status = tvb_get_uint8(tvb, offset);
3957 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
3958 offset += 1;
3959 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3960 offset += 2;
3961 proto_tree_add_item(tree, hf_bthci_evt_power_report_reason, tvb, offset, 1, ENC_NA);
3962 offset += 1;
3963 proto_tree_add_item(tree, hf_bthci_evt_phy_and_coding, tvb, offset, 1, ENC_NA);
3964 offset += 1;
3965 item = proto_tree_add_item(tree, hf_bthci_evt_transmit_power_level, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3966 if (tvb_get_uint8(tvb, offset) == 0x7f)
3967 proto_item_append_text(item, " (Not Available)");
3968 else if (tvb_get_uint8(tvb, offset) == 0x7e)
3969 proto_item_append_text(item, " (Peer Not Managing Power Level on PHY)");
3970 offset += 1;
3971 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_transmit_power_level_flags,
3972 ett_transmit_power_level_flags, hfx_bthci_evt_transmit_power_level_flags, ENC_NA);
3973 offset += 1;
3974 proto_tree_add_item(tree, hf_bthci_evt_power_level_delta, tvb, offset, 1, ENC_NA);
3975 offset += 1;
3976 break;
3977 case 0x22: /* LE BIGInfo Advertising Report */
3978 proto_tree_add_item(tree, hf_bthci_evt_sync_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3979 offset += 2;
3980 proto_tree_add_item(tree, hf_bthci_evt_num_bis, tvb, offset, 1, ENC_NA);
3981 offset += 1;
3982 proto_tree_add_item(tree, hf_bthci_evt_nse, tvb, offset, 1, ENC_NA);
3983 offset += 1;
3984 proto_tree_add_item(tree, hf_bthci_evt_iso_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3985 offset += 2;
3986 proto_tree_add_item(tree, hf_bthci_evt_bn, tvb, offset, 1, ENC_NA);
3987 offset += 1;
3988 proto_tree_add_item(tree, hf_bthci_evt_pto, tvb, offset, 1, ENC_NA);
3989 offset += 1;
3990 proto_tree_add_item(tree, hf_bthci_evt_irc, tvb, offset, 1, ENC_NA);
3991 offset += 1;
3992 proto_tree_add_item(tree, hf_bthci_evt_max_pdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3993 offset += 2;
3994 proto_tree_add_item(tree, hf_bthci_evt_sdu_interval, tvb, offset, 3, ENC_LITTLE_ENDIAN);
3995 offset += 3;
3996 proto_tree_add_item(tree, hf_bthci_evt_max_sdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3997 offset += 2;
3998 proto_tree_add_item(tree, hf_bthci_evt_phy, tvb, offset, 1, ENC_NA);
3999 offset += 1;
4000 proto_tree_add_item(tree, hf_bthci_evt_framing, tvb, offset, 1, ENC_NA);
4001 offset += 1;
4002 proto_tree_add_item(tree, hf_bthci_evt_encryption_mode, tvb, offset, 1, ENC_NA);
4003 offset += 1;
4004 break;
4005 case 0x23: /* LE Subrate Change */
4007 uint32_t underlying_events;
4008 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
4009 status = tvb_get_uint8(tvb, offset);
4010 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
4011 offset += 1;
4012 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4013 offset += 2;
4014 proto_tree_add_item(tree, hf_bthci_evt_subrate_factor, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4015 offset += 2;
4016 item = proto_tree_add_item(tree, hf_bthci_evt_le_con_latency, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4017 underlying_events = (tvb_get_uint16(tvb, offset, ENC_LITTLE_ENDIAN) + 1)*
4018 tvb_get_uint16(tvb, offset - 2, ENC_LITTLE_ENDIAN) - 1;
4019 proto_item_append_text(item, ", %u underlying events", underlying_events);
4020 offset += 2;
4021 proto_tree_add_item(tree, hf_bthci_evt_continuation_number, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4022 offset += 2;
4023 proto_tree_add_item(tree, hf_bthci_evt_le_supervision_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4024 offset += 2;
4026 break;
4027 case 0x27: /* LE Periodic Advertising Subevent Data Request */
4028 proto_tree_add_item(tree, hf_bthci_evt_advertising_handle, tvb, offset, 1, ENC_NA);
4029 offset += 1;
4030 proto_tree_add_item(tree, hf_bthci_evt_subevent_start, tvb, offset, 1, ENC_NA);
4031 offset += 1;
4032 proto_tree_add_item(tree, hf_bthci_evt_subevent_count, tvb, offset, 1, ENC_NA);
4033 offset += 1;
4034 break;
4035 case 0x28: /* LE Periodic Advertising Response Report */
4037 uint8_t num_reponses, length;
4038 proto_item *report_item;
4039 proto_tree *report_tree;
4040 proto_tree_add_item(tree, hf_bthci_evt_advertising_handle, tvb, offset, 1, ENC_NA);
4041 offset += 1;
4042 proto_tree_add_item(tree, hf_bthci_evt_subevent, tvb, offset, 1, ENC_NA);
4043 offset += 1;
4044 proto_tree_add_item(tree, hf_bthci_evt_subevent_tx_status, tvb, offset, 1, ENC_NA);
4045 offset += 1;
4046 proto_tree_add_item(tree, hf_bthci_evt_num_responses, tvb, offset, 1, ENC_NA);
4047 num_reponses = tvb_get_uint8(tvb, offset);
4048 offset += 1;
4049 for (int i = 0; i < num_reponses; i++) {
4050 length = 6 + tvb_get_uint8(tvb, offset+5);
4051 report_item = proto_tree_add_none_format(tree, hf_bthci_evt_subevent_responses, tvb, offset, length,
4052 "Sub-event Response Slot: %u, Data Status: %s",
4053 tvb_get_uint8(tvb, offset+3),
4054 val_to_str(tvb_get_uint8(tvb, offset+4), ext_adv_data_status_vals, "0x%02x"));
4055 report_tree = proto_item_add_subtree(report_item, ett_adv_subevent_responses);
4057 proto_tree_add_item(report_tree, hf_bthci_evt_tx_power, tvb, offset, 1, ENC_NA);
4058 offset += 1;
4059 proto_tree_add_item(report_tree, hf_bthci_evt_rssi, tvb, offset, 1, ENC_NA);
4060 offset += 1;
4061 proto_tree_add_item(report_tree, hf_bthci_evt_cte_type, tvb, offset, 1, ENC_NA);
4062 offset += 1;
4063 proto_tree_add_item(report_tree, hf_bthci_evt_response_slot, tvb, offset, 1, ENC_NA);
4064 offset += 1;
4065 item = proto_tree_add_item(report_tree, hf_bthci_evt_data_status, tvb, offset, 1, ENC_NA);
4066 if (tvb_get_uint8(tvb, offset) == 0xff)
4067 proto_item_append_text(item, " (Failed to receive)");
4068 offset += 1;
4069 proto_tree_add_item(report_tree, hf_bthci_evt_data_length, tvb, offset, 1, ENC_NA);
4070 length = tvb_get_uint8(tvb, offset);
4071 offset += 1;
4072 if (length > 0) {
4073 bluetooth_eir_ad_data_t *ad_data;
4075 ad_data = wmem_new0(pinfo->pool, bluetooth_eir_ad_data_t);
4076 ad_data->interface_id = bluetooth_data->interface_id;
4077 ad_data->adapter_id = bluetooth_data->adapter_id;
4078 ad_data->bd_addr = NULL;
4080 call_dissector_with_data(btcommon_ad_handle, tvb_new_subset_length(tvb, offset, length), pinfo, report_tree, ad_data);
4081 offset += length;
4085 break;
4086 case 0x2B: /* LE Read All Remote Features Complete */
4087 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
4088 status = tvb_get_uint8(tvb, offset);
4089 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
4090 offset += 1;
4091 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4092 offset += 2;
4093 proto_tree_add_item(tree, hf_bthci_evt_max_remote_page, tvb, offset, 1, ENC_NA);
4094 offset += 1;
4095 proto_tree_add_item(tree, hf_bthci_evt_max_valid_page, tvb, offset, 1, ENC_NA);
4096 offset += 1;
4097 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_le_features, ett_le_features,
4098 hfx_bthci_evt_le_features, ENC_LITTLE_ENDIAN);
4099 offset += 8;
4100 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_le_ext_features_1, ett_le_features,
4101 hfx_bthci_evt_le_ext_features_1, ENC_LITTLE_ENDIAN);
4102 offset += 8;
4103 proto_tree_add_item(tree, hf_bthci_evt_reserved, tvb, offset, 232, ENC_NA);
4104 offset += 232;
4105 break;
4106 case 0x2C: /* LE CS Read Remote Supported Capabilities Complete */
4107 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
4108 status = tvb_get_uint8(tvb, offset);
4109 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
4110 offset += 1;
4111 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4112 offset += 2;
4113 offset = dissect_bthci_evt_cs_capabilities(tvb, offset, pinfo, tree);
4114 break;
4115 case 0x2D: /* LE CS Read Remote FAE Table Complete */
4116 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
4117 status = tvb_get_uint8(tvb, offset);
4118 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
4119 offset += 1;
4120 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4121 offset += 2;
4122 proto_tree_add_item(tree, hf_bthci_evt_remote_fae_table, tvb, offset, 72, ENC_NA);
4123 offset += 72;
4124 break;
4125 case 0x2F: /* LE CS Config Complete */
4127 uint32_t con_handle, config_id;
4128 uint8_t action, role, rtt_type;
4129 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
4130 status = tvb_get_uint8(tvb, offset);
4131 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
4132 offset += 1;
4133 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4134 con_handle = tvb_get_letohs(tvb, offset) & 0x0FFF;
4135 offset += 2;
4136 proto_tree_add_item(tree, hf_bthci_evt_config_id, tvb, offset, 1, ENC_NA);
4137 config_id = tvb_get_uint8(tvb, offset);
4138 offset += 1;
4139 proto_tree_add_item(tree, hf_bthci_evt_cs_action, tvb, offset, 1, ENC_NA);
4140 action = tvb_get_uint8(tvb, offset);
4141 offset += 1;
4142 proto_tree_add_item(tree, hf_bthci_evt_main_mode_type, tvb, offset, 1, ENC_NA);
4143 offset += 1;
4144 proto_tree_add_item(tree, hf_bthci_evt_sub_mode_type, tvb, offset, 1, ENC_NA);
4145 offset += 1;
4146 proto_tree_add_item(tree, hf_bthci_evt_min_main_mode_steps, tvb, offset, 1, ENC_NA);
4147 offset += 1;
4148 proto_tree_add_item(tree, hf_bthci_evt_max_main_mode_steps, tvb, offset, 1, ENC_NA);
4149 offset += 1;
4150 proto_tree_add_item(tree, hf_bthci_evt_main_mode_repetition, tvb, offset, 1, ENC_NA);
4151 offset += 1;
4152 proto_tree_add_item(tree, hf_bthci_evt_mode_0_steps, tvb, offset, 1, ENC_NA);
4153 offset += 1;
4154 proto_tree_add_item(tree, hf_bthci_evt_cs_role, tvb, offset, 1, ENC_NA);
4155 role = tvb_get_uint8(tvb, offset);
4156 offset += 1;
4157 proto_tree_add_item(tree, hf_bthci_evt_rtt_type, tvb, offset, 1, ENC_NA);
4158 rtt_type = tvb_get_uint8(tvb, offset);
4159 offset += 1;
4160 proto_tree_add_item(tree, hf_bthci_evt_cs_sync_phy, tvb, offset, 1, ENC_NA);
4161 offset += 1;
4162 proto_tree_add_item(tree, hf_bthci_evt_channel_map, tvb, offset, 10, ENC_NA);
4163 offset += 10;
4164 proto_tree_add_item(tree, hf_bthci_evt_channel_map_repetition, tvb, offset, 1, ENC_NA);
4165 offset += 1;
4166 proto_tree_add_item(tree, hf_bthci_evt_channel_selection_type, tvb, offset, 1, ENC_NA);
4167 offset += 1;
4168 proto_tree_add_item(tree, hf_bthci_evt_ch3c_shape, tvb, offset, 1, ENC_NA);
4169 offset += 1;
4170 proto_tree_add_item(tree, hf_bthci_evt_ch3c_jump, tvb, offset, 1, ENC_NA);
4171 offset += 1;
4172 proto_tree_add_item(tree, hf_bthci_evt_companion_signal_enable, tvb, offset, 1, ENC_NA);
4173 offset += 1;
4174 proto_tree_add_item(tree, hf_bthci_evt_t_ip1_time, tvb, offset, 1, ENC_NA);
4175 offset += 1;
4176 proto_tree_add_item(tree, hf_bthci_evt_t_ip2_time, tvb, offset, 1, ENC_NA);
4177 offset += 1;
4178 proto_tree_add_item(tree, hf_bthci_evt_t_fcs_time, tvb, offset, 1, ENC_NA);
4179 offset += 1;
4180 proto_tree_add_item(tree, hf_bthci_evt_t_pm_time, tvb, offset, 1, ENC_NA);
4181 offset += 1;
4183 if (!pinfo->fd->visited && action && status == STATUS_SUCCESS) {
4184 /* store CS role and RTT type configuration for later dissection of CS results */
4185 wmem_tree_key_t key[6];
4186 uint32_t interface_id;
4187 uint32_t adapter_id;
4188 uint32_t frame_number;
4189 cs_configuration_t *cs_configuration;
4191 interface_id = bluetooth_data->interface_id;
4192 adapter_id = bluetooth_data->adapter_id;
4193 frame_number = pinfo->num;
4195 key[0].length = 1;
4196 key[0].key = &interface_id;
4197 key[1].length = 1;
4198 key[1].key = &adapter_id;
4199 key[2].length = 1;
4200 key[2].key = &con_handle;
4201 key[3].length = 1;
4202 key[3].key = &config_id;
4203 key[4].length = 1;
4204 key[4].key = &frame_number;
4205 key[5].length = 0;
4206 key[5].key = NULL;
4208 cs_configuration = (cs_configuration_t *) wmem_new(wmem_file_scope(), cs_configuration_t);
4209 cs_configuration->cs_role = role;
4210 cs_configuration->rtt_type = rtt_type;
4211 wmem_tree_insert32_array(bluetooth_data->cs_configurations, key, cs_configuration);
4214 break;
4215 case 0x30: /* LE CS Procedure Enable Complete */
4216 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
4217 status = tvb_get_uint8(tvb, offset);
4218 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
4219 offset += 1;
4220 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4221 offset += 2;
4222 proto_tree_add_item(tree, hf_bthci_evt_config_id, tvb, offset, 1, ENC_NA);
4223 offset += 1;
4224 proto_tree_add_item(tree, hf_bthci_evt_cs_state, tvb, offset, 1, ENC_NA);
4225 offset += 1;
4226 proto_tree_add_item(tree, hf_bthci_evt_tone_antenna_selection, tvb, offset, 1, ENC_NA);
4227 offset += 1;
4228 proto_tree_add_item(tree, hf_bthci_evt_tx_power, tvb, offset, 1, ENC_NA);
4229 offset += 1;
4230 proto_tree_add_item(tree, hf_bthci_evt_cs_subevent_len, tvb, offset, 3, ENC_LITTLE_ENDIAN);
4231 offset += 3;
4232 proto_tree_add_item(tree, hf_bthci_evt_cs_subevents_per_event, tvb, offset, 1, ENC_NA);
4233 offset += 1;
4234 proto_tree_add_item(tree, hf_bthci_evt_cs_subevent_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4235 offset += 2;
4236 proto_tree_add_item(tree, hf_bthci_evt_cs_event_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4237 offset += 2;
4238 proto_tree_add_item(tree, hf_bthci_evt_cs_procedure_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4239 offset += 2;
4240 proto_tree_add_item(tree, hf_bthci_evt_cs_procedure_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4241 offset += 2;
4242 proto_tree_add_item(tree, hf_bthci_evt_max_procedure_len, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4243 offset += 2;
4244 break;
4245 case 0x31: /* LE CS Subevent Result */
4246 case 0x32: /* LE CS Subevent Result Continue */
4248 uint32_t interface_id, adapter_id, con_handle, config_id;
4249 cs_configuration_t *cs_configuration;
4250 wmem_tree_t *subtree;
4251 wmem_tree_key_t key[5];
4252 uint8_t steps, step_counter;
4253 bool initiator = true, sounding_seq = false;
4254 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4255 con_handle = tvb_get_letohs(tvb, offset) & 0x0FFF;
4256 offset += 2;
4257 proto_tree_add_item(tree, hf_bthci_evt_config_id, tvb, offset, 1, ENC_NA);
4258 config_id = tvb_get_uint8(tvb, offset);
4259 offset += 1;
4260 if (subevent_code == 0x31) {
4261 proto_tree_add_item(tree, hf_bthci_evt_start_acl_conn_event, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4262 offset += 2;
4263 proto_tree_add_item(tree, hf_bthci_evt_procedure_counter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4264 offset += 2;
4265 proto_tree_add_item(tree, hf_bthci_evt_freq_compensation, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4266 offset += 2;
4267 proto_tree_add_item(tree, hf_bthci_evt_ref_power_level, tvb, offset, 1, ENC_NA);
4268 offset += 1;
4270 proto_tree_add_item(tree, hf_bthci_evt_procedure_done_status, tvb, offset, 1, ENC_NA);
4271 offset += 1;
4272 proto_tree_add_item(tree, hf_bthci_evt_subevent_done_status, tvb, offset, 1, ENC_NA);
4273 offset += 1;
4274 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_cs_abort_reason, ett_cs_abort_reason, hfx_bthci_evt_cs_abort_reason, ENC_NA);
4275 offset += 1;
4276 proto_tree_add_item(tree, hf_bthci_evt_num_antenna_paths, tvb, offset, 1, ENC_NA);
4277 offset += 1;
4278 proto_tree_add_item(tree, hf_bthci_evt_num_steps_reported, tvb, offset, 1, ENC_NA);
4279 steps = tvb_get_uint8(tvb, offset);
4280 offset += 1;
4282 /* search CS configurations to find CS role and RTT type needed for dissecting mode-1 step data */
4283 interface_id = bluetooth_data->interface_id;
4284 adapter_id = bluetooth_data->adapter_id;
4285 key[0].length = 1;
4286 key[0].key = &interface_id;
4287 key[1].length = 1;
4288 key[1].key = &adapter_id;
4289 key[2].length = 1;
4290 key[2].key = &con_handle;
4291 key[3].length = 1;
4292 key[3].key = &config_id;
4293 key[4].length = 0;
4294 key[4].key = NULL;
4296 subtree = (wmem_tree_t *) wmem_tree_lookup32_array(bluetooth_data->cs_configurations, key);
4297 cs_configuration = (subtree) ? (cs_configuration_t *) wmem_tree_lookup32_le(subtree, pinfo->num) : NULL;
4298 if (cs_configuration) {
4299 initiator = cs_configuration->cs_role ? false : true;
4300 sounding_seq = (cs_configuration->rtt_type && cs_configuration->rtt_type < 3) ? true : false;
4303 for (step_counter = 0; step_counter < steps; step_counter++) {
4304 offset = dissect_bthci_evt_cs_result_steps(tvb, offset, pinfo, tree, step_counter, initiator, sounding_seq);
4307 break;
4308 case 0x33: /* LE CS Test End */
4309 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
4310 status = tvb_get_uint8(tvb, offset);
4311 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
4312 offset += 1;
4313 break;
4314 case 0x34: /* LE Monitored Advertisers Report */
4315 proto_tree_add_item(tree, hf_bthci_evt_le_peer_address_type, tvb, offset, 1, ENC_NA);
4316 offset += 1;
4317 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, FALSE, bluetooth_data->interface_id, bluetooth_data->adapter_id, bd_addr);
4318 proto_tree_add_item(tree, hf_bthci_evt_monitoring_condition, tvb, offset, 1, ENC_NA);
4319 offset += 1;
4320 break;
4321 case 0x35: /* LE Frame Space Update Complete */
4322 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
4323 status = tvb_get_uint8(tvb, offset);
4324 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
4325 offset += 1;
4326 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4327 offset += 2;
4328 proto_tree_add_item(tree, hf_bthci_evt_initiator, tvb, offset, 1, ENC_NA);
4329 offset += 1;
4330 proto_tree_add_item(tree, hf_bthci_evt_frame_space, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4331 offset += 2;
4332 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_le_phys, ett_phys, hfx_bthci_evt_le_phys, ENC_NA);
4333 offset += 1;
4334 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_spacing_types, ett_spacing_types, hfx_bthci_evt_spacing_types, ENC_LITTLE_ENDIAN);
4335 offset += 2;
4336 break;
4337 default:
4338 break;
4340 return offset;
4343 static int
4344 dissect_bthci_evt_physical_link_complete(tvbuff_t *tvb, int offset,
4345 packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
4347 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4348 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
4349 offset += 1;
4351 proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4352 offset += 1;
4353 return offset;
4356 static int
4357 dissect_bthci_evt_channel_select_physical_link_recovery(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
4359 proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4360 offset += 1;
4361 return offset;
4364 static int
4365 dissect_bthci_evt_disconnect_physical_link_complete(tvbuff_t *tvb, int offset,
4366 packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
4368 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4369 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
4370 offset += 1;
4372 proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4373 offset += 1;
4375 proto_tree_add_item(tree, hf_bthci_evt_reason, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4376 send_hci_summary_reason_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
4377 offset += 1;
4379 return offset;
4382 static int
4383 dissect_bthci_evt_physical_link_loss_early_warning(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
4385 proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4386 offset += 1;
4387 proto_tree_add_item(tree, hf_bthci_evt_link_loss_reason, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4388 offset += 1;
4389 return offset;
4392 static int
4393 dissect_bthci_evt_logical_link_complete(tvbuff_t *tvb, int offset,
4394 packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
4396 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4397 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
4398 offset += 1;
4400 proto_tree_add_item(tree, hf_bthci_evt_logical_link_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4401 offset += 2;
4402 proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4403 offset += 1;
4404 proto_tree_add_item(tree, hf_bthci_evt_flow_spec_identifier, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4405 offset += 1;
4406 return offset;
4409 static int
4410 dissect_bthci_evt_disconnect_logical_link_complete(tvbuff_t *tvb, int offset,
4411 packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
4413 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4414 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
4415 offset += 1;
4417 proto_tree_add_item(tree, hf_bthci_evt_logical_link_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4418 offset += 2;
4420 proto_tree_add_item(tree, hf_bthci_evt_reason, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4421 send_hci_summary_reason_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
4422 offset += 1;
4424 return offset;
4427 static int
4428 dissect_bthci_evt_flow_spec_modify_complete(tvbuff_t *tvb, int offset,
4429 packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
4431 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4432 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
4433 offset += 1;
4435 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4436 offset += 2;
4437 return offset;
4440 static int
4441 dissect_bthci_evt_number_of_completed_data_blocks(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
4443 uint8_t evt_num_handles;
4445 proto_tree_add_item(tree, hf_bthci_evt_total_num_data_blocks, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4446 offset += 2;
4448 evt_num_handles = tvb_get_uint8(tvb, offset);
4449 proto_tree_add_item(tree, hf_bthci_evt_num_handles, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4450 offset += 1;
4452 while (evt_num_handles--) {
4453 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4454 offset += 2;
4455 proto_tree_add_item(tree, hf_bthci_evt_num_compl_packets, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4456 offset += 2;
4457 proto_tree_add_item(tree, hf_bthci_evt_num_compl_blocks, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4458 offset += 2;
4460 return offset;
4463 static int
4464 dissect_bthci_evt_amp_start_stop_test(tvbuff_t *tvb, int offset,
4465 packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
4467 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4468 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
4469 offset += 1;
4471 proto_tree_add_item(tree, hf_bthci_evt_test_scenario, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4472 offset += 1;
4473 return offset;
4476 static int
4477 dissect_bthci_evt_amp_receiver_test(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
4479 proto_tree_add_item(tree, hf_bthci_evt_amp_controller_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4480 offset += 1;
4481 proto_tree_add_item(tree, hf_bthci_evt_report_reason, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4482 offset += 1;
4483 proto_tree_add_item(tree, hf_bthci_evt_report_event_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4484 offset += 1;
4485 proto_tree_add_item(tree, hf_bthci_evt_num_frames, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4486 offset += 2;
4487 proto_tree_add_item(tree, hf_bthci_evt_num_error_frames, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4488 offset += 2;
4489 proto_tree_add_item(tree, hf_bthci_evt_num_bits, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4490 offset += 4;
4491 proto_tree_add_item(tree, hf_bthci_evt_num_error_bits, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4492 offset += 4;
4493 return offset;
4496 static int
4497 dissect_bthci_evt_short_range_mode_change_complete(tvbuff_t *tvb, int offset,
4498 packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
4500 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4501 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
4502 offset += 1;
4504 proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4505 offset += 1;
4506 proto_tree_add_item(tree, hf_bthci_evt_short_range_mode_state, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4507 offset += 1;
4508 return offset;
4511 static int
4512 dissect_bthci_evt_amp_status_change(tvbuff_t *tvb, int offset,
4513 packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
4515 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4516 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
4517 offset += 1;
4519 proto_tree_add_item(tree, hf_bthci_evt_amp_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4520 offset += 1;
4521 return offset;
4524 static int
4525 dissect_bthci_evt_sam_status_change(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
4527 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4528 offset += 2;
4530 proto_tree_add_item(tree, hf_bthci_evt_local_sam_index, tvb, offset, 1, ENC_NA);
4531 offset += 1;
4533 proto_tree_add_item(tree, hf_bthci_evt_local_sam_tx_availability, tvb, offset, 1, ENC_NA);
4534 offset += 1;
4536 proto_tree_add_item(tree, hf_bthci_evt_local_sam_rx_availability, tvb, offset, 1, ENC_NA);
4537 offset += 1;
4539 proto_tree_add_item(tree, hf_bthci_evt_remote_sam_index, tvb, offset, 1, ENC_NA);
4540 offset += 1;
4542 proto_tree_add_item(tree, hf_bthci_evt_remote_sam_tx_availability, tvb, offset, 1, ENC_NA);
4543 offset += 1;
4545 proto_tree_add_item(tree, hf_bthci_evt_remote_sam_rx_availability, tvb, offset, 1, ENC_NA);
4546 offset += 1;
4547 return offset;
4550 static int
4551 dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset,
4552 packet_info *pinfo, proto_tree *main_tree, proto_tree *tree,
4553 wmem_list_t *opcode_list, bluetooth_data_t *bluetooth_data, uint32_t *out_opcode)
4555 proto_item *ti_opcode;
4556 proto_tree *opcode_tree;
4557 proto_item *item;
4558 uint8_t num8;
4559 unsigned i;
4560 uint8_t ogf;
4561 uint32_t accuracy;
4562 uint8_t bd_addr[6];
4563 bool local_addr = false;
4564 int hfx;
4565 uint8_t status;
4566 wmem_tree_key_t key[4];
4567 uint32_t interface_id;
4568 uint32_t adapter_id;
4569 uint32_t frame_number;
4570 uint32_t opcode;
4572 proto_tree_add_item(tree, hf_bthci_evt_num_command_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4573 offset += 1;
4575 opcode = tvb_get_letohs(tvb, offset);
4576 ogf = opcode >> 10;
4577 if (out_opcode)
4578 *out_opcode = opcode;
4580 if (have_tap_listener(bluetooth_hci_summary_tap)) {
4581 bluetooth_hci_summary_tap_t *tap_hci_summary;
4583 tap_hci_summary = wmem_new(pinfo->pool, bluetooth_hci_summary_tap_t);
4585 tap_hci_summary->interface_id = bluetooth_data->interface_id;
4586 tap_hci_summary->adapter_id = bluetooth_data->adapter_id;
4588 tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_EVENT_OPCODE;
4589 tap_hci_summary->ogf = ogf;
4590 tap_hci_summary->ocf = opcode & 0x03ff;
4591 tap_hci_summary->event = 0x0e; /* Command Complete */
4592 if (try_val_to_str_ext(opcode, &bthci_cmd_opcode_vals_ext))
4593 tap_hci_summary->name = val_to_str_ext(opcode, &bthci_cmd_opcode_vals_ext, "Unknown 0x%04x");
4594 else
4595 tap_hci_summary->name = NULL;
4596 tap_queue_packet(bluetooth_hci_summary_tap, pinfo, tap_hci_summary);
4599 interface_id = bluetooth_data->interface_id;
4600 adapter_id = bluetooth_data->adapter_id;
4601 frame_number = pinfo->num;
4603 ti_opcode = proto_tree_add_item(tree, hf_bthci_evt_opcode, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4604 opcode_tree = proto_item_add_subtree(ti_opcode, ett_opcode);
4605 proto_tree_add_item(opcode_tree, hf_bthci_evt_ogf, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4607 if (ogf == HCI_OGF_LINK_CONTROL)
4608 hfx = hf_bthci_evt_ocf_link_control;
4609 else if (ogf == HCI_OGF_LINK_POLICY)
4610 hfx = hf_bthci_evt_ocf_link_policy;
4611 else if (ogf == HCI_OGF_HOST_CONTROLLER)
4612 hfx = hf_bthci_evt_ocf_host_controller_and_baseband;
4613 else if (ogf == HCI_OGF_INFORMATIONAL)
4614 hfx = hf_bthci_evt_ocf_informational;
4615 else if (ogf == HCI_OGF_STATUS)
4616 hfx = hf_bthci_evt_ocf_status;
4617 else if (ogf == HCI_OGF_TESTING)
4618 hfx = hf_bthci_evt_ocf_testing;
4619 else if (ogf == HCI_OGF_LOW_ENERGY)
4620 hfx = hf_bthci_evt_ocf_low_energy;
4621 else if (ogf == HCI_OGF_LOGO_TESTING)
4622 hfx = hf_bthci_evt_ocf_logo_testing;
4623 else
4624 hfx = hf_bthci_evt_ocf;
4625 proto_tree_add_item(opcode_tree, hfx, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4626 offset += 2;
4628 if (ogf == HCI_OGF_VENDOR_SPECIFIC) {
4629 col_append_fstr(pinfo->cinfo, COL_INFO, " (Vendor Command 0x%04X [opcode 0x%04X])", opcode & 0x03ff, opcode);
4631 if (!dissector_try_payload_with_data(hci_cmd_vendor_dissector_table, tvb, pinfo, main_tree, true, bluetooth_data)) {
4632 if (bluetooth_data) {
4633 hci_vendor_data_t *hci_vendor_data;
4635 interface_id = bluetooth_data->interface_id;
4636 adapter_id = bluetooth_data->adapter_id;
4638 key[0].length = 1;
4639 key[0].key = &interface_id;
4640 key[1].length = 1;
4641 key[1].key = &adapter_id;
4642 key[2].length = 0;
4643 key[2].key = NULL;
4645 hci_vendor_data = (hci_vendor_data_t *) wmem_tree_lookup32_array(bluetooth_data->hci_vendors, key);
4646 if (hci_vendor_data) {
4647 int sub_offset = 0;
4649 if (bthci_vendor_android) {
4650 sub_offset = dissector_try_uint_with_data(hci_vendor_table, bthci_vendor_manufacturer_android, tvb, pinfo, tree, true, bluetooth_data);
4651 } else {
4652 sub_offset = dissector_try_uint_with_data(hci_vendor_table, hci_vendor_data->manufacturer, tvb, pinfo, main_tree, true, bluetooth_data);
4655 if (sub_offset > 0 && sub_offset < tvb_captured_length_remaining(tvb, offset))
4656 proto_tree_add_expert(tree, pinfo, &ei_parameter_unexpected, tvb, offset + sub_offset, tvb_captured_length_remaining(tvb, sub_offset + offset));
4661 proto_tree_add_item(tree, hf_bthci_evt_ret_params, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
4662 offset = tvb_captured_length(tvb);
4663 } else {
4664 col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)",
4665 val_to_str_ext(opcode, &bthci_cmd_opcode_vals_ext, "Unknown 0x%04x"));
4668 if (ogf != HCI_OGF_VENDOR_SPECIFIC) switch(opcode) {
4669 /* This is a list of Commands that all return just the status */
4670 case 0x0402: /* Inquiry Cancel */
4671 case 0x0403: /* Periodic Inquiry Mode */
4672 case 0x0404: /* Exit Periodic Enquiry Mode */
4673 case 0x080f: /* Write Default Link Policy Settings */
4674 case 0x0c01: /* Set Event Mask */
4675 case 0x0c03: /* Reset */
4676 case 0x0c05: /* Set Event Filter */
4677 case 0x0c0a: /* Write PIN Type */
4678 case 0x0c0b: /* Create Unit Key */
4679 case 0x0c13: /* Change Local Name */
4680 case 0x0c16: /* Write Connection Accept Timeout */
4681 case 0x0c18: /* Write Page Timeout */
4682 case 0x0c1a: /* Write Scan Enable */
4683 case 0x0c1c: /* Write Page Scan Activity */
4684 case 0x0c1e: /* Write Inquiry Scan Activity */
4685 case 0x0c20: /* Write Authentication Enable */
4686 case 0x0c22: /* Write Encryption Mode */
4687 case 0x0c24: /* Write Class of Device */
4688 case 0x0c26: /* Write Voice Setting */
4689 case 0x0c2a: /* Write Num Broadcast Retransmissions */
4690 case 0x0c2c: /* Write Hold Mode Activity */
4691 case 0x0c2f: /* Write SCO Flow Control Enable */
4692 case 0x0c31: /* Set Host Controller To Host Flow Control */
4693 case 0x0c33: /* Host Buffer Size */
4694 case 0x0c3a: /* Write Current IAC LAP */
4695 case 0x0c3c: /* Write Page Scan Period Mode */
4696 case 0x0c3e: /* Write Page Scan Mode */
4697 case 0x0c3f: /* Set AFH Host Channel Classification */
4698 case 0x0c43: /* Write Inquiry Scan Type */
4699 case 0x0c45: /* Write Inquiry Mode */
4700 case 0x0c47: /* Write Page Scan Type */
4701 case 0x0c49: /* Write AFH Channel Assessment Mode */
4702 case 0x0c52: /* Write Extended Inquiry Response */
4703 case 0x0c56: /* Write Simple Pairing Mode */
4704 case 0x0c59: /* Write Inquiry Tx Power Level */
4705 case 0x0c5b: /* Write Default Erroneous Data Reporting */
4706 case 0x0c62: /* Write Logical Link Accept Timeout */
4707 case 0x0c63: /* Set Event Mask Page 2 */
4708 case 0x0c65: /* Write Location Data */
4709 case 0x0c67: /* Write Flow Control Mode */
4710 case 0x0c6a: /* Write Best Effort Timeout */
4711 case 0x0c6d: /* Write LE Host Supported */
4712 case 0x0c6e: /* Set MWS Channel Parameters */
4713 case 0x0c6f: /* Set External Frame Configuration */
4714 case 0x0c71: /* Set MWS Transport Layer */
4715 case 0x0c72: /* Set MWS Scan Frequency Table */
4716 case 0x0c73: /* Set MWS Pattern Configuration */
4717 case 0x0c7a: /* Write Secure Connections Host Support */
4718 case 0x0c7f: /* Write Extended Page Timeout */
4719 case 0x0c81: /* Write Extended Inquiry Length */
4720 case 0x0c82: /* Set Ecosystem Base Interval */
4721 case 0x0c83: /* Configure Data Path */
4722 case 0x0c84: /* Set Min Encryption Key Size */
4723 case 0x140d: /* Set Triggered Clock Capture */
4724 case 0x1802: /* Write Loopback Mode */
4725 case 0x1803: /* Enable Device Under Test Mode */
4726 case 0x1804: /* Write Simple Pairing Debug Mode */
4727 case 0x1807: /* Enable AMP Receiver Reports */
4728 case 0x1808: /* AMP Test End */
4729 case 0x1809: /* AMP Test */
4730 case 0x2001: /* LE Set Event Mask */
4731 case 0x2005: /* LE Set Random Address */
4732 case 0x2006: /* LE Set Advertising Parameters */
4733 case 0x2008: /* LE Set Advertising Data */
4734 case 0x2009: /* LE Set Scan Response Data */
4735 case 0x200a: /* LE Set Advertise Enable */
4736 case 0x200b: /* LE Set Scan Parameters */
4737 case 0x200c: /* LE Set Scan Enable */
4738 case 0x200e: /* LE Create Connection Cancel */
4739 case 0x2010: /* LE Clear Filter Accept List */
4740 case 0x2011: /* LE Add Device To Filter Accept List */
4741 case 0x2012: /* LE Remove Device From Filter Accept List */
4742 case 0x2014: /* LE Set Host Channel Classification */
4743 case 0x201d: /* LE Receiver Test [v1] */
4744 case 0x201e: /* LE Transmitter Test [v1] */
4745 case 0x2024: /* LE Write Suggested Default Data Length */
4746 case 0x2027: /* LE Add Device to Resolving List */
4747 case 0x2028: /* LE Remove Device From Resolving List */
4748 case 0x2029: /* LE Clear Resolving List */
4749 case 0x202D: /* LE Set Address Resolution Enable */
4750 case 0x202E: /* LE Set Resolvable Private Address Timeout */
4751 case 0x2031: /* LE Set Default PHY */
4752 case 0x2033: /* LE Receiver Test [v2] */
4753 case 0x2034: /* LE Transmitter Test [v2] */
4754 case 0x2035: /* LE Set Advertising Set Random Address */
4755 case 0x2037: /* LE Set Extended Advertising Data */
4756 case 0x2038: /* LE Set Extended Scan Response Data */
4757 case 0x2039: /* LE Set Extended Advertising Enable */
4758 case 0x203C: /* LE Remove Advertising Set */
4759 case 0x203D: /* LE Clear Advertising Sets */
4760 case 0x203E: /* LE Set Periodic Advertising Parameters */
4761 case 0x203F: /* LE Set Periodic Advertising Data */
4762 case 0x2040: /* LE Set Periodic Advertising Enable */
4763 case 0x2041: /* LE Set Extended Scan Parameters */
4764 case 0x2042: /* LE Set Extended Scan Enable */
4765 case 0x2045: /* LE Periodic Advertising Create Sync Cancel */
4766 case 0x2046: /* LE Periodic Advertising Terminate Sync */
4767 case 0x2047: /* LE Add Device To Periodic Advertiser List */
4768 case 0x2048: /* LE Remove Device From Periodic Advertiser List */
4769 case 0x2049: /* LE Clear Periodic Advertiser List */
4770 case 0x204D: /* LE Write RF Path Compensation */
4771 case 0x204E: /* LE Set Privacy Mode */
4772 case 0x204F: /* LE Receiver Test [v3] */
4773 case 0x2050: /* LE Transmitter Test [v3] */
4774 case 0x2051: /* LE Set Connectionless CTE Transmit Parameters */
4775 case 0x2052: /* LE Set Connectionless CTE Transmit Enable */
4776 case 0x2059: /* LE Set Periodic Advertising Receive Enable */
4777 case 0x205D: /* LE Set Default Periodic Advertising Sync Transfer Parameters */
4778 case 0x205F: /* LE Modify Sleep Clock Accuracy */
4779 case 0x2074: /* LE Set Host Feature */
4780 case 0x207B: /* LE Transmitter Test [v4] */
4781 case 0x207C: /* LE Set Data Related Address Changes */
4782 case 0x207D: /* LE Set Default Subrate */
4783 case 0x2080: /* LE Set Decision Data */
4784 case 0x2081: /* LE Set Decision Instructions */
4785 case 0x2092: /* LE CS Channel Classification */
4786 case 0x2095: /* LE CS Test */
4787 case 0x2098: /* LE Add Device To Monitoring Advertisers List */
4788 case 0x2099: /* LE Remove Device From Monitoring Advertisers List */
4789 case 0x209A: /* LE Clear Monitoring Advertisers List */
4790 case 0x209C: /* LE Enable Monitoring Advertisers */
4791 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4792 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
4793 offset += 1;
4794 break;
4796 /* This is a list of Commands that all return status and BD_ADDR */
4797 case 0x1009: /* Read BD_ADDR */
4798 local_addr = true;
4800 /* FALLTHROUGH */
4801 case 0x0408: /* Create Connection Cancel */
4802 case 0x040b: /* Link Key Request Reply */
4803 case 0x040c: /* Link Key Request Negative Reply */
4804 case 0x040d: /* PIN Code Request Reply */
4805 case 0x040e: /* PIN Code Request Negative Reply */
4806 case 0x041a: /* Remote Name Request Cancel */
4807 case 0x042b: /* IO Capability Request Reply */
4808 case 0x042c: /* User Confirmation Request Reply */
4809 case 0x042d: /* User Confirmation Request Negative Reply */
4810 case 0x042e: /* User Passkey Request Reply */
4811 case 0x042f: /* User Passkey Request Negative Reply */
4812 case 0x0430: /* Remote OOB Data Request Reply */
4813 case 0x0433: /* Remote OOB Data Request Negative Reply */
4814 case 0x0434: /* IO Capability Request Negative Reply */
4815 case 0x0440: /* Truncated Page Cancel */
4816 case 0x0445: /* Remote OOB Extended Data Request Reply */
4817 case 0x0c60: /* Send Keypress Notification */
4818 case 0x202B: /* LE Read Peer Resolvable Address */
4819 case 0x202C: /* LE Read Local Resolvable Address */
4820 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4821 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
4822 offset += 1;
4824 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, local_addr, bluetooth_data->interface_id, bluetooth_data->adapter_id, bd_addr);
4825 if (!pinfo->fd->visited && local_addr) {
4826 localhost_bdaddr_entry_t *localhost_bdaddr_entry;
4828 interface_id = bluetooth_data->interface_id;
4829 adapter_id = bluetooth_data->adapter_id;
4830 frame_number = pinfo->num;
4832 key[0].length = 1;
4833 key[0].key = &interface_id;
4834 key[1].length = 1;
4835 key[1].key = &adapter_id;
4836 key[2].length = 1;
4837 key[2].key = &frame_number;
4838 key[3].length = 0;
4839 key[3].key = NULL;
4841 localhost_bdaddr_entry = (localhost_bdaddr_entry_t *) wmem_new(wmem_file_scope(), localhost_bdaddr_entry_t);
4842 localhost_bdaddr_entry->interface_id = interface_id;
4843 localhost_bdaddr_entry->adapter_id = adapter_id;
4844 memcpy(localhost_bdaddr_entry->bd_addr, bd_addr, 6);
4845 wmem_tree_insert32_array(bluetooth_data->localhost_bdaddr, key, localhost_bdaddr_entry);
4848 if (local_addr && have_tap_listener(bluetooth_device_tap)) {
4849 bluetooth_device_tap_t *tap_device;
4851 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
4852 if (bluetooth_data) {
4853 tap_device->interface_id = bluetooth_data->interface_id;
4854 tap_device->adapter_id = bluetooth_data->adapter_id;
4855 } else {
4856 tap_device->interface_id = HCI_INTERFACE_DEFAULT;
4857 tap_device->adapter_id = HCI_ADAPTER_DEFAULT;
4859 memcpy(tap_device->bd_addr, bd_addr, 6);
4860 tap_device->has_bd_addr = true;
4861 tap_device->is_local = true;
4862 tap_device->type = BLUETOOTH_DEVICE_LOCAL_ADAPTER;
4863 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
4866 break;
4868 /* This is a list of Commands that all return status and connection_handle */
4869 case 0x080d: /* Write Link Policy Settings */
4870 case 0x0811: /* Sniff Subrating */
4871 case 0x0c08: /* Flush */
4872 case 0x0c28: /* Write Automatic Flush Timeout */
4873 case 0x0c37: /* Write Link Supervision Timeout */
4874 case 0x0c7c: /* Write Authenticated Payload Timeout */
4875 case 0x1402: /* Reset Failed Contact Counter */
4876 case 0x180a: /* Write Secure Connections Test Mode */
4877 case 0x201a: /* LE Long Term Key Request Reply */
4878 case 0x201b: /* LE Long Term Key Request Neg Reply */
4879 case 0x2020: /* LE Remote Connection Parameter Request Reply */
4880 case 0x2021: /* LE Remote Connection Parameter Request Negative Reply */
4881 case 0x2022: /* LE Set Data Length */
4882 case 0x2054: /* LE Set Connection CTE Receive Parameters */
4883 case 0x2055: /* LE Set Connection CTE Transmit Parameters */
4884 case 0x2056: /* LE Connection CTE Request Enable */
4885 case 0x2057: /* LE Connection CTE Response Enable */
4886 case 0x205A: /* LE Periodic Advertising Sync Transfer */
4887 case 0x205B: /* LE Periodic Advertising Set Info Transfer */
4888 case 0x205C: /* LE Set Periodic Advertising Sync Transfer Parameters */
4889 case 0x2078: /* LE Set Path Loss Reporting Parameters */
4890 case 0x2079: /* LE Set Path Loss Reporting Enable */
4891 case 0x207a: /* LE Set Transmit Power Reporting Enable */
4892 case 0x208b: /* LE CS Write Cached Remote Supported Capabilities */
4893 case 0x208d: /* LE CS Set Default Settings */
4894 case 0x208f: /* LE CS Write Cached FAE Table */
4895 case 0x2093: /* LE CS Set Procedure Parameters */
4896 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4897 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
4898 offset += 1;
4900 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4901 offset += 2;
4903 break;
4905 /* This is a list of Commands that all return status and timeout */
4906 case 0x0c15: /* Read Connection Accept Timeout */
4907 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4908 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
4909 offset += 1;
4911 proto_tree_add_item(tree, hf_bthci_evt_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4912 offset += 2;
4914 break;
4915 case 0x0c17: /* Read Page Timeout */
4916 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4917 status = tvb_get_uint8(tvb, offset);
4918 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
4919 offset += 1;
4921 proto_tree_add_item(tree, hf_bthci_evt_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4922 offset += 2;
4924 if (status == STATUS_SUCCESS && have_tap_listener(bluetooth_device_tap)) {
4925 bluetooth_device_tap_t *tap_device;
4927 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
4928 if (bluetooth_data) {
4929 tap_device->interface_id = bluetooth_data->interface_id;
4930 tap_device->adapter_id = bluetooth_data->adapter_id;
4931 } else {
4932 tap_device->interface_id = HCI_INTERFACE_DEFAULT;
4933 tap_device->adapter_id = HCI_ADAPTER_DEFAULT;
4935 tap_device->has_bd_addr = false;
4936 tap_device->is_local = true;
4937 tap_device->type = BLUETOOTH_DEVICE_PAGE_TIMEOUT;
4938 tap_device->data.page_timeout = tvb_get_uint16(tvb, offset - 2, ENC_LITTLE_ENDIAN);
4939 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
4942 break;
4944 /* This is a list of Commands that all return status, connection handle and timeout */
4945 case 0x0c27: /* Read Automatic Flush Timeout */
4946 case 0x0c36: /* Read Link Supervision Timeout */
4947 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4948 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
4949 offset += 1;
4951 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4952 offset += 2;
4954 proto_tree_add_item(tree, hf_bthci_evt_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4955 offset += 2;
4957 break;
4959 /* This is a list of Commands that all return status, interval and window */
4960 case 0x0c1b: /* Read Page Scan Activity */
4961 case 0x0c1d: /* Read Inquiry Scan Activity */
4962 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4963 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
4964 offset += 1;
4966 proto_tree_add_item(tree, hf_bthci_evt_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4967 offset += 2;
4969 proto_tree_add_item(tree, hf_bthci_evt_window, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4970 offset += 2;
4972 break;
4974 case 0x0420: /* Read LMP Handle */
4975 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4976 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
4977 offset += 1;
4979 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4980 offset += 2;
4982 proto_tree_add_item(tree, hf_bthci_evt_lmp_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4983 offset += 1;
4985 /* 4 reserved bytes */
4986 offset += 4;
4987 break;
4989 case 0x043b: /* Logical Link Cancel */
4990 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4991 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
4992 offset += 1;
4994 proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4995 offset += 1;
4997 proto_tree_add_item(tree, hf_bthci_evt_flow_spec_identifier, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4998 offset += 1;
5000 break;
5001 case 0x0809: /* Role Discovery */
5002 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5003 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5004 offset += 1;
5006 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5007 offset += 2;
5009 proto_tree_add_item(tree, hf_bthci_evt_curr_role, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5010 offset += 1;
5012 break;
5014 case 0x080c: /* Read Link Policy Settings */
5015 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5016 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5017 offset += 1;
5019 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5020 offset += 2;
5022 proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_switch, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5023 proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_hold , tvb, offset, 2, ENC_LITTLE_ENDIAN);
5024 proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_sniff , tvb, offset, 2, ENC_LITTLE_ENDIAN);
5025 proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_park , tvb, offset, 2, ENC_LITTLE_ENDIAN);
5026 offset += 2;
5028 break;
5030 case 0x080e: /* Read Default Link Policy Settings */
5031 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5032 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5033 offset += 1;
5035 proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_switch, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5036 proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_hold , tvb, offset, 2, ENC_LITTLE_ENDIAN);
5037 proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_sniff , tvb, offset, 2, ENC_LITTLE_ENDIAN);
5038 proto_tree_add_item(tree, hf_bthci_evt_link_policy_setting_park , tvb, offset, 2, ENC_LITTLE_ENDIAN);
5039 offset += 2;
5041 break;
5043 case 0x0c09: /* Read PIN Type */
5044 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5045 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5046 offset += 1;
5048 proto_tree_add_item(tree, hf_bthci_evt_pin_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5049 offset += 1;
5051 break;
5053 case 0x0c0d: /* Read Stored Link Key */
5054 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5055 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5056 offset += 1;
5058 proto_tree_add_item(tree, hf_bthci_evt_max_num_keys, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5059 offset += 2;
5061 proto_tree_add_item(tree, hf_bthci_evt_num_keys_read, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5062 offset += 2;
5064 break;
5066 case 0x0c11: /* Write Stored Link Key */
5067 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5068 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5069 offset += 1;
5071 proto_tree_add_item(tree, hf_bthci_evt_num_keys_written, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5072 offset += 1;
5074 break;
5076 case 0x0c12: /* Delete Stored Link Key */
5077 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5078 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5079 offset += 1;
5081 proto_tree_add_item(tree, hf_bthci_evt_num_keys_deleted, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5082 offset += 2;
5084 break;
5086 case 0x0c14: /* Read Local Name */
5087 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5088 status = tvb_get_uint8(tvb, offset);
5089 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
5090 offset += 1;
5092 proto_tree_add_item(tree, hf_bthci_evt_device_name, tvb, offset, 248, ENC_UTF_8);
5093 if (status == STATUS_SUCCESS && !pinfo->fd->visited) {
5094 char *name;
5095 localhost_name_entry_t *localhost_name_entry;
5097 name = tvb_get_string_enc(pinfo->pool, tvb, offset, 248, ENC_UTF_8);
5099 key[0].length = 1;
5100 key[0].key = &interface_id;
5101 key[1].length = 1;
5102 key[1].key = &adapter_id;
5103 key[2].length = 1;
5104 key[2].key = &frame_number;
5105 key[3].length = 0;
5106 key[3].key = NULL;
5108 localhost_name_entry = (localhost_name_entry_t *) wmem_new(wmem_file_scope(), localhost_name_entry_t);
5109 localhost_name_entry->interface_id = interface_id;
5110 localhost_name_entry->adapter_id = adapter_id;
5111 localhost_name_entry->name = wmem_strdup(wmem_file_scope(), name);
5113 wmem_tree_insert32_array(bluetooth_data->localhost_name, key, localhost_name_entry);
5116 if (status == STATUS_SUCCESS && have_tap_listener(bluetooth_device_tap)) {
5117 bluetooth_device_tap_t *tap_device;
5119 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
5120 if (bluetooth_data) {
5121 tap_device->interface_id = bluetooth_data->interface_id;
5122 tap_device->adapter_id = bluetooth_data->adapter_id;
5123 } else {
5124 tap_device->interface_id = HCI_INTERFACE_DEFAULT;
5125 tap_device->adapter_id = HCI_ADAPTER_DEFAULT;
5127 tap_device->has_bd_addr = false;
5128 tap_device->is_local = true;
5129 tap_device->type = BLUETOOTH_DEVICE_NAME;
5130 tap_device->data.name = tvb_get_string_enc(pinfo->pool, tvb, offset, 248, ENC_UTF_8);
5131 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
5133 offset += 248;
5135 break;
5137 case 0x0c19: /* Read Scan Enable */
5138 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5139 status = tvb_get_uint8(tvb, offset);
5140 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
5141 offset += 1;
5143 proto_tree_add_item(tree, hf_bthci_evt_scan_enable, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5144 offset += 1;
5146 if (status == STATUS_SUCCESS && have_tap_listener(bluetooth_device_tap)) {
5147 bluetooth_device_tap_t *tap_device;
5149 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
5150 if (bluetooth_data) {
5151 tap_device->interface_id = bluetooth_data->interface_id;
5152 tap_device->adapter_id = bluetooth_data->adapter_id;
5153 } else {
5154 tap_device->interface_id = HCI_INTERFACE_DEFAULT;
5155 tap_device->adapter_id = HCI_ADAPTER_DEFAULT;
5157 tap_device->has_bd_addr = false;
5158 tap_device->is_local = true;
5159 tap_device->type = BLUETOOTH_DEVICE_SCAN;
5160 tap_device->data.scan = tvb_get_uint8(tvb, offset - 1);
5161 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
5164 break;
5166 case 0x0c1f: /* Read Authentication Enable */
5167 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5168 status = tvb_get_uint8(tvb, offset);
5169 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
5170 offset += 1;
5172 proto_tree_add_item(tree, hf_bthci_evt_authentication_enable, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5173 offset += 1;
5175 if (status == STATUS_SUCCESS && have_tap_listener(bluetooth_device_tap)) {
5176 bluetooth_device_tap_t *tap_device;
5178 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
5179 if (bluetooth_data) {
5180 tap_device->interface_id = bluetooth_data->interface_id;
5181 tap_device->adapter_id = bluetooth_data->adapter_id;
5182 } else {
5183 tap_device->interface_id = HCI_INTERFACE_DEFAULT;
5184 tap_device->adapter_id = HCI_ADAPTER_DEFAULT;
5186 tap_device->has_bd_addr = false;
5187 tap_device->is_local = true;
5188 tap_device->type = BLUETOOTH_DEVICE_AUTHENTICATION;
5189 tap_device->data.class_of_device = tvb_get_uint8(tvb, offset - 1);
5190 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
5193 break;
5194 case 0x0c21: /* Read Encryption Mode */
5195 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5196 status = tvb_get_uint8(tvb, offset);
5197 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
5198 offset += 1;
5200 proto_tree_add_item(tree, hf_bthci_evt_encryption_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5201 offset += 1;
5203 if (status == STATUS_SUCCESS && have_tap_listener(bluetooth_device_tap)) {
5204 bluetooth_device_tap_t *tap_device;
5206 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
5207 if (bluetooth_data) {
5208 tap_device->interface_id = bluetooth_data->interface_id;
5209 tap_device->adapter_id = bluetooth_data->adapter_id;
5210 } else {
5211 tap_device->interface_id = HCI_INTERFACE_DEFAULT;
5212 tap_device->adapter_id = HCI_ADAPTER_DEFAULT;
5214 tap_device->has_bd_addr = false;
5215 tap_device->is_local = true;
5216 tap_device->type = BLUETOOTH_DEVICE_ENCRYPTION;
5217 tap_device->data.class_of_device = tvb_get_uint8(tvb, offset - 1);
5218 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
5221 break;
5223 case 0x0c23: /* Read Class of Device */
5224 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5225 status = tvb_get_uint8(tvb, offset);
5226 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
5227 offset += 1;
5229 call_dissector(btcommon_cod_handle, tvb_new_subset_length(tvb, offset, 3), pinfo, tree);
5230 offset += 3;
5232 if (status == STATUS_SUCCESS && have_tap_listener(bluetooth_device_tap)) {
5233 bluetooth_device_tap_t *tap_device;
5235 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
5236 if (bluetooth_data) {
5237 tap_device->interface_id = bluetooth_data->interface_id;
5238 tap_device->adapter_id = bluetooth_data->adapter_id;
5239 } else {
5240 tap_device->interface_id = HCI_INTERFACE_DEFAULT;
5241 tap_device->adapter_id = HCI_ADAPTER_DEFAULT;
5243 tap_device->has_bd_addr = false;
5244 tap_device->is_local = true;
5245 tap_device->type = BLUETOOTH_DEVICE_CLASS_OF_DEVICE;
5246 tap_device->data.class_of_device = tvb_get_uint24(tvb, offset - 3, ENC_LITTLE_ENDIAN);
5247 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
5250 break;
5252 case 0x0c25: /* Read Voice Setting */
5253 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5254 status = tvb_get_uint8(tvb, offset);
5255 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
5256 offset += 1;
5258 proto_tree_add_item(tree, hf_bthci_evt_input_unused, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5259 proto_tree_add_item(tree, hf_bthci_evt_input_coding, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5260 proto_tree_add_item(tree, hf_bthci_evt_input_data_format, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5261 proto_tree_add_item(tree, hf_bthci_evt_input_sample_size, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5262 proto_tree_add_item(tree, hf_bthci_evt_linear_pcm_bit_pos, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5263 proto_tree_add_item(tree, hf_bthci_evt_air_coding_format, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5264 offset += 2;
5266 if (status == STATUS_SUCCESS && have_tap_listener(bluetooth_device_tap)) {
5267 bluetooth_device_tap_t *tap_device;
5269 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
5270 if (bluetooth_data) {
5271 tap_device->interface_id = bluetooth_data->interface_id;
5272 tap_device->adapter_id = bluetooth_data->adapter_id;
5273 } else {
5274 tap_device->interface_id = HCI_INTERFACE_DEFAULT;
5275 tap_device->adapter_id = HCI_ADAPTER_DEFAULT;
5277 tap_device->has_bd_addr = false;
5278 tap_device->is_local = true;
5279 tap_device->type = BLUETOOTH_DEVICE_VOICE_SETTING;
5280 tap_device->data.voice_setting = tvb_get_uint16(tvb, offset - 2, ENC_LITTLE_ENDIAN);
5281 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
5284 break;
5286 case 0x0c29: /* Read Num Broadcast Retransmissions */
5287 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5288 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5289 offset += 1;
5291 proto_tree_add_item(tree, hf_bthci_evt_num_broadcast_retransm, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5292 offset += 1;
5294 break;
5296 case 0x0c2b: /* Read Hold Mode Activity */
5297 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5298 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5299 offset += 1;
5301 proto_tree_add_item(tree, hf_bthci_evt_hold_mode_act_page, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5302 proto_tree_add_item(tree, hf_bthci_evt_hold_mode_act_inquiry, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5303 proto_tree_add_item(tree, hf_bthci_evt_hold_mode_act_periodic, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5304 offset += 1;
5306 break;
5308 case 0x0c2d: /* Read Transmit Power Level */
5309 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5310 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5311 offset += 1;
5313 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5314 offset += 2;
5316 proto_tree_add_item(tree, hf_bthci_evt_transmit_power_level, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5317 offset += 1;
5319 break;
5321 case 0x0c2e: /* Read SCO Flow Control Enable */
5322 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5323 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5324 offset += 1;
5326 proto_tree_add_item(tree, hf_bthci_evt_sco_flow_cont_enable, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5327 offset += 1;
5329 break;
5332 case 0x0c38: /* Read Number of Supported IAC */
5333 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5334 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5335 offset += 1;
5337 proto_tree_add_item(tree, hf_bthci_evt_num_supp_iac, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5338 offset += 1;
5340 break;
5342 case 0x0c39: /* Read Current IAC LAP */
5343 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5344 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5345 offset += 1;
5347 num8 = tvb_get_uint8(tvb, offset);
5348 proto_tree_add_item(tree, hf_bthci_evt_num_curr_iac, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5349 offset += 1;
5351 for (i = 0; i < num8; i++) {
5352 proto_tree_add_item(tree, hf_bthci_evt_iac_lap, tvb, offset, 3, ENC_LITTLE_ENDIAN);
5353 offset += 3;
5355 break;
5357 case 0x0c3b: /* Read Page Scan Period Mode */
5358 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5359 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5360 offset += 1;
5362 proto_tree_add_item(tree, hf_bthci_evt_page_scan_period_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5363 offset += 1;
5365 break;
5367 case 0x0c3d: /* Read Page Scan Mode */
5368 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5369 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5370 offset += 1;
5372 proto_tree_add_item(tree, hf_bthci_evt_page_scan_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5373 offset += 1;
5375 break;
5377 case 0x0c42: /* Read Inquiry Scan Type */
5378 case 0x0c46: /* Read Page Scan Type */
5379 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5380 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5381 offset += 1;
5383 proto_tree_add_item(tree, hf_bthci_evt_scan_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5384 offset += 1;
5385 break;
5387 case 0x0c44: /* Read Inquiry Mode */
5388 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5389 status = tvb_get_uint8(tvb, offset);
5390 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
5391 offset += 1;
5393 proto_tree_add_item(tree, hf_bthci_evt_inq_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5394 offset += 1;
5396 if (status == STATUS_SUCCESS && have_tap_listener(bluetooth_device_tap)) {
5397 bluetooth_device_tap_t *tap_device;
5399 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
5400 if (bluetooth_data) {
5401 tap_device->interface_id = bluetooth_data->interface_id;
5402 tap_device->adapter_id = bluetooth_data->adapter_id;
5403 } else {
5404 tap_device->interface_id = HCI_INTERFACE_DEFAULT;
5405 tap_device->adapter_id = HCI_ADAPTER_DEFAULT;
5407 tap_device->has_bd_addr = false;
5408 tap_device->is_local = true;
5409 tap_device->type = BLUETOOTH_DEVICE_INQUIRY_MODE;
5410 tap_device->data.inquiry_mode = tvb_get_uint8(tvb, offset - 1);
5411 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
5413 break;
5415 case 0x0c48: /* Read AFH Channel Assessment Mode */
5416 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5417 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5418 offset += 1;
5419 proto_tree_add_item(tree, hf_bthci_evt_afh_ch_assessment_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5420 offset += 1;
5421 break;
5423 case 0x0c51: /* Read Extended Inquiry Response */
5425 bluetooth_eir_ad_data_t *eir_data;
5427 eir_data = wmem_new0(pinfo->pool, bluetooth_eir_ad_data_t);
5428 eir_data->interface_id = bluetooth_data->interface_id;
5429 eir_data->adapter_id = bluetooth_data->adapter_id;
5430 eir_data->bd_addr = NULL;
5432 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5433 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5434 offset += 1;
5436 proto_tree_add_item(tree, hf_bthci_evt_fec_required, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5437 offset += 1;
5439 call_dissector_with_data(btcommon_eir_handle, tvb_new_subset_length(tvb, offset, 240), pinfo, tree, eir_data);
5440 offset += 240;
5443 break;
5445 case 0x0c55: /* Read Simple Pairing Mode */
5446 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5447 status = tvb_get_uint8(tvb, offset);
5448 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
5449 offset += 1;
5451 proto_tree_add_item(tree, hf_bthci_evt_simple_pairing_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5452 offset += 1;
5454 if (status == STATUS_SUCCESS && have_tap_listener(bluetooth_device_tap)) {
5455 bluetooth_device_tap_t *tap_device;
5457 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
5458 if (bluetooth_data) {
5459 tap_device->interface_id = bluetooth_data->interface_id;
5460 tap_device->adapter_id = bluetooth_data->adapter_id;
5461 } else {
5462 tap_device->interface_id = HCI_INTERFACE_DEFAULT;
5463 tap_device->adapter_id = HCI_ADAPTER_DEFAULT;
5465 tap_device->has_bd_addr = false;
5466 tap_device->is_local = true;
5467 tap_device->type = BLUETOOTH_DEVICE_SIMPLE_PAIRING_MODE;
5468 tap_device->data.simple_pairing_mode = tvb_get_uint8(tvb, offset - 1);
5469 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
5472 break;
5474 case 0x0c57: /* Read Local OOB Data */
5475 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5476 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5477 offset += 1;
5479 proto_tree_add_item(tree, hf_bthci_evt_hash_c, tvb, offset, 16, ENC_NA);
5480 offset += 16;
5481 proto_tree_add_item(tree, hf_bthci_evt_randomizer_r, tvb, offset, 16, ENC_NA);
5482 offset += 16;
5483 break;
5485 case 0x0c58: /* Read Inquiry Response Tx Power Level */
5486 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5487 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5488 offset += 1;
5490 proto_tree_add_item(tree, hf_bthci_evt_power_level_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5491 offset += 1;
5492 break;
5495 case 0x0c5a: /* Read Default Erroneous Data Reporting */
5496 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5497 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5498 offset += 1;
5500 proto_tree_add_item(tree, hf_bthci_evt_err_data_reporting, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5501 offset += 1;
5503 break;
5505 case 0x0c61: /* Read Logical Link Accept Timeout */
5506 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5507 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5508 offset += 1;
5509 proto_tree_add_item(tree, hf_bthci_evt_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5510 offset += 2;
5511 break;
5513 case 0x0c64: /* Read Location Data */
5514 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5515 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5516 offset += 1;
5517 proto_tree_add_item(tree, hf_bthci_evt_location_domain_aware, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5518 offset += 1;
5519 proto_tree_add_item(tree, hf_bthci_evt_location_domain, tvb, offset, 2, ENC_ASCII | ENC_NA);
5520 offset += 2;
5521 proto_tree_add_item(tree, hf_bthci_evt_location_domain_options, tvb, offset, 1, ENC_ASCII | ENC_NA);
5522 offset += 1;
5523 proto_tree_add_item(tree, hf_bthci_evt_location_options, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5524 offset += 1;
5525 break;
5527 case 0x0c66: /* Read Flow Control Mode */
5528 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5529 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5530 offset += 1;
5531 proto_tree_add_item(tree, hf_bthci_evt_flow_control_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5532 offset += 1;
5533 break;
5535 case 0x0c68: /* Read Enhanced Tx Power Level */
5536 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5537 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5538 offset += 1;
5539 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5540 offset += 2;
5541 proto_tree_add_item(tree, hf_bthci_evt_transmit_power_level_gfsk, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5542 offset += 1;
5543 proto_tree_add_item(tree, hf_bthci_evt_transmit_power_level_dqpsk, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5544 offset += 1;
5545 proto_tree_add_item(tree, hf_bthci_evt_transmit_power_level_8dpsk, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5546 offset += 1;
5547 break;
5549 case 0x0c69: /* Read Best Effort Timeout */
5550 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5551 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5552 offset += 1;
5553 proto_tree_add_item(tree, hf_bthci_evt_flush_to_us, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5554 offset += 4;
5555 break;
5557 case 0x0c6c: /* Read LE Host Supported */
5558 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5559 status = tvb_get_uint8(tvb, offset);
5560 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
5561 offset += 1;
5562 proto_tree_add_item(tree, hf_bthci_evt_le_supported_host, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5563 offset += 1;
5564 proto_tree_add_item(tree, hf_bthci_evt_le_simultaneous_host, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5565 offset += 1;
5566 break;
5568 case 0x0c74: /* Set Reserved LT_ADDR */
5569 case 0x0c75: /* Delete Reserved LT_ADDR */
5570 case 0x0c76: /* Set Connectionless Peripheral Broadcast Data */
5571 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5572 status = tvb_get_uint8(tvb, offset);
5573 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
5574 offset += 1;
5576 proto_tree_add_item(tree, hf_bthci_evt_lt_addr, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5577 offset += 1;
5579 break;
5581 case 0x1001: /* Read Local Version Information */ {
5582 proto_item *hci_revision_item;
5583 proto_item *manufacturer_item;
5584 proto_item *lmp_subversion_item;
5586 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5587 status = tvb_get_uint8(tvb, offset);
5588 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
5589 offset += 1;
5591 proto_tree_add_item(tree, hf_bthci_bthci_evt_hci_version, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5592 offset += 1;
5594 hci_revision_item = proto_tree_add_item(tree, hf_bthci_evt_hci_revision, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5595 offset += 2;
5597 proto_tree_add_item(tree, hf_bthci_evt_vers_nr, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5598 offset += 1;
5600 manufacturer_item = proto_tree_add_item(tree, hf_bthci_evt_comp_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5601 offset += 2;
5603 lmp_subversion_item = proto_tree_add_item(tree, hf_bthci_evt_sub_vers_nr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5604 offset += 2;
5606 if (status == STATUS_SUCCESS) {
5607 hci_vendor_data_t *hci_vendor_data;
5608 uint16_t hci_revision;
5609 uint16_t manufacturer;
5610 uint16_t lmp_subversion;
5612 key[0].length = 1;
5613 key[0].key = &interface_id;
5614 key[1].length = 1;
5615 key[1].key = &adapter_id;
5616 key[2].length = 0;
5617 key[2].key = NULL;
5619 hci_vendor_data = (hci_vendor_data_t *) wmem_tree_lookup32_array(bluetooth_data->hci_vendors, key);
5620 hci_revision = tvb_get_letohs(tvb, offset - 7);
5621 manufacturer = tvb_get_letohs(tvb, offset - 4);
5622 lmp_subversion = tvb_get_letohs(tvb, offset - 2);
5624 if (have_tap_listener(bluetooth_device_tap)) {
5625 bluetooth_device_tap_t *tap_device;
5626 uint8_t hci_version;
5627 uint8_t lmp_version;
5629 hci_version = tvb_get_uint8(tvb, offset - 8);
5630 lmp_version = tvb_get_uint8(tvb, offset - 5);
5632 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
5633 tap_device->type = BLUETOOTH_DEVICE_LOCAL_VERSION;
5634 tap_device->interface_id = interface_id;
5635 tap_device->adapter_id = adapter_id;
5636 tap_device->has_bd_addr = false;
5637 tap_device->is_local = true;
5638 tap_device->data.local_version.hci_version = hci_version;
5639 tap_device->data.local_version.hci_revision = hci_revision;
5640 tap_device->data.local_version.lmp_version = lmp_version;
5641 tap_device->data.local_version.lmp_subversion = lmp_subversion;
5642 tap_device->data.local_version.manufacturer = manufacturer;
5643 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
5646 if (hci_vendor_data) {
5647 proto_tree *sub_tree;
5648 proto_item *sub_item;
5650 if (manufacturer != hci_vendor_data->manufacturer) {
5651 expert_add_info(pinfo, manufacturer_item, &ei_manufacturer_data_changed);
5652 sub_tree = proto_item_add_subtree(manufacturer_item, ett_expert);
5653 sub_item = proto_tree_add_uint(sub_tree, hf_changed_in_frame, tvb, 0, 0, hci_vendor_data->change_in_frame);
5654 proto_item_set_generated(sub_item);
5657 if (hci_revision != hci_vendor_data->hci_revision) {
5658 expert_add_info(pinfo, hci_revision_item, &ei_hci_revision_changed);
5659 sub_tree = proto_item_add_subtree(hci_revision_item, ett_expert);
5660 sub_item = proto_tree_add_uint(sub_tree, hf_changed_in_frame, tvb, 0, 0, hci_vendor_data->change_in_frame);
5661 proto_item_set_generated(sub_item);
5664 if (lmp_subversion != hci_vendor_data->lmp_subversion) {
5665 expert_add_info(pinfo, lmp_subversion_item, &ei_lmp_subversion_changed);
5666 sub_tree = proto_item_add_subtree(lmp_subversion_item, ett_expert);
5667 sub_item = proto_tree_add_uint(sub_tree, hf_changed_in_frame, tvb, 0, 0, hci_vendor_data->change_in_frame);
5668 proto_item_set_generated(sub_item);
5672 if (!pinfo->fd->visited) {
5674 hci_vendor_data_t *new_hci_vendor_data;
5676 new_hci_vendor_data = wmem_new(wmem_file_scope(), hci_vendor_data_t);
5677 new_hci_vendor_data->hci_revision = hci_revision;
5678 new_hci_vendor_data->manufacturer = manufacturer;
5679 new_hci_vendor_data->lmp_subversion = lmp_subversion;
5680 new_hci_vendor_data->change_in_frame = pinfo->num;
5682 if (hci_vendor_data && hci_vendor_data->change_in_frame < pinfo->num)
5683 new_hci_vendor_data->previous = hci_vendor_data;
5684 else
5685 new_hci_vendor_data->previous = NULL;
5687 wmem_tree_insert32_array(bluetooth_data->hci_vendors, key, new_hci_vendor_data);
5691 break;
5693 case 0x1002: /* Read Local Supported Commands */
5694 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
5695 status = tvb_get_uint8(tvb, offset);
5696 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
5697 offset += 1;
5699 proto_tree_add_item(tree, hf_bthci_evt_local_supported_cmds, tvb, offset, 64, ENC_NA);
5700 offset += 64;
5702 break;
5704 case 0x1003: /* Read Local Supported Features */
5705 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
5706 status = tvb_get_uint8(tvb, offset);
5707 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
5708 offset += 1;
5710 offset = dissect_bthci_evt_lmp_features(tvb, offset, pinfo, tree, 0);
5712 break;
5714 case 0x1004: /* Read Local Extended Features */
5716 uint8_t page_number;
5718 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
5719 status = tvb_get_uint8(tvb, offset);
5720 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
5721 offset += 1;
5723 page_number = tvb_get_uint8(tvb, offset);
5724 proto_tree_add_item(tree, hf_bthci_evt_page_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5725 offset += 1;
5727 proto_tree_add_item(tree, hf_bthci_evt_max_page_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5728 offset += 1;
5730 offset = dissect_bthci_evt_lmp_features(tvb, offset, pinfo, tree, page_number);
5733 break;
5735 case 0x1005: /* Read Buffer Size */
5736 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5737 status = tvb_get_uint8(tvb, offset);
5738 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
5739 offset += 1;
5741 proto_tree_add_item(tree, hf_bthci_evt_host_data_packet_length_acl, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5742 offset += 2;
5744 proto_tree_add_item(tree, hf_bthci_evt_host_data_packet_length_sco, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5745 offset += 1;
5747 proto_tree_add_item(tree, hf_bthci_evt_host_total_num_acl_data_packets, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5748 offset += 2;
5750 proto_tree_add_item(tree, hf_bthci_evt_host_total_num_sco_data_packets, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5751 offset += 2;
5753 if (status == STATUS_SUCCESS && have_tap_listener(bluetooth_device_tap)) {
5754 bluetooth_device_tap_t *tap_device;
5756 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
5757 if (bluetooth_data) {
5758 tap_device->interface_id = bluetooth_data->interface_id;
5759 tap_device->adapter_id = bluetooth_data->adapter_id;
5760 } else {
5761 tap_device->interface_id = HCI_INTERFACE_DEFAULT;
5762 tap_device->adapter_id = HCI_ADAPTER_DEFAULT;
5764 tap_device->has_bd_addr = false;
5765 tap_device->is_local = true;
5766 tap_device->type = BLUETOOTH_DEVICE_MTUS;
5767 tap_device->data.mtus.acl_mtu = tvb_get_uint16(tvb, offset - 7, ENC_LITTLE_ENDIAN);
5768 tap_device->data.mtus.sco_mtu = tvb_get_uint8(tvb, offset - 5);
5769 tap_device->data.mtus.acl_packets = tvb_get_uint16(tvb, offset - 4, ENC_LITTLE_ENDIAN);
5770 tap_device->data.mtus.sco_packets = tvb_get_uint16(tvb, offset - 2, ENC_LITTLE_ENDIAN);
5771 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
5774 break;
5776 case 0x100a: /* Read Data Block Size */
5777 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
5778 status = tvb_get_uint8(tvb, offset);
5779 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
5780 offset += 1;
5781 proto_tree_add_item(tree, hf_bthci_evt_max_acl_data_packet_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5782 offset += 2;
5783 proto_tree_add_item(tree, hf_bthci_evt_data_block_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5784 offset += 2;
5785 proto_tree_add_item(tree, hf_bthci_evt_total_num_data_blocks, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5786 offset += 2;
5788 break;
5789 case 0x100b: /* Read Local Supported Codecs */
5791 uint8_t count;
5792 uint8_t i_count;
5793 proto_tree *sub_tree;
5794 proto_item *sub_item;
5796 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
5797 status = tvb_get_uint8(tvb, offset);
5798 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
5799 offset += 1;
5801 proto_tree_add_item(tree, hf_bthci_evt_number_of_supported_codecs, tvb, offset, 1, ENC_NA);
5802 count = tvb_get_uint8(tvb, offset);
5803 offset += 1;
5805 sub_item = proto_tree_add_item(tree, hf_bthci_evt_codecs, tvb, offset, count, ENC_NA);
5806 sub_tree = proto_item_add_subtree(sub_item, ett_codecs);
5808 for (i_count = 0; i_count < count; i_count+= 1) {
5809 proto_tree_add_item(sub_tree, hf_bthci_evt_codec_id, tvb, offset, 1, ENC_NA);
5810 offset += 1;
5813 proto_tree_add_item(tree, hf_bthci_evt_number_of_supported_vendor_codecs, tvb, offset, 1, ENC_NA);
5814 count = tvb_get_uint8(tvb, offset);
5815 offset += 1;
5817 sub_item = proto_tree_add_item(tree, hf_bthci_evt_vendor_codecs, tvb, offset, count, ENC_NA);
5818 sub_tree = proto_item_add_subtree(sub_item, ett_codecs);
5820 for (i_count = 0; i_count < count; i_count+= 1) {
5821 proto_tree *codec_tree;
5822 proto_item *codec_item;
5824 codec_item = proto_tree_add_string_format(sub_tree, hf_bthci_evt_vendor_codecs_item, tvb, offset, 4, "", "Item %u", i_count + 1);
5825 codec_tree = proto_item_add_subtree(codec_item, ett_codecs);
5827 proto_tree_add_item(codec_tree, hf_bthci_evt_comp_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5828 offset += 2;
5830 proto_tree_add_item(codec_tree, hf_bthci_evt_vendor_codec_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5831 offset += 2;
5835 break;
5837 case 0x100c: /* Read Local Simple Pairing Options */
5838 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
5839 status = tvb_get_uint8(tvb, offset);
5840 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
5841 offset += 1;
5842 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_simple_pairing_options, ett_simple_pairing_options, hfx_bthci_evt_simple_pairing_options, ENC_NA);
5843 offset += 1;
5844 proto_tree_add_item(tree, hf_bthci_evt_max_encryption_key_size, tvb, offset, 1, ENC_NA);
5845 offset += 1;
5846 break;
5848 case 0x1007: /* Read Country Code */
5849 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5850 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5851 offset += 1;
5853 proto_tree_add_item(tree, hf_bthci_evt_country_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5854 offset += 1;
5856 break;
5858 case 0x1401: /* Read Failed Contact Counter */
5859 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5860 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5861 offset += 1;
5863 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5864 offset += 2;
5866 proto_tree_add_item(tree, hf_bthci_evt_failed_contact_counter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5867 offset += 2;
5869 break;
5871 case 0x1403: /* Get Link Quality */
5872 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5873 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5874 offset += 1;
5876 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5877 offset += 2;
5879 proto_tree_add_item(tree, hf_bthci_evt_link_quality, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5880 offset += 1;
5882 break;
5884 case 0x1405: /* Read RSSI */
5885 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5886 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5887 offset += 1;
5889 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5890 offset += 2;
5892 proto_tree_add_item(tree, hf_bthci_evt_rssi, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5893 offset += 1;
5895 break;
5897 case 0x1406: /* Read AFH Channel Map */
5898 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5899 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5900 offset += 1;
5902 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5903 offset += 2;
5905 proto_tree_add_item(tree, hf_bthci_evt_afh_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5906 offset += 1;
5908 proto_tree_add_item(tree, hf_bthci_evt_afh_channel_map, tvb, offset, 10, ENC_NA);
5909 offset += 10;
5911 break;
5913 case 0x1407: /* Read Clock */
5914 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5915 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5916 offset += 1;
5918 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5919 offset += 2;
5921 proto_tree_add_item(tree, hf_bthci_evt_clock, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5922 offset += 4;
5924 accuracy = tvb_get_letohl(tvb, offset);
5925 item = proto_tree_add_item(tree, hf_bthci_evt_clock_accuracy, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5926 proto_item_append_text(item, " %g msec", accuracy*0.3125);
5927 offset += 2;
5928 break;
5930 case 0x1408: /* Read Encryption Key Size */
5931 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5932 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5933 offset += 1;
5934 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5935 offset += 2;
5936 proto_tree_add_item(tree, hf_bthci_evt_enc_key_size, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5937 offset += 1;
5938 break;
5940 case 0x1409: /* Read Local AMP Info */
5941 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5942 status = tvb_get_uint8(tvb, offset);
5943 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
5944 offset += 1;
5946 proto_tree_add_item(tree, hf_bthci_evt_amp_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5947 offset += 1;
5948 proto_tree_add_item(tree, hf_bthci_evt_total_bandwidth, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5949 offset += 4;
5950 proto_tree_add_item(tree, hf_bthci_evt_max_guaranteed_bandwidth, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5951 offset += 4;
5952 proto_tree_add_item(tree, hf_bthci_evt_min_latency, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5953 offset += 4;
5954 proto_tree_add_item(tree, hf_bthci_evt_max_pdu_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5955 offset += 4;
5956 proto_tree_add_item(tree, hf_bthci_evt_amp_controller_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5957 offset += 1;
5958 proto_tree_add_item(tree, hf_bthci_evt_pal_capabilities_00, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5959 offset += 2;
5960 proto_tree_add_item(tree, hf_bthci_evt_max_amp_assoc_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5961 offset += 2;
5962 proto_tree_add_item(tree, hf_bthci_evt_max_flush_to_us, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5963 offset += 4;
5964 proto_tree_add_item(tree, hf_bthci_evt_best_effort_flush_to_us, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5965 offset += 4;
5966 break;
5968 case 0x140a: /* Read Local AMP Assoc */
5969 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5970 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5971 offset += 1;
5972 proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5973 offset += 1;
5974 proto_tree_add_item(tree, hf_bthci_evt_amp_remaining_assoc_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5975 offset += 2;
5976 proto_tree_add_item(tree, hf_bthci_evt_amp_assoc_fragment, tvb, offset, -1, ENC_NA);
5977 offset += tvb_reported_length_remaining(tvb, offset);
5978 break;
5980 case 0x140b: /* Write Remote AMP Assoc */
5981 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5982 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
5983 offset += 1;
5984 proto_tree_add_item(tree, hf_bthci_evt_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5985 offset += 1;
5986 break;
5988 case 0x140C: /* Get MWS Transport Layer Configuration */ {
5989 uint8_t transports;
5990 uint8_t i_transport;
5991 uint16_t baud_rates = 0;
5992 uint16_t i_baud_rate;
5993 int32_t baud_rate_to;
5994 proto_item *sub_item;
5995 proto_tree *sub_tree;
5996 proto_item *sub2_item;
5997 proto_tree *sub2_tree;
5998 int offset_baud_rates;
6000 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6001 status = tvb_get_uint8(tvb, offset);
6002 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
6003 offset += 1;
6005 proto_tree_add_item(tree, hf_bthci_evt_mws_number_of_transports, tvb, offset, 1, ENC_NA);
6006 transports = tvb_get_uint8(tvb, offset);
6007 offset += 1;
6009 sub_item = proto_tree_add_item(tree, hf_bthci_evt_mws_transport_layers, tvb, offset, transports * 2, ENC_NA);
6010 sub_tree = proto_item_add_subtree(sub_item, ett_mws_transport_layers);
6012 offset_baud_rates = offset = 1;
6014 for (i_transport = 0; i_transport < transports; i_transport += 1) {
6015 sub2_item = proto_tree_add_item(sub_tree, hf_bthci_evt_mws_transport_layers_item, tvb, offset, transports * 2, ENC_NA);
6016 sub2_tree = proto_item_add_subtree(sub2_item, ett_mws_transport_layers_item);
6017 proto_item_append_text(sub2_item, " #%u", i_transport + 1);
6019 proto_tree_add_item(sub2_tree, hf_bthci_evt_mws_transport_layer, tvb, offset, 1, ENC_NA);
6020 offset += 1;
6022 proto_tree_add_item(sub2_tree, hf_bthci_evt_mws_number_of_baud_rates, tvb, offset, 1, ENC_NA);
6023 baud_rates += tvb_get_uint8(tvb, offset);
6024 offset += 1;
6027 sub_item = proto_tree_add_item(tree, hf_bthci_evt_mws_to_mws_baud_rates, tvb, offset, baud_rates * 4, ENC_NA);
6028 sub_tree = proto_item_add_subtree(sub_item, ett_mws_to_mws_baud_rates);
6030 baud_rate_to = -1;
6031 i_transport = 1;
6032 sub2_tree = sub_tree;
6033 for (i_baud_rate = 0; i_baud_rate < baud_rates; i_baud_rate += 1) {
6034 if (baud_rate_to == -1 || baud_rate_to == i_baud_rate) {
6035 baud_rate_to = tvb_get_uint8(tvb, offset_baud_rates + (i_transport - 1) * 2);
6036 sub2_item = proto_tree_add_item(sub_tree, hf_bthci_evt_mws_to_mws_baud_rates_tranport_item, tvb, offset, (baud_rate_to - i_baud_rate) * 4, ENC_NA);
6037 proto_item_append_text(sub2_item, " #%u", i_transport);
6038 sub2_tree = proto_item_add_subtree(sub2_item, ett_mws_to_mws_baud_rates_transport_item);
6039 i_transport += 1;
6042 proto_tree_add_item(sub2_tree, hf_bthci_evt_mws_to_mws_baud_rate, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6043 offset += 4;
6046 sub_item = proto_tree_add_item(tree, hf_bthci_evt_mws_from_mws_baud_rates, tvb, offset, baud_rates * 4, ENC_NA);
6047 sub_tree = proto_item_add_subtree(sub_item, ett_mws_from_mws_baud_rates);
6049 baud_rate_to = -1;
6050 i_transport = 1;
6051 sub2_tree = sub_tree;
6052 for (i_baud_rate = 0; i_baud_rate < baud_rates; i_baud_rate += 1) {
6053 if (baud_rate_to == -1 || baud_rate_to == i_baud_rate) {
6054 baud_rate_to = tvb_get_uint8(tvb, offset_baud_rates + (i_transport - 1) * 2);
6055 sub2_item = proto_tree_add_item(sub_tree, hf_bthci_evt_mws_from_mws_baud_rates_tranport_item, tvb, offset, (baud_rate_to - i_baud_rate) * 4, ENC_NA);
6056 proto_item_append_text(sub2_item, " #%u", i_transport);
6057 sub2_tree = proto_item_add_subtree(sub2_item, ett_mws_from_mws_baud_rates_transport_item);
6058 i_transport += 1;
6061 proto_tree_add_item(sub2_tree, hf_bthci_evt_mws_from_mws_baud_rate, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6062 offset += 4;
6064 break; }
6066 case 0x1801: /* Read Loopback Mode */
6067 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6068 status = tvb_get_uint8(tvb, offset);
6069 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
6070 offset += 1;
6071 proto_tree_add_item(tree, hf_bthci_evt_loopback_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6072 offset += 1;
6073 break;
6075 case 0x2002: /* LE Read Buffer Size [v1] */
6076 case 0x2060: /* LE Read Buffer Size [v2] */
6077 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6078 status = tvb_get_uint8(tvb, offset);
6079 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
6080 offset += 1;
6082 if (status == STATUS_SUCCESS && have_tap_listener(bluetooth_device_tap)) {
6083 bluetooth_device_tap_t *tap_device;
6085 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
6086 if (bluetooth_data) {
6087 tap_device->interface_id = bluetooth_data->interface_id;
6088 tap_device->adapter_id = bluetooth_data->adapter_id;
6089 } else {
6090 tap_device->interface_id = HCI_INTERFACE_DEFAULT;
6091 tap_device->adapter_id = HCI_ADAPTER_DEFAULT;
6093 tap_device->has_bd_addr = false;
6094 tap_device->is_local = true;
6095 tap_device->type = BLUETOOTH_DEVICE_LE_MTU;
6096 tap_device->data.le_mtus.acl_mtu = tvb_get_uint16(tvb, offset, ENC_LITTLE_ENDIAN);
6097 tap_device->data.le_mtus.acl_packets = tvb_get_uint8(tvb, offset + 2);
6098 if (opcode == 0x2060) { /* LE Read Buffer Size [v2] */
6099 tap_device->data.le_mtus.iso_mtu = tvb_get_uint16(tvb, offset + 3, ENC_LITTLE_ENDIAN);
6100 tap_device->data.le_mtus.iso_packets = tvb_get_uint8(tvb, offset + 5);
6102 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
6105 item = proto_tree_add_item(tree, hf_bthci_evt_le_acl_data_pkt_len, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6106 if ( (tvb_get_letohs(tvb, offset) == 0) && (tvb_get_uint8(tvb, offset+2) == 0) )
6107 proto_item_append_text(item, " (buffers shared between BR/EDR and LE) ");
6108 offset += 2;
6110 proto_tree_add_item(tree, hf_bthci_evt_total_num_le_acl_data_pkts, tvb, offset, 1, ENC_NA);
6111 offset += 1;
6113 if (opcode == 0x2060) { /* LE Read Buffer Size [v2] */
6114 proto_tree_add_item(tree, hf_bthci_evt_iso_data_pkt_len, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6115 offset += 2;
6116 proto_tree_add_item(tree, hf_bthci_evt_total_num_iso_data_pkts, tvb, offset, 1, ENC_NA);
6117 offset += 1;
6120 break;
6122 case 0x2003: /* LE Read Local Supported Features */
6123 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6124 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6125 offset += 1;
6127 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_le_features, ett_le_features, hfx_bthci_evt_le_features, ENC_LITTLE_ENDIAN);
6128 offset += 8;
6130 break;
6131 case 0x2007: /* LE Read Advertising Channel Tx Power */
6133 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6134 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6135 offset += 1;
6136 proto_tree_add_item(tree, hf_bthci_evt_transmit_power_level, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6137 offset += 1;
6138 break;
6141 case 0x200f: /* LE Read Filter Accept List Size */
6143 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6144 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6145 offset += 1;
6146 proto_tree_add_item(tree, hf_bthci_evt_filter_accept_list_size, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6147 offset += 1;
6148 break;
6151 case 0x2015: /* LE Read Channel Map */
6153 proto_tree *sub_tree;
6154 proto_item *sub_item;
6156 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6157 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6158 offset += 1;
6159 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6160 offset += 2;
6162 sub_item = proto_tree_add_item(tree, hf_bthci_evt_le_channel_map, tvb, offset, 5, ENC_NA);
6163 sub_tree = proto_item_add_subtree(sub_item, ett_le_channel_map);
6165 call_dissector(btcommon_le_channel_map_handle, tvb_new_subset_length(tvb, offset, 5), pinfo, sub_tree);
6166 offset += 5;
6167 break;
6170 case 0x2017: /* LE Encrypt */
6172 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6173 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6174 offset += 1;
6175 proto_tree_add_item(tree, hf_bthci_evt_encrypted_data, tvb, offset, 16, ENC_NA);
6176 offset += 16;
6177 break;
6180 case 0x2018: /* LE Rand */
6182 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6183 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6184 offset += 1;
6185 proto_tree_add_item(tree, hf_bthci_evt_random_number, tvb, offset, 8, ENC_NA);
6186 offset += 8;
6187 break;
6190 case 0x201c: /* LE Read Supported States */
6192 proto_item *ti_le_states;
6193 proto_item *ti_le_states_subtree;
6195 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6196 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6197 offset += 1;
6199 ti_le_states = proto_tree_add_item(tree, hf_bthci_evt_le_states, tvb, offset, 8, ENC_NA);
6200 ti_le_states_subtree = proto_item_add_subtree(ti_le_states, ett_le_state_subtree);
6202 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_00, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6203 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_01, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6204 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_02, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6205 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_03, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6206 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_04, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6207 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_05, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6208 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_06, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6209 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_07, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6210 offset += 1;
6211 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_10, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6212 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_11, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6213 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_12, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6214 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_13, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6215 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_14, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6216 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_15, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6217 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_16, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6218 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_17, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6219 offset += 1;
6220 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_20, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6221 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_21, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6222 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_22, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6223 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_23, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6224 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_24, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6225 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_25, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6226 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_26, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6227 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_27, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6228 offset += 1;
6229 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_30, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6230 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_31, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6231 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_32, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6232 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_33, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6233 proto_tree_add_item(ti_le_states_subtree,hf_bthci_evt_le_states_34, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6234 offset += 5;
6235 break;
6238 case 0x201f: /* LE Test End */
6240 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6241 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6242 offset += 1;
6243 proto_tree_add_item(tree, hf_bthci_evt_le_num_packets, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6244 offset += 2;
6245 break;
6248 case 0x2030: /* LE Read PHY */
6250 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6251 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6252 offset += 1;
6253 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6254 offset += 2;
6255 proto_tree_add_item(tree, hf_bthci_evt_le_tx_phy, tvb, offset, 1, ENC_NA);
6256 offset += 1;
6257 proto_tree_add_item(tree, hf_bthci_evt_le_rx_phy, tvb, offset, 1, ENC_NA);
6258 offset += 1;
6259 break;
6262 case 0x2036: /* LE Set Extended Advertising Parameters [v1] */
6263 case 0x207F: /* LE Set Extended Advertising Parameters [v2] */
6265 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6266 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6267 offset += 1;
6268 proto_tree_add_item(tree, hf_bthci_evt_selected_tx_power, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6269 offset += 1;
6270 break;
6273 case 0x203A: /* LE Read Maximum Advertising Data Length */
6275 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6276 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6277 offset += 1;
6278 proto_tree_add_item(tree, hf_bthci_evt_max_adv_data_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6279 offset += 2;
6280 break;
6283 case 0x203B: /* LE Read Number of Supported Advertising Sets */
6285 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6286 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6287 offset += 1;
6288 proto_tree_add_item(tree, hf_bthci_evt_num_supported_adv_sets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6289 offset += 1;
6290 break;
6293 case 0x2053: /* LE Set Connectionless IQ Sampling Enable */
6295 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6296 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6297 offset += 1;
6298 proto_tree_add_item(tree, hf_bthci_evt_sync_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6299 offset += 2;
6300 break;
6303 case 0x0441: /* Set Connectionless Peripheral Broadcast */
6304 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6305 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6306 offset += 1;
6308 proto_tree_add_item(tree, hf_bthci_evt_lt_addr, tvb, offset, 1, ENC_NA);
6309 offset += 1;
6311 proto_tree_add_item(tree, hf_bthci_evt_connectionless_peripheral_broadcast_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6312 offset += 2;
6314 break;
6315 case 0x0442: /* Set Connectionless Peripheral Broadcast Receive */
6316 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6317 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6318 offset += 1;
6320 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
6322 proto_tree_add_item(tree, hf_bthci_evt_lt_addr, tvb, offset, 1, ENC_NA);
6323 offset += 1;
6325 break;
6326 case 0x0C70: /* Set MWS Signaling */
6327 proto_tree_add_item(tree, hf_bthci_evt_mws_bt_rx_priority_assert_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6328 offset += 2;
6330 proto_tree_add_item(tree, hf_bthci_evt_mws_bt_rx_priority_assert_jitter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6331 offset += 2;
6333 proto_tree_add_item(tree, hf_bthci_evt_mws_bt_rx_priority_deassert_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6334 offset += 2;
6336 proto_tree_add_item(tree, hf_bthci_evt_mws_bt_rx_priority_deassert_jitter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6337 offset += 2;
6340 proto_tree_add_item(tree, hf_bthci_evt_mws_802_rx_priority_assert_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6341 offset += 2;
6343 proto_tree_add_item(tree, hf_bthci_evt_mws_802_rx_priority_assert_jitter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6344 offset += 2;
6346 proto_tree_add_item(tree, hf_bthci_evt_mws_802_rx_priority_deassert_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6347 offset += 2;
6349 proto_tree_add_item(tree, hf_bthci_evt_mws_802_rx_priority_deassert_jitter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6350 offset += 2;
6353 proto_tree_add_item(tree, hf_bthci_evt_mws_bt_tx_priority_assert_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6354 offset += 2;
6356 proto_tree_add_item(tree, hf_bthci_evt_mws_bt_tx_priority_assert_jitter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6357 offset += 2;
6359 proto_tree_add_item(tree, hf_bthci_evt_mws_bt_tx_priority_deassert_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6360 offset += 2;
6362 proto_tree_add_item(tree, hf_bthci_evt_mws_bt_tx_priority_deassert_jitter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6363 offset += 2;
6366 proto_tree_add_item(tree, hf_bthci_evt_mws_802_tx_priority_assert_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6367 offset += 2;
6369 proto_tree_add_item(tree, hf_bthci_evt_mws_802_tx_priority_assert_jitter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6370 offset += 2;
6372 proto_tree_add_item(tree, hf_bthci_evt_mws_802_tx_priority_deassert_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6373 offset += 2;
6375 proto_tree_add_item(tree, hf_bthci_evt_mws_802_tx_priority_deassert_jitter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6376 offset += 2;
6378 break;
6379 case 0x0C77: /* Read Synchronization Train Parameters */
6380 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6381 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6382 offset += 1;
6384 proto_tree_add_item(tree, hf_bthci_evt_sync_train_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6385 offset += 2;
6387 proto_tree_add_item(tree, hf_bthci_evt_sync_train_to, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6388 offset += 4;
6390 proto_tree_add_item(tree, hf_bthci_evt_service_data, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6391 offset += 1;
6393 break;
6394 case 0x0C78: /* Write Synchronization Train Parameters */
6395 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6396 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6397 offset += 1;
6399 proto_tree_add_item(tree, hf_bthci_evt_sync_train_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6400 offset += 2;
6402 break;
6403 case 0x0C79: /* Read Secure Connections Host Support */
6404 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6405 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6406 offset += 1;
6408 proto_tree_add_item(tree, hf_bthci_evt_secure_connection_host_support, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6409 offset += 1;
6411 break;
6412 case 0x0C7B: /* Read Authenticated Payload Timeout */
6413 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6414 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6415 offset += 1;
6417 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6418 offset += 2;
6420 proto_tree_add_item(tree, hf_bthci_evt_authenticated_payload_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6421 offset += 2;
6423 break;
6424 case 0x0C7D: /* Read Local OOB Extended Data */
6425 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6426 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6427 offset += 1;
6429 proto_tree_add_item(tree, hf_bthci_evt_c192, tvb, offset, 16, ENC_NA);
6430 offset += 16;
6432 proto_tree_add_item(tree, hf_bthci_evt_r192, tvb, offset, 16, ENC_NA);
6433 offset += 16;
6435 proto_tree_add_item(tree, hf_bthci_evt_c256, tvb, offset, 16, ENC_NA);
6436 offset += 16;
6438 proto_tree_add_item(tree, hf_bthci_evt_r256, tvb, offset, 16, ENC_NA);
6439 offset += 16;
6441 break;
6442 case 0x0C7E: /* Read Extended Page Timeout */
6443 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6444 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6445 offset += 1;
6447 proto_tree_add_item(tree, hf_bthci_evt_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6449 break;
6450 case 0x0C80: /* Read Extended Inquiry Length */
6451 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6452 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6453 offset += 1;
6455 proto_tree_add_item(tree, hf_bthci_evt_extended_inquiry_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6457 break;
6458 case 0x2023: /* LE Read Suggested Default Data Length */
6459 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6460 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6461 offset += 1;
6463 proto_tree_add_item(tree, hf_bthci_evt_suggested_max_tx_octets, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6464 offset += 2;
6466 proto_tree_add_item(tree, hf_bthci_evt_suggested_max_tx_time, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6467 offset += 2;
6469 break;
6470 case 0x202A: /* LE Read Resolving List Size */
6471 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6472 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6473 offset += 1;
6475 proto_tree_add_item(tree, hf_bthci_evt_resolving_list_size, tvb, offset, 1, ENC_NA);
6476 offset += 1;
6478 break;
6479 case 0x202F: /* LE Read Maximum Data Length */
6480 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6481 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6482 offset += 1;
6484 proto_tree_add_item(tree, hf_bthci_evt_suggested_max_tx_octets, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6485 offset += 2;
6487 proto_tree_add_item(tree, hf_bthci_evt_suggested_max_tx_time, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6488 offset += 2;
6490 proto_tree_add_item(tree, hf_bthci_evt_suggested_max_rx_octets, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6491 offset += 2;
6493 proto_tree_add_item(tree, hf_bthci_evt_suggested_max_rx_time, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6494 offset += 2;
6496 break;
6498 case 0x204A: /* LE Read Periodic Advertiser List Size */
6499 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6500 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6501 offset += 1;
6503 proto_tree_add_item(tree, hf_bthci_evt_periodic_adv_list_size, tvb, offset, 1, ENC_NA);
6504 offset += 1;
6506 break;
6507 case 0x204B: /* LE Read Transmit Power */
6508 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6509 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6510 offset += 1;
6512 proto_tree_add_item(tree, hf_bthci_evt_min_tx_power, tvb, offset, 1, ENC_NA);
6513 offset += 1;
6515 proto_tree_add_item(tree, hf_bthci_evt_max_tx_power, tvb, offset, 1, ENC_NA);
6516 offset += 1;
6518 break;
6519 case 0x204C: /* LE Read RF Path Compensation */
6520 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6521 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6522 offset += 1;
6524 item = proto_tree_add_item(tree, hf_bthci_evt_rf_tx_path_compensation, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6525 proto_item_append_text(item, " (%g dB)", tvb_get_letohis(tvb, offset)*0.1);
6526 offset += 2;
6528 item = proto_tree_add_item(tree, hf_bthci_evt_rf_rx_path_compensation, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6529 proto_item_append_text(item, " (%g dB)", tvb_get_letohis(tvb, offset)*0.1);
6530 offset += 2;
6532 break;
6533 case 0x2058: /* LE Read Antenna Information */
6534 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6535 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6536 offset += 1;
6537 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_supported_switching_sample_rates,
6538 ett_supported_switching_sample_rates, hfx_bthci_evt_supported_switching_sample_rates, ENC_NA);
6539 offset += 1;
6540 proto_tree_add_item(tree, hf_bthci_evt_number_antennae, tvb, offset, 1, ENC_NA);
6541 offset += 1;
6542 proto_tree_add_item(tree, hf_bthci_evt_max_length_antenna_switching_pattern, tvb, offset, 1, ENC_NA);
6543 offset += 1;
6544 proto_tree_add_item(tree, hf_bthci_evt_max_cte_length, tvb, offset, 1, ENC_NA);
6545 offset += 1;
6546 break;
6548 case 0x2061: /* LE Read ISO Tx Sync */
6549 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6550 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6551 offset += 1;
6552 proto_tree_add_item(tree, hf_bthci_evt_cis_bis_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6553 offset += 2;
6554 proto_tree_add_item(tree, hf_bthci_evt_sdu_packet_seq_num, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6555 offset += 2;
6556 proto_tree_add_item(tree, hf_bthci_evt_sdu_packet_timestamp, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6557 offset += 4;
6558 proto_tree_add_item(tree, hf_bthci_evt_sdu_packet_offset, tvb, offset, 3, ENC_LITTLE_ENDIAN);
6559 offset += 3;
6560 break;
6562 case 0x2062: /* LE Set CIG Parameters */
6563 case 0x2063: /* LE Set CIG Parameters Test */
6565 uint8_t cis_count;
6566 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6567 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6568 offset += 1;
6569 proto_tree_add_item(tree, hf_bthci_evt_cig_id, tvb, offset, 1, ENC_NA);
6570 offset += 1;
6571 proto_tree_add_item(tree, hf_bthci_evt_cis_count, tvb, offset, 1, ENC_NA);
6572 cis_count = tvb_get_uint8(tvb, offset);
6573 offset += 1;
6574 for (i = 0; i < cis_count; i++) {
6575 proto_tree_add_item(tree, hf_bthci_evt_cis_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6576 offset += 2;
6579 break;
6581 case 0x2065: /* LE Remove CIG */
6582 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6583 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6584 offset += 1;
6585 proto_tree_add_item(tree, hf_bthci_evt_cig_id, tvb, offset, 1, ENC_NA);
6586 offset += 1;
6587 break;
6589 case 0x2067: /* LE Reject CIS Request */
6590 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6591 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6592 offset += 1;
6593 proto_tree_add_item(tree, hf_bthci_evt_cis_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6594 offset += 2;
6595 break;
6597 case 0x206C: /* LE BIG Terminate Sync */
6598 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6599 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6600 offset += 1;
6601 proto_tree_add_item(tree, hf_bthci_evt_big_handle, tvb, offset, 1, ENC_NA);
6602 offset += 1;
6603 break;
6605 case 0x206E: /* LE Setup ISO Data Path */
6606 case 0x206F: /* LE Remove ISO Data Path */
6607 case 0x2070: /* LE ISO Transmit Test */
6608 case 0x2071: /* LE ISO Receive Test */
6609 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6610 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6611 offset += 1;
6612 proto_tree_add_item(tree, hf_bthci_evt_cis_bis_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6613 offset += 2;
6614 break;
6616 case 0x2072: /* LE ISO Read Test Counters */
6617 case 0x2073: /* LE ISO Test End */
6618 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6619 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6620 offset += 1;
6621 proto_tree_add_item(tree, hf_bthci_evt_cis_bis_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6622 offset += 2;
6623 proto_tree_add_item(tree, hf_bthci_evt_received_packet_counter, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6624 offset += 4;
6625 proto_tree_add_item(tree, hf_bthci_evt_missed_packet_counter, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6626 offset += 4;
6627 proto_tree_add_item(tree, hf_bthci_evt_failed_packet_counter, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6628 offset += 4;
6629 break;
6631 case 0x2075: /* LE Read ISO Link Quality */
6632 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6633 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6634 offset += 1;
6635 proto_tree_add_item(tree, hf_bthci_evt_cis_bis_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6636 offset += 2;
6637 proto_tree_add_item(tree, hf_bthci_evt_pkt_count_tx_unacked, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6638 offset += 4;
6639 proto_tree_add_item(tree, hf_bthci_evt_pkt_count_tx_flushed, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6640 offset += 4;
6641 proto_tree_add_item(tree, hf_bthci_evt_pkt_count_tx_last_subevent, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6642 offset += 4;
6643 proto_tree_add_item(tree, hf_bthci_evt_pkt_count_tx_retransmitted, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6644 offset += 4;
6645 proto_tree_add_item(tree, hf_bthci_evt_pkt_count_rx_crc_error, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6646 offset += 4;
6647 proto_tree_add_item(tree, hf_bthci_evt_pkt_count_rx_unreceived, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6648 offset += 4;
6649 proto_tree_add_item(tree, hf_bthci_evt_pkt_count_rx_duplicate, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6650 offset += 4;
6651 break;
6653 case 0x2076: /* LE Enhanced Read Transmit Power Level */
6654 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6655 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6656 offset += 1;
6657 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6658 offset += 2;
6659 proto_tree_add_item(tree, hf_bthci_evt_phy_and_coding, tvb, offset, 1, ENC_NA);
6660 offset += 1;
6661 proto_tree_add_item(tree, hf_bthci_evt_transmit_power_level, tvb, offset, 1, ENC_NA);
6662 offset += 1;
6663 proto_tree_add_item(tree, hf_bthci_evt_max_transmit_power_level, tvb, offset, 1, ENC_NA);
6664 offset += 1;
6665 break;
6667 case 0x2082: /* LE Set Periodic Advertising Subevent */
6668 case 0x2086: /* LE Set Periodic Advertising Parameters */
6669 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6670 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6671 offset += 1;
6672 proto_tree_add_item(tree, hf_bthci_evt_advertising_handle, tvb, offset, 1, ENC_NA);
6673 offset += 1;
6674 break;
6676 case 0x2083: /* LE Set Periodic Advertising Response Data */
6677 case 0x2084: /* LE Set Periodic Advertising Sync Subevent */
6678 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6679 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6680 offset += 1;
6681 proto_tree_add_item(tree, hf_bthci_evt_sync_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6682 offset += 2;
6683 break;
6685 case 0x2087: /* LE Read All Local Supported Features */
6686 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6687 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6688 offset += 1;
6689 proto_tree_add_item(tree, hf_bthci_evt_max_page_number, tvb, offset, 1, ENC_NA);
6690 offset += 1;
6691 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_le_features, ett_le_features,
6692 hfx_bthci_evt_le_features, ENC_LITTLE_ENDIAN);
6693 offset += 8;
6694 proto_tree_add_bitmask(tree, tvb, offset, hf_bthci_evt_le_ext_features_1, ett_le_features,
6695 hfx_bthci_evt_le_ext_features_1, ENC_LITTLE_ENDIAN);
6696 offset += 8;
6697 proto_tree_add_item(tree, hf_bthci_evt_reserved, tvb, offset, 232, ENC_NA);
6698 offset += 232;
6699 break;
6701 case 0x2089: /* LE CS Read Local Supported Capabilities */
6702 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6703 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6704 offset += 1;
6705 offset = dissect_bthci_evt_cs_capabilities(tvb, offset, pinfo, tree);
6706 break;
6708 case 0x209B: /* LE Read Monitored Advertisers List Size */
6709 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
6710 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6711 offset += 1;
6712 proto_tree_add_item(tree, hf_bthci_evt_monitoring_adv_list_size, tvb, offset, 1, ENC_NA);
6713 offset += 1;
6714 break;
6716 case 0x0401: /* Inquiry */
6717 case 0x0405: /* Create Connection */
6718 case 0x0406: /* Disconnect */
6719 case 0x0407: /* Add SCO Connection */
6720 case 0x0409: /* Accept Connection Request */
6721 case 0x040A: /* Reject Connection Request */
6722 case 0x040F: /* Change Connection Packet Type */
6723 case 0x0411: /* Authentication Requested */
6724 case 0x0413: /* Set Connection Encryption */
6725 case 0x0415: /* Change Connection Link Key */
6726 case 0x0417: /* Link Key Selection */
6727 case 0x0419: /* Remote Name Request */
6728 case 0x041B: /* Read Remote Supported Features */
6729 case 0x041C: /* Read Remote Extended Features */
6730 case 0x041D: /* Read Remote Version Information */
6731 case 0x041F: /* Read Clock Offset */
6732 case 0x0428: /* Setup Synchronous Connection */
6733 case 0x0429: /* Accept Synchronous Connection Request */
6734 case 0x042A: /* Reject Synchronous Connection Request */
6735 case 0x0435: /* Create Physical Link */
6736 case 0x0436: /* Accept Physical Link */
6737 case 0x0437: /* Disconnect Physical Link */
6738 case 0x0438: /* Create Logical Link */
6739 case 0x0439: /* Accept Logical Link */
6740 case 0x043A: /* Disconnect Logical Link */
6741 case 0x043C: /* Flow Spec Modify */
6742 case 0x043D: /* Enhanced Setup Synchronous Connection */
6743 case 0x043E: /* Enhanced Accept Synchronous Connection Request */
6744 case 0x043F: /* Truncated Page */
6745 case 0x0443: /* Start Synchronization Train */
6746 case 0x0444: /* Receive Synchronization Train */
6747 case 0x0801: /* Hold Mode */
6748 case 0x0803: /* Sniff Mode */
6749 case 0x0804: /* Exit Sniff Mode */
6750 case 0x0805: /* Park State */
6751 case 0x0806: /* Exit Park State */
6752 case 0x0807: /* QoS Setup*/
6753 case 0x080B: /* Switch Role*/
6754 case 0x0810: /* Flow Specification */
6755 case 0x0C53: /* Refresh Encryption Key */
6756 case 0x0C5F: /* Enhanced Flush */
6757 case 0x0C6B: /* Short Range Mode */
6758 case 0x200D: /* LE Create Connection */
6759 case 0x2013: /* LE Connection Update */
6760 case 0x2016: /* LE Read Remote Features */
6761 case 0x2019: /* LE Start Encryption */
6762 case 0x2025: /* LE Read Local P-256 Public Key */
6763 case 0x2026: /* LE Generate DHKey [v1] */
6764 case 0x2043: /* LE Extended Create Connection [v1] */
6765 case 0x2044: /* LE Periodic Advertising Create Sync */
6766 case 0x205E: /* LE Generate DHKey [v2] */
6767 case 0x2064: /* LE Create CIS */
6768 case 0x2066: /* LE Accept CIS Request */
6769 case 0x2068: /* LE Create BIG */
6770 case 0x2069: /* LE Create BIG Test */
6771 case 0x206A: /* LE Terminate BIG */
6772 case 0x206B: /* LE BIG Create Sync */
6773 case 0x206D: /* LE Request Peer SCA */
6774 case 0x2077: /* LE Read Remote Transmit Power Level */
6775 case 0x207E: /* LE Subrate Request */
6776 case 0x2085: /* LE Extended Create Connection [v2] */
6777 proto_tree_add_expert(tree, pinfo, &ei_event_unexpected_event, tvb, offset, tvb_captured_length_remaining(tvb, offset));
6778 offset += tvb_reported_length_remaining(tvb, offset);
6780 break;
6782 case 0x0C35: /* Host Number Of Completed Packets */
6783 if (tvb_captured_length_remaining(tvb, offset) > 0) {
6784 proto_tree_add_expert(tree, pinfo, &ei_event_unexpected_parameter, tvb, offset, tvb_captured_length_remaining(tvb, offset));
6785 offset += tvb_reported_length_remaining(tvb, offset);
6788 break;
6790 default:
6791 proto_tree_add_expert(tree, pinfo, &ei_event_unknown_command, tvb, offset, tvb_captured_length_remaining(tvb, offset));
6792 offset += tvb_reported_length_remaining(tvb, offset);
6794 break;
6797 add_opcode(pinfo->pool, opcode_list, opcode, COMMAND_STATUS_NORMAL);
6799 return offset;
6802 static int
6803 dissect_bthci_evt_qos_setup_complete(tvbuff_t *tvb, int offset,
6804 packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
6806 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6807 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6808 offset += 1;
6810 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6811 offset += 2;
6813 proto_tree_add_item(tree, hf_bthci_evt_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6814 offset += 1;
6816 proto_tree_add_item(tree, hf_bthci_evt_service_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6817 offset += 1;
6819 proto_tree_add_item(tree, hf_bthci_evt_token_rate, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6820 offset += 4;
6822 proto_tree_add_item(tree, hf_bthci_evt_peak_bandwidth, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6823 offset += 4;
6825 proto_tree_add_item(tree, hf_bthci_evt_latency, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6826 offset += 4;
6829 proto_tree_add_item(tree, hf_bthci_evt_delay_variation, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6830 offset += 4;
6832 return offset;
6835 static int
6836 dissect_bthci_evt_change_conn_link_key_complete(tvbuff_t *tvb, int offset,
6837 packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
6839 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6840 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6841 offset += 1;
6843 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6844 offset += 2;
6846 return offset;
6849 static int
6850 dissect_bthci_evt_link_key_type_changed(tvbuff_t *tvb, int offset,
6851 packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
6853 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6854 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6855 offset += 1;
6857 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6858 offset += 2;
6860 proto_tree_add_item(tree, hf_bthci_evt_key_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6861 offset += 1;
6863 return offset;
6866 static int
6867 dissect_bthci_evt_encryption_change(tvbuff_t *tvb, int offset,
6868 packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data, bool v2)
6870 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6871 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6872 offset += 1;
6874 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6875 offset += 2;
6877 proto_tree_add_item(tree, hf_bthci_evt_encryption_enable, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6878 offset += 1;
6880 if (v2) {
6881 proto_tree_add_item(tree, hf_bthci_evt_enc_key_size, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6882 offset += 1;
6885 return offset;
6888 static int
6889 dissect_bthci_evt_read_remote_ext_features_complete(tvbuff_t *tvb, int offset,
6890 packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
6892 uint8_t page_number;
6894 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6895 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
6896 offset += 1;
6898 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6899 offset += 2;
6901 page_number = tvb_get_uint8(tvb, offset);
6902 proto_tree_add_item(tree, hf_bthci_evt_page_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6903 offset += 1;
6905 proto_tree_add_item(tree, hf_bthci_evt_max_page_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6906 offset += 1;
6908 offset = dissect_bthci_evt_lmp_features(tvb, offset, pinfo, tree, page_number);
6910 return offset;
6913 static int
6914 dissect_bthci_evt_sync_connection_complete(tvbuff_t *tvb, int offset,
6915 packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
6917 uint32_t connection_handle;
6918 uint8_t bd_addr[6];
6919 uint8_t status;
6920 wmem_tree_key_t key[5];
6921 uint32_t interface_id;
6922 uint32_t adapter_id;
6923 uint32_t frame_number;
6924 wmem_tree_t *subtree;
6926 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6927 status = tvb_get_uint8(tvb, offset);
6928 send_hci_summary_status_tap(status, pinfo, bluetooth_data);
6929 offset += 1;
6931 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6932 connection_handle = tvb_get_letohs(tvb, offset) & 0x0FFF;
6933 offset += 2;
6935 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, bd_addr);
6937 proto_tree_add_item(tree, hf_bthci_evt_sync_link_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6938 offset += 1;
6940 proto_tree_add_item(tree, hf_bthci_evt_sync_tx_interval, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6941 offset += 1;
6943 proto_tree_add_item(tree, hf_bthci_evt_sync_rtx_window, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6944 offset += 1;
6946 proto_tree_add_item(tree, hf_bthci_evt_sync_rx_packet_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6947 offset += 2;
6949 proto_tree_add_item(tree, hf_bthci_evt_sync_tx_packet_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
6950 offset += 2;
6952 proto_tree_add_item(tree, hf_bthci_evt_air_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6953 offset += 1;
6955 interface_id = bluetooth_data->interface_id;
6956 adapter_id = bluetooth_data->adapter_id;
6957 frame_number = pinfo->num;
6959 if (!pinfo->fd->visited && status == STATUS_SUCCESS) {
6960 remote_bdaddr_t *remote_bdaddr;
6961 chandle_session_t *chandle_session;
6962 bthci_sco_stream_number_t *sco_stream_number;
6963 uint32_t stream_number;
6965 /* chandle to bdaddr */
6966 key[0].length = 1;
6967 key[0].key = &interface_id;
6968 key[1].length = 1;
6969 key[1].key = &adapter_id;
6970 key[2].length = 1;
6971 key[2].key = &connection_handle;
6972 key[3].length = 1;
6973 key[3].key = &frame_number;
6974 key[4].length = 0;
6975 key[4].key = NULL;
6977 remote_bdaddr = (remote_bdaddr_t *) wmem_new(wmem_file_scope(), remote_bdaddr_t);
6978 remote_bdaddr->interface_id = bluetooth_data->interface_id;
6979 remote_bdaddr->adapter_id = bluetooth_data->adapter_id;
6980 remote_bdaddr->chandle = connection_handle;
6981 memcpy(remote_bdaddr->bd_addr, bd_addr, 6);
6983 wmem_tree_insert32_array(bluetooth_data->chandle_to_bdaddr, key, remote_bdaddr);
6985 /* chandle session */
6986 chandle_session = (chandle_session_t *) wmem_new(wmem_file_scope(), chandle_session_t);
6987 chandle_session->connect_in_frame = frame_number;
6988 chandle_session->disconnect_in_frame = bluetooth_max_disconnect_in_frame;
6989 chandle_session->link_type = BT_LINK_TYPE_SCO;
6990 wmem_tree_insert32_array(bluetooth_data->chandle_sessions, key, chandle_session);
6992 /* stream number */
6993 key[2].length = 0;
6994 key[2].key = NULL;
6996 subtree = (wmem_tree_t *) wmem_tree_lookup32_array(bthci_sco_stream_numbers, key);
6997 sco_stream_number = (subtree) ? (bthci_sco_stream_number_t *) wmem_tree_lookup32_le(subtree, pinfo->num) : NULL;
6998 if (!sco_stream_number) {
6999 stream_number = 1;
7000 } else {
7001 stream_number = sco_stream_number->stream_number + 1;
7004 key[2].length = 1;
7005 key[2].key = &frame_number;
7006 key[3].length = 0;
7007 key[3].key = NULL;
7009 sco_stream_number = (bthci_sco_stream_number_t *) wmem_new(wmem_file_scope(), bthci_sco_stream_number_t);
7010 sco_stream_number->stream_number = stream_number;
7011 wmem_tree_insert32_array(bthci_sco_stream_numbers, key, sco_stream_number);
7014 return offset;
7017 static int
7018 dissect_bthci_evt_sync_connection_changed(tvbuff_t *tvb, int offset,
7019 packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
7021 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7022 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
7023 offset += 1;
7025 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7026 offset += 2;
7028 proto_tree_add_item(tree, hf_bthci_evt_sync_tx_interval, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7029 offset += 1;
7031 proto_tree_add_item(tree, hf_bthci_evt_sync_rtx_window, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7032 offset += 1;
7034 proto_tree_add_item(tree, hf_bthci_evt_sync_rx_packet_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7035 offset += 2;
7037 proto_tree_add_item(tree, hf_bthci_evt_sync_tx_packet_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7038 offset += 2;
7040 return offset;
7043 static int
7044 dissect_bthci_evt_sniff_subrating(tvbuff_t *tvb, int offset, packet_info *pinfo,
7045 proto_tree *tree, bluetooth_data_t *bluetooth_data)
7047 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7048 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
7049 offset += 1;
7051 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7052 offset += 2;
7054 proto_tree_add_item(tree, hf_bthci_evt_max_tx_latency, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7055 offset += 2;
7057 proto_tree_add_item(tree, hf_bthci_evt_max_rx_latency, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7058 offset += 2;
7060 proto_tree_add_item(tree, hf_bthci_evt_min_remote_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7061 offset += 2;
7063 proto_tree_add_item(tree, hf_bthci_evt_min_local_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7064 offset += 2;
7066 return offset;
7069 static int
7070 dissect_bthci_evt_flow_specification_complete(tvbuff_t *tvb, int offset,
7071 packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
7073 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7074 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
7075 offset += 1;
7077 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7078 offset += 2;
7080 proto_tree_add_item(tree, hf_bthci_evt_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7081 offset += 1;
7083 proto_tree_add_item(tree, hf_bthci_evt_flow_direction, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7084 offset += 1;
7086 proto_tree_add_item(tree, hf_bthci_evt_service_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7087 offset += 1;
7089 proto_tree_add_item(tree, hf_bthci_evt_token_rate, tvb, offset, 4, ENC_LITTLE_ENDIAN);
7090 offset += 4;
7092 proto_tree_add_item(tree, hf_bthci_evt_token_bucket_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
7093 offset += 4;
7095 proto_tree_add_item(tree, hf_bthci_evt_peak_bandwidth, tvb, offset, 4, ENC_LITTLE_ENDIAN);
7096 offset += 4;
7098 proto_tree_add_item(tree, hf_bthci_evt_latency, tvb, offset, 4, ENC_LITTLE_ENDIAN);
7099 offset += 4;
7101 return offset;
7104 static int
7105 dissect_bthci_evt_enhanced_flush_complete(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
7107 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7108 offset += 2;
7110 return offset;
7113 static int
7114 dissect_bthci_evt_encryption_key_refresh_complete(tvbuff_t *tvb, int offset,
7115 packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
7117 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7118 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
7119 offset += 1;
7121 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7122 offset += 2;
7124 return offset;
7127 static int
7128 dissect_bthci_evt_link_supervision_timeout_changed(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
7130 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7131 offset += 2;
7133 proto_tree_add_item(tree, hf_bthci_evt_link_supervision_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7134 offset += 2;
7136 return offset;
7139 static int
7140 dissect_bthci_evt_inquire_result(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, bluetooth_data_t *bluetooth_data)
7142 uint8_t num, evt_num_responses;
7144 evt_num_responses = tvb_get_uint8(tvb, offset);
7145 proto_tree_add_item(tree, hf_bthci_evt_num_responses, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7146 offset += 1;
7148 for (num = 0; num < evt_num_responses; num++) {
7149 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
7151 proto_tree_add_item(tree, hf_bthci_evt_page_scan_repetition_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7152 offset += 1;
7154 proto_tree_add_item(tree, hf_bthci_evt_page_scan_period_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7155 offset += 1;
7157 proto_tree_add_item(tree, hf_bthci_evt_page_scan_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7158 offset += 1;
7160 call_dissector(btcommon_cod_handle, tvb_new_subset_length(tvb, offset, 3), pinfo, tree);
7161 offset += 3;
7163 proto_tree_add_item(tree, hf_bthci_evt_clock_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7164 offset += 2;
7167 return offset;
7171 /* Code to actually dissect the packets */
7172 static int
7173 dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
7175 proto_item *ti;
7176 proto_tree *bthci_evt_tree;
7177 uint8_t param_length, evt_code;
7178 uint8_t bd_addr[6];
7179 int offset = 0;
7180 int previous_offset = 0;
7181 bluetooth_data_t *bluetooth_data;
7182 wmem_list_t *opcode_list;
7183 wmem_list_frame_t *opcode_list_frame;
7184 bthci_cmd_data_t *lastest_bthci_cmd_data = NULL;
7185 opcode_list_data_t *opcode_list_data = NULL;
7186 uint32_t opcode = UINT32_MAX;
7188 /* Reject the packet if data is NULL */
7189 if (data == NULL)
7190 return 0;
7191 bluetooth_data = (bluetooth_data_t *) data;
7193 opcode_list = wmem_list_new(pinfo->pool);
7195 ti = proto_tree_add_item(tree, proto_bthci_evt, tvb, offset, -1, ENC_NA);
7196 bthci_evt_tree = proto_item_add_subtree(ti, ett_bthci_evt);
7198 switch (pinfo->p2p_dir) {
7199 case P2P_DIR_SENT:
7200 col_set_str(pinfo->cinfo, COL_INFO, "Sent ");
7201 break;
7202 case P2P_DIR_RECV:
7203 col_set_str(pinfo->cinfo, COL_INFO, "Rcvd ");
7204 break;
7205 default:
7206 col_set_str(pinfo->cinfo, COL_INFO, "UnknownDirection ");
7207 break;
7210 set_address(&pinfo->src, AT_STRINGZ, 11, "controller");
7211 set_address(&pinfo->dst, AT_STRINGZ, 5, "host");
7212 set_address(&pinfo->net_src, AT_STRINGZ, 11, "controller");
7213 set_address(&pinfo->net_dst, AT_STRINGZ, 5, "host");
7214 set_address(&pinfo->dl_src, AT_STRINGZ, 11, "controller");
7215 set_address(&pinfo->dl_dst, AT_STRINGZ, 5, "host");
7216 if (!pinfo->fd->visited) {
7217 address *addr;
7219 addr = (address *) wmem_memdup(wmem_file_scope(), &pinfo->dl_src, sizeof(address));
7220 addr->data = wmem_memdup(wmem_file_scope(), pinfo->dl_src.data, pinfo->dl_src.len);
7221 p_add_proto_data(wmem_file_scope(), pinfo, proto_bluetooth, BLUETOOTH_DATA_SRC, addr);
7223 addr = (address *) wmem_memdup(wmem_file_scope(), &pinfo->dl_dst, sizeof(address));
7224 addr->data = wmem_memdup(wmem_file_scope(), pinfo->dl_dst.data, pinfo->dl_dst.len);
7225 p_add_proto_data(wmem_file_scope(), pinfo, proto_bluetooth, BLUETOOTH_DATA_DST, addr);
7228 evt_code = tvb_get_uint8(tvb, offset);
7229 proto_tree_add_item(bthci_evt_tree, hf_bthci_evt_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7230 proto_item_append_text(bthci_evt_tree, " - %s", val_to_str_ext(evt_code, &bthci_evt_evt_code_vals_ext, "Unknown 0x%02x"));
7231 offset += 1;
7233 if (have_tap_listener(bluetooth_hci_summary_tap)) {
7234 bluetooth_hci_summary_tap_t *tap_hci_summary;
7236 tap_hci_summary = wmem_new(pinfo->pool, bluetooth_hci_summary_tap_t);
7238 tap_hci_summary->interface_id = bluetooth_data->interface_id;
7239 tap_hci_summary->adapter_id = bluetooth_data->adapter_id;
7241 tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_EVENT;
7242 tap_hci_summary->event = evt_code;
7243 if (try_val_to_str_ext(evt_code, &bthci_evt_evt_code_vals_ext))
7244 tap_hci_summary->name = val_to_str_ext(evt_code, &bthci_evt_evt_code_vals_ext, "Unknown 0x%04x");
7245 else
7246 tap_hci_summary->name = NULL;
7247 tap_queue_packet(bluetooth_hci_summary_tap, pinfo, tap_hci_summary);
7250 param_length = tvb_get_uint8(tvb, offset);
7251 proto_tree_add_item(bthci_evt_tree, hf_bthci_evt_param_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7252 offset += 1;
7255 col_set_str(pinfo->cinfo, COL_PROTOCOL, "HCI_EVT");
7257 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext(evt_code, &bthci_evt_evt_code_vals_ext, "Unknown 0x%02x"));
7259 if (param_length > 0) {
7260 switch(evt_code) {
7261 case 0x01: /* Inquiry Complete */
7262 offset = dissect_bthci_evt_inquire_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7263 add_opcode(pinfo->pool, opcode_list, 0x0401, COMMAND_STATUS_NORMAL); /* Inquiry */
7264 add_opcode(pinfo->pool, opcode_list, 0x0403, COMMAND_STATUS_NORMAL); /* Periodic Inquiry Mode */
7265 break;
7267 case 0x02: /* Inquiry result event */
7268 offset = dissect_bthci_evt_inquire_result(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7269 break;
7271 case 0x03: /* Connection Complete */
7272 offset = dissect_bthci_evt_connect_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7273 add_opcode(pinfo->pool, opcode_list, 0x0405, COMMAND_STATUS_NORMAL); /* Create Connection */
7274 add_opcode(pinfo->pool, opcode_list, 0x0409, COMMAND_STATUS_NORMAL); /* Accept Connection Request */
7275 add_opcode(pinfo->pool, opcode_list, 0x040A, COMMAND_STATUS_NORMAL); /* Reject Connection Request */
7276 add_opcode(pinfo->pool, opcode_list, 0x043E, COMMAND_STATUS_NORMAL); /* Enhanced Accept Synchronous Connection Request */
7277 break;
7279 case 0x04: /* Connection Request */
7280 offset = dissect_bthci_evt_connect_request(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7281 break;
7283 case 0x05: /* Disconnection Complete */
7284 offset = dissect_bthci_evt_disconnect_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7285 add_opcode(pinfo->pool, opcode_list, 0x0406, COMMAND_STATUS_NORMAL); /* Disconnection Connection */
7286 break;
7288 case 0x06: /* Authentication Complete */
7289 offset = dissect_bthci_evt_auth_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7290 add_opcode(pinfo->pool, opcode_list, 0x0411, COMMAND_STATUS_NORMAL); /* Authentication Requested */
7291 break;
7293 case 0x07: /* Remote Name Request Complete */
7294 offset = dissect_bthci_evt_remote_name_req_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7295 add_opcode(pinfo->pool, opcode_list, 0x0419, COMMAND_STATUS_NORMAL); /* Remote Name Request */
7296 break;
7298 case 0x08: /* Encryption Change [v1] */
7299 case 0x59: /* Encryption Change [v2] */
7300 offset = dissect_bthci_evt_encryption_change(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data, evt_code == 0x59);
7301 add_opcode(pinfo->pool, opcode_list, 0x0413, COMMAND_STATUS_NORMAL); /* Encryption Requested */
7302 add_opcode(pinfo->pool, opcode_list, 0x2019, COMMAND_STATUS_NORMAL); /* LE Start Encryption */
7303 break;
7305 case 0x09: /* Change Connection Link Key Complete */
7306 offset = dissect_bthci_evt_change_conn_link_key_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7307 break;
7309 case 0x0a: /* Link Key Type Changed */
7310 offset = dissect_bthci_evt_link_key_type_changed(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7311 break;
7313 case 0x0b: /* Read Remote Support Features Complete */
7314 offset = dissect_bthci_evt_read_remote_support_features_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7315 add_opcode(pinfo->pool, opcode_list, 0x41B, COMMAND_STATUS_NORMAL); /* Read Remote Supported Features */
7316 break;
7318 case 0x0c: /* Read Remote Version Information Complete */
7319 offset = dissect_bthci_evt_read_remote_version_information_complete(tvb, offset, pinfo, bluetooth_data, bthci_evt_tree);
7320 add_opcode(pinfo->pool, opcode_list, 0x41D, COMMAND_STATUS_NORMAL); /* Read Remote Version Information */
7321 break;
7323 case 0x0d: /* QoS Setup Complete */
7324 offset = dissect_bthci_evt_qos_setup_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7325 break;
7327 case 0x0e: /* Command Complete */
7328 offset = dissect_bthci_evt_command_complete(tvb, offset, pinfo, tree, bthci_evt_tree, opcode_list, bluetooth_data, &opcode);
7329 break;
7331 case 0x0f: /* Command Status */
7332 offset = dissect_bthci_evt_command_status(tvb, offset, pinfo, tree, bthci_evt_tree, opcode_list, bluetooth_data);
7333 break;
7335 case 0x10: /* Hardware Error */
7336 offset = dissect_bthci_evt_hardware_error(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7337 break;
7339 case 0x11: /* Flush Occurred */
7340 offset = dissect_bthci_evt_flush_occurred(tvb, offset, pinfo, bthci_evt_tree);
7341 break;
7343 case 0x12: /* Role Change */
7344 offset = dissect_bthci_evt_role_change(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7345 add_opcode(pinfo->pool, opcode_list, 0x080B, COMMAND_STATUS_NORMAL); /* Switch Role */
7346 break;
7348 case 0x13: /* Number Of Completed Packets */
7349 offset = dissect_bthci_evt_number_of_completed_packets(tvb, offset, pinfo, bthci_evt_tree);
7350 break;
7352 case 0x14: /* Mode Change */
7353 offset = dissect_bthci_evt_mode_change(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7354 add_opcode(pinfo->pool, opcode_list, 0x0803, COMMAND_STATUS_NORMAL); /* Sniff Mode */
7355 add_opcode(pinfo->pool, opcode_list, 0x0804, COMMAND_STATUS_NORMAL); /* Exit Sniff Mode */
7356 break;
7358 case 0x15: /* Return Link Keys */
7359 offset = dissect_bthci_evt_return_link_keys(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7360 break;
7362 case 0x16: /* PIN Code Request */
7363 offset = dissect_bthci_evt_pin_code_request(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7364 break;
7366 case 0x17: /* Link Key Request */
7367 offset = dissect_bthci_evt_link_key_request(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7368 break;
7370 case 0x18: /* Link Key Notification */
7371 offset = dissect_bthci_evt_link_key_notification(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7372 break;
7374 case 0x19: /* Loopback Command */
7375 offset = dissect_bthci_evt_loopback_command(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7376 break;
7378 case 0x1a: /* Data Buffer Overflow */
7379 offset = dissect_bthci_evt_data_buffer_overflow(tvb, offset, pinfo, bthci_evt_tree);
7380 break;
7382 case 0x1b: /* Max Slots Change */
7383 offset = dissect_bthci_evt_max_slots_change(tvb, offset, pinfo, bthci_evt_tree);
7384 break;
7386 case 0x1c: /* Read Clock Offset Complete */
7387 offset = dissect_bthci_evt_read_clock_offset_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7388 add_opcode(pinfo->pool, opcode_list, 0x041F, COMMAND_STATUS_NORMAL); /* Read Clock Offset */
7389 break;
7391 case 0x1d: /* Connection Packet Type Changed */
7392 offset = dissect_bthci_evt_conn_packet_type_changed(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7393 add_opcode(pinfo->pool, opcode_list, 0x040F, COMMAND_STATUS_NORMAL); /* Change Connection Packet Type */
7394 break;
7396 case 0x1e: /* QoS Violation */
7397 offset = dissect_bthci_evt_qos_violation(tvb, offset, pinfo, bthci_evt_tree);
7398 break;
7400 case 0x1f: /* Page Scan Mode Change */
7401 offset = dissect_bthci_evt_page_scan_mode_change(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7402 break;
7404 case 0x20: /* Page Scan Repetition Mode Change */
7405 offset = dissect_bthci_evt_page_scan_repetition_mode_change(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7406 break;
7408 case 0x21: /* Flow Specification Complete */
7409 offset = dissect_bthci_evt_flow_specification_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7410 break;
7412 case 0x22: /* Inquiry Result with RSSI */
7413 offset = dissect_bthci_evt_inquire_result_with_rssi(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data, NULL);
7414 break;
7416 case 0x23: /* Read Remote Extended Features Complete */
7417 offset = dissect_bthci_evt_read_remote_ext_features_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7418 add_opcode(pinfo->pool, opcode_list, 0x41C, COMMAND_STATUS_NORMAL); /* Read Remote Supported Features */
7419 break;
7421 case 0x2c: /* Synchronous Connection Complete */
7422 offset = dissect_bthci_evt_sync_connection_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7423 add_opcode(pinfo->pool, opcode_list, 0x0429, COMMAND_STATUS_NORMAL); /* Accept Synchronous Connection Request */
7424 add_opcode(pinfo->pool, opcode_list, 0x0428, COMMAND_STATUS_NORMAL); /* Setup Synchronous Connection */
7425 add_opcode(pinfo->pool, opcode_list, 0x043D, COMMAND_STATUS_NORMAL); /* Enhanced Setup Synchronous Connection */
7426 add_opcode(pinfo->pool, opcode_list, 0x043E, COMMAND_STATUS_NORMAL); /* Enhanced Accept Synchronous Connection Request */
7427 break;
7429 case 0x2d: /* Synchronous Connection Changed */
7430 offset = dissect_bthci_evt_sync_connection_changed(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7431 add_opcode(pinfo->pool, opcode_list, 0x043D, COMMAND_STATUS_NORMAL); /* Enhanced Setup Synchronous Connection */
7432 break;
7434 case 0x2e: /* Sniff Subrating */
7435 offset = dissect_bthci_evt_sniff_subrating(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7436 break;
7438 case 0x2f: /* Extended Inquiry Result */
7440 bluetooth_eir_ad_data_t *eir_data;
7442 previous_offset = offset;
7443 offset = dissect_bthci_evt_inquire_result_with_rssi(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data, bd_addr);
7445 eir_data = wmem_new0(pinfo->pool, bluetooth_eir_ad_data_t);
7446 eir_data->interface_id = bluetooth_data->interface_id;
7447 eir_data->adapter_id = bluetooth_data->adapter_id;
7448 eir_data->bd_addr = bd_addr;
7451 call_dissector_with_data(btcommon_eir_handle, tvb_new_subset_length(tvb, offset, 240), pinfo, bthci_evt_tree, eir_data);
7452 save_remote_device_name(tvb, offset, pinfo, 240, (offset - previous_offset <= 1) ? NULL : bd_addr, bluetooth_data);
7453 offset += 240;
7456 break;
7458 case 0x30: /* Encryption Key Refresh Complete */
7459 offset = dissect_bthci_evt_encryption_key_refresh_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7460 add_opcode(pinfo->pool, opcode_list, 0x2019, COMMAND_STATUS_NORMAL); /* LE Start Encryption */
7461 break;
7463 case 0x31: /* IO Capability Request */
7464 offset = dissect_bthci_evt_io_capability_request(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7465 break;
7467 case 0x32: /* IO Capability Response */
7468 offset = dissect_bthci_evt_io_capability_response(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7469 break;
7471 case 0x33: /* User Confirmation Request */
7472 offset = dissect_bthci_evt_user_confirmation_request(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7473 break;
7475 case 0x34: /* User Passkey Request */
7476 offset = dissect_bthci_evt_user_passkey_request(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7477 break;
7479 case 0x35: /* Remote OOB Data Request */
7480 offset = dissect_bthci_evt_remote_oob_data_request(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7481 break;
7483 case 0x36: /* Simple Pairing Complete */
7484 offset = dissect_bthci_evt_simple_pairing_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7485 break;
7487 case 0x38: /* Link Supervision Timeout Changed */
7488 offset = dissect_bthci_evt_link_supervision_timeout_changed(tvb, offset, pinfo, bthci_evt_tree);
7489 break;
7491 case 0x39: /* Enhanced Flush Complete */
7492 offset = dissect_bthci_evt_enhanced_flush_complete(tvb, offset, pinfo, bthci_evt_tree);
7493 break;
7495 case 0x3b: /* Enhanced Flush Complete */
7496 offset = dissect_bthci_evt_user_passkey_notification(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7497 break;
7499 case 0x3c: /* Enhanced Flush Complete */
7500 offset = dissect_bthci_evt_keypress_notification(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7501 break;
7503 case 0x3d: /* Remote Host Supported Features Notification */
7504 offset = dissect_bthci_evt_remote_host_sup_feat_notification(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7505 break;
7507 case 0x3e: /* LE Meta */
7508 offset = dissect_bthci_evt_le_meta(tvb, offset, pinfo, bthci_evt_tree, opcode_list, bluetooth_data);
7509 break;
7511 case 0x40: /* Physical Link Complete */
7512 offset = dissect_bthci_evt_physical_link_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7513 break;
7515 case 0x41: /* Channel Selected */
7516 case 0x44: /* Physical Link Recovery */
7517 offset = dissect_bthci_evt_channel_select_physical_link_recovery(tvb, offset, pinfo, bthci_evt_tree);
7518 break;
7520 case 0x42: /* Disconnect Physical Link Complete */
7521 offset = dissect_bthci_evt_disconnect_physical_link_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7522 break;
7524 case 0x43: /* Physical Link Loss Early Warning */
7525 offset = dissect_bthci_evt_physical_link_loss_early_warning(tvb, offset, pinfo, bthci_evt_tree);
7526 break;
7528 case 0x45: /* Logical Link Complete */
7529 offset = dissect_bthci_evt_logical_link_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7530 break;
7532 case 0x46: /* Disconnect Logical Link Complete */
7533 offset = dissect_bthci_evt_disconnect_logical_link_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7534 break;
7536 case 0x47: /* Flow Spec Modify Complete */
7537 offset = dissect_bthci_evt_flow_spec_modify_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7538 break;
7540 case 0x48: /* Number Of Completed Data Blocks */
7541 offset = dissect_bthci_evt_number_of_completed_data_blocks(tvb, offset, pinfo, bthci_evt_tree);
7542 break;
7544 case 0x49: /* AMP Start Test */
7545 offset = dissect_bthci_evt_amp_start_stop_test(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7546 add_opcode(pinfo->pool, opcode_list, 0x1809, COMMAND_STATUS_NORMAL); /* AMP Test */
7547 break;
7549 case 0x4a: /* AMP Test End */
7550 offset = dissect_bthci_evt_amp_start_stop_test(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7551 add_opcode(pinfo->pool, opcode_list, 0x1808, COMMAND_STATUS_NORMAL); /* AMP Test End */
7552 break;
7554 case 0x4b: /* AMP Receiver Test */
7555 offset = dissect_bthci_evt_amp_receiver_test(tvb, offset, pinfo, bthci_evt_tree);
7556 break;
7558 case 0x4c: /* Short Range Mode Change Complete */
7559 offset = dissect_bthci_evt_short_range_mode_change_complete(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7560 break;
7562 case 0x4d: /* AMP Status Change */
7563 offset = dissect_bthci_evt_amp_status_change(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
7564 break;
7566 case 0x4e: /* Triggered Clock Capture */
7567 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7568 offset += 2;
7570 proto_tree_add_item(tree, hf_bthci_evt_which_clock, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7571 offset += 1;
7573 proto_tree_add_item(tree, hf_bthci_evt_clock, tvb, offset, 4, ENC_LITTLE_ENDIAN);
7574 offset += 4;
7576 proto_tree_add_item(tree, hf_bthci_evt_slot_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7577 offset += 2;
7579 break;
7580 case 0x4f: /* Synchronization Train Complete */
7581 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7582 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
7583 offset += 1;
7585 break;
7586 case 0x50: /* Synchronization Train Received */
7587 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7588 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
7589 offset += 1;
7591 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
7593 proto_tree_add_item(tree, hf_bthci_evt_clock_offset_32, tvb, offset, 4, ENC_LITTLE_ENDIAN);
7594 offset += 4;
7596 proto_tree_add_item(tree, hf_bthci_evt_afh_channel_map, tvb, offset, 10, ENC_NA);
7597 offset += 10;
7599 proto_tree_add_item(tree, hf_bthci_evt_lt_addr, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7600 offset += 1;
7602 proto_tree_add_item(tree, hf_bthci_evt_next_broadcast_instant, tvb, offset, 4, ENC_LITTLE_ENDIAN);
7603 offset += 4;
7605 proto_tree_add_item(tree, hf_bthci_evt_connectionless_peripheral_broadcast_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7606 offset += 2;
7608 proto_tree_add_item(tree, hf_bthci_evt_service_data, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7609 offset += 1;
7611 break;
7612 case 0x51: /* Connectionless Peripheral Broadcast Receive */
7614 uint8_t length;
7616 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
7618 proto_tree_add_item(tree, hf_bthci_evt_lt_addr, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7619 offset += 1;
7621 proto_tree_add_item(tree, hf_bthci_evt_clock, tvb, offset, 4, ENC_LITTLE_ENDIAN);
7622 offset += 4;
7624 proto_tree_add_item(tree, hf_bthci_evt_clock_offset_32, tvb, offset, 4, ENC_LITTLE_ENDIAN);
7625 offset += 4;
7627 proto_tree_add_item(tree, hf_bthci_evt_receive_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7628 offset += 1;
7630 proto_tree_add_item(tree, hf_bthci_evt_fragment, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7631 offset += 1;
7633 proto_tree_add_item(tree, hf_bthci_evt_data_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7634 length = tvb_get_uint8(tvb, offset);
7635 offset += 1;
7637 proto_tree_add_item(tree, hf_bthci_evt_data, tvb, offset, length, ENC_NA);
7638 offset += 1;
7641 break;
7642 case 0x52: /* Connectionless Peripheral Broadcast Timeout */
7643 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
7645 proto_tree_add_item(tree, hf_bthci_evt_lt_addr, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7646 offset += 1;
7648 break;
7649 case 0x53: /* Truncated Page Complete */
7650 proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7651 send_hci_summary_status_tap(tvb_get_uint8(tvb, offset), pinfo, bluetooth_data);
7652 offset += 1;
7654 offset = dissect_bd_addr(hf_bthci_evt_bd_addr, pinfo, tree, tvb, offset, false, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL);
7656 break;
7657 case 0x54: /* Peripheral Page Response Timeout */
7658 /* NOTE: no parameters */
7659 break;
7660 case 0x55: /* Connectionless Peripheral Broadcast Channel Map Change */
7661 proto_tree_add_item(tree, hf_bthci_evt_afh_channel_map, tvb, offset, 10, ENC_NA);
7662 offset += 10;
7664 break;
7665 case 0x56: /* Inquiry Response Notification */
7666 proto_tree_add_item(tree, hf_bthci_evt_iac_lap, tvb, offset, 3, ENC_LITTLE_ENDIAN);
7667 offset += 3;
7669 proto_tree_add_item(tree, hf_bthci_evt_rssi, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7670 offset += 1;
7672 break;
7673 case 0x57: /* Authenticated Payload Timeout Expired */
7674 proto_tree_add_item(tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7675 offset += 2;
7677 break;
7678 case 0x58: /* SAM Status Change */
7679 offset = dissect_bthci_evt_sam_status_change(tvb, offset, pinfo, bthci_evt_tree);
7680 break;
7682 case 0xff: /* Vendor-Specific */
7684 tvbuff_t *vendor_payload_tvb;
7685 vendor_payload_tvb = tvb_new_subset_remaining(tvb, 2); // Bytes after length byte.
7687 if (!dissector_try_payload_with_data(hci_evt_vendor_dissector_table, vendor_payload_tvb, pinfo, tree, true, bluetooth_data)) {
7688 if (bluetooth_data) {
7689 hci_vendor_data_t *hci_vendor_data;
7690 wmem_tree_key_t key[3];
7691 uint32_t interface_id;
7692 uint32_t adapter_id;
7694 interface_id = bluetooth_data->interface_id;
7695 adapter_id = bluetooth_data->adapter_id;
7697 key[0].length = 1;
7698 key[0].key = &interface_id;
7699 key[1].length = 1;
7700 key[1].key = &adapter_id;
7701 key[2].length = 0;
7702 key[2].key = NULL;
7704 hci_vendor_data = (hci_vendor_data_t *) wmem_tree_lookup32_array(bluetooth_data->hci_vendors, key);
7705 if (hci_vendor_data) {
7706 int sub_offset = 0;
7708 if (bthci_vendor_android) {
7709 sub_offset = dissector_try_uint_with_data(hci_vendor_table, bthci_vendor_manufacturer_android, tvb, pinfo, tree, true, bluetooth_data);
7710 } else {
7711 sub_offset = dissector_try_uint_with_data(hci_vendor_table, hci_vendor_data->manufacturer, tvb, pinfo, tree, true, bluetooth_data);
7714 if (sub_offset > 0 && sub_offset < tvb_captured_length_remaining(tvb, offset))
7715 proto_tree_add_expert(bthci_evt_tree, pinfo, &ei_parameter_unexpected, tvb, offset + sub_offset, tvb_captured_length_remaining(tvb, sub_offset + offset));
7720 proto_tree_add_expert(bthci_evt_tree, pinfo, &ei_event_undecoded, tvb, offset, tvb_captured_length_remaining(tvb, offset));
7722 return tvb_captured_length(tvb);
7724 default:
7725 proto_tree_add_expert(bthci_evt_tree, pinfo, &ei_event_unknown_event, tvb, offset, tvb_captured_length_remaining(tvb, offset));
7726 offset += tvb_reported_length_remaining(tvb, offset);
7727 break;
7731 opcode_list_frame = wmem_list_head(opcode_list);
7733 while (opcode_list_frame) {
7734 wmem_tree_key_t key[4];
7735 uint32_t interface_id;
7736 uint32_t adapter_id;
7737 uint32_t frame_number;
7738 bthci_cmd_data_t *bthci_cmd_data;
7739 wmem_tree_t *subtree;
7740 int i_frame_number;
7742 interface_id = bluetooth_data->interface_id;
7743 adapter_id = bluetooth_data->adapter_id;
7744 frame_number = pinfo->num;
7746 opcode_list_data = (opcode_list_data_t *) wmem_list_frame_data(opcode_list_frame);
7747 opcode = opcode_list_data->opcode;
7749 key[0].length = 1;
7750 key[0].key = &interface_id;
7751 key[1].length = 1;
7752 key[1].key = &adapter_id;
7753 key[2].length = 1;
7754 key[2].key = &opcode;
7755 key[3].length = 0;
7756 key[3].key = NULL;
7758 subtree = (wmem_tree_t *) wmem_tree_lookup32_array(bthci_cmds, key);
7760 i_frame_number = frame_number;
7762 do {
7763 bthci_cmd_data = (subtree) ? (bthci_cmd_data_t *) wmem_tree_lookup32_le(subtree, i_frame_number) : NULL;
7764 if (bthci_cmd_data && bthci_cmd_data->command_in_frame < frame_number && (
7765 (opcode_list_data->command_status == COMMAND_STATUS_NORMAL &&
7766 (bthci_cmd_data->response_in_frame == frame_number ||
7767 bthci_cmd_data->response_in_frame == bluetooth_max_disconnect_in_frame)) ||
7768 (opcode_list_data->command_status == COMMAND_STATUS_PENDING &&
7769 (bthci_cmd_data->pending_in_frame == frame_number ||
7770 ((bthci_cmd_data->response_in_frame == bluetooth_max_disconnect_in_frame ||
7771 bthci_cmd_data->response_in_frame > frame_number) &&
7772 bthci_cmd_data->pending_in_frame == bluetooth_max_disconnect_in_frame))) ||
7773 (opcode_list_data->command_status == COMMAND_STATUS_RESULT &&
7774 (bthci_cmd_data->response_in_frame == frame_number ||
7775 ((bthci_cmd_data->response_in_frame == bluetooth_max_disconnect_in_frame &&
7776 bthci_cmd_data->pending_in_frame == bluetooth_max_disconnect_in_frame))))
7777 )) {
7778 lastest_bthci_cmd_data = bthci_cmd_data;
7779 if (((opcode_list_data->command_status == COMMAND_STATUS_RESULT ||
7780 opcode_list_data->command_status == COMMAND_STATUS_NORMAL) &&
7781 bthci_cmd_data->response_in_frame == frame_number) ||
7782 (opcode_list_data->command_status == COMMAND_STATUS_PENDING &&
7783 bthci_cmd_data->pending_in_frame == frame_number)) {
7784 opcode_list_frame = NULL;
7785 break;
7789 if (bthci_cmd_data && bthci_cmd_data->command_in_frame < frame_number) {
7790 i_frame_number = bthci_cmd_data->command_in_frame - 1;
7791 if (i_frame_number < 1)
7792 bthci_cmd_data = NULL;
7793 } else {
7794 bthci_cmd_data = NULL;
7796 } while (bthci_cmd_data);
7798 if (opcode_list_frame)
7799 opcode_list_frame = wmem_list_frame_next(opcode_list_frame);
7802 if (lastest_bthci_cmd_data) {
7803 proto_item *sub_item;
7804 uint32_t frame_number;
7805 nstime_t delta;
7807 frame_number = pinfo->num;
7809 if (evt_code == 0x0e /* Command Complete */ && opcode != UINT32_MAX && opcode >> 10 != HCI_OGF_VENDOR_SPECIFIC) {
7810 bluetooth_device_tap_t *tap_device;
7811 uint8_t status;
7813 status = tvb_get_uint8(tvb, 5);
7815 if (status == STATUS_SUCCESS && have_tap_listener(bluetooth_device_tap)) switch(opcode) {
7816 case 0x0c03: /* Reset */
7818 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
7819 if (bluetooth_data) {
7820 tap_device->interface_id = bluetooth_data->interface_id;
7821 tap_device->adapter_id = bluetooth_data->adapter_id;
7822 } else {
7823 tap_device->interface_id = HCI_INTERFACE_DEFAULT;
7824 tap_device->adapter_id = HCI_ADAPTER_DEFAULT;
7826 tap_device->has_bd_addr = false;
7827 tap_device->is_local = true;
7828 tap_device->type = BLUETOOTH_DEVICE_RESET;
7829 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
7831 break;
7832 case 0x0c13: /* Change Local Name */
7834 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
7835 if (bluetooth_data) {
7836 tap_device->interface_id = bluetooth_data->interface_id;
7837 tap_device->adapter_id = bluetooth_data->adapter_id;
7838 } else {
7839 tap_device->interface_id = HCI_INTERFACE_DEFAULT;
7840 tap_device->adapter_id = HCI_ADAPTER_DEFAULT;
7843 tap_device->has_bd_addr = false;
7844 tap_device->is_local = true;
7845 tap_device->type = BLUETOOTH_DEVICE_NAME;
7846 tap_device->data.name = lastest_bthci_cmd_data->data.name;
7847 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
7849 if (!pinfo->fd->visited) {
7850 localhost_name_entry_t *localhost_name_entry;
7851 wmem_tree_key_t key[4];
7852 uint32_t interface_id;
7853 uint32_t adapter_id;
7855 interface_id = bluetooth_data->interface_id;
7856 adapter_id = bluetooth_data->adapter_id;
7858 key[0].length = 1;
7859 key[0].key = &interface_id;
7860 key[1].length = 1;
7861 key[1].key = &adapter_id;
7862 key[2].length = 1;
7863 key[2].key = &frame_number;
7864 key[3].length = 0;
7865 key[3].key = NULL;
7867 localhost_name_entry = (localhost_name_entry_t *) wmem_new(wmem_file_scope(), localhost_name_entry_t);
7868 localhost_name_entry->interface_id = interface_id;
7869 localhost_name_entry->adapter_id = adapter_id;
7870 localhost_name_entry->name = lastest_bthci_cmd_data->data.name;
7872 wmem_tree_insert32_array(bluetooth_data->localhost_name, key, localhost_name_entry);
7874 break;
7875 case 0x0c18: /* Write Page Timeout */
7877 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
7878 if (bluetooth_data) {
7879 tap_device->interface_id = bluetooth_data->interface_id;
7880 tap_device->adapter_id = bluetooth_data->adapter_id;
7881 } else {
7882 tap_device->interface_id = HCI_INTERFACE_DEFAULT;
7883 tap_device->adapter_id = HCI_ADAPTER_DEFAULT;
7885 tap_device->has_bd_addr = false;
7886 tap_device->is_local = true;
7887 tap_device->type = BLUETOOTH_DEVICE_PAGE_TIMEOUT;
7888 tap_device->data.page_timeout = lastest_bthci_cmd_data->data.page_timeout;
7889 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
7891 break;
7892 case 0x0c1a: /* Write Scan Enable */
7894 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
7895 if (bluetooth_data) {
7896 tap_device->interface_id = bluetooth_data->interface_id;
7897 tap_device->adapter_id = bluetooth_data->adapter_id;
7898 } else {
7899 tap_device->interface_id = HCI_INTERFACE_DEFAULT;
7900 tap_device->adapter_id = HCI_ADAPTER_DEFAULT;
7902 tap_device->has_bd_addr = false;
7903 tap_device->is_local = true;
7904 tap_device->type = BLUETOOTH_DEVICE_SCAN;
7905 tap_device->data.scan = lastest_bthci_cmd_data->data.scan;
7906 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
7908 break;
7909 case 0x0c20: /* Write Authentication Enable */
7911 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
7912 if (bluetooth_data) {
7913 tap_device->interface_id = bluetooth_data->interface_id;
7914 tap_device->adapter_id = bluetooth_data->adapter_id;
7915 } else {
7916 tap_device->interface_id = HCI_INTERFACE_DEFAULT;
7917 tap_device->adapter_id = HCI_ADAPTER_DEFAULT;
7919 tap_device->has_bd_addr = false;
7920 tap_device->is_local = true;
7921 tap_device->type = BLUETOOTH_DEVICE_AUTHENTICATION;
7922 tap_device->data.authentication = lastest_bthci_cmd_data->data.authentication;
7923 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
7925 break;
7926 case 0x0c22: /* Write Encryption Mode */
7928 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
7929 if (bluetooth_data) {
7930 tap_device->interface_id = bluetooth_data->interface_id;
7931 tap_device->adapter_id = bluetooth_data->adapter_id;
7932 } else {
7933 tap_device->interface_id = HCI_INTERFACE_DEFAULT;
7934 tap_device->adapter_id = HCI_ADAPTER_DEFAULT;
7936 tap_device->has_bd_addr = false;
7937 tap_device->is_local = true;
7938 tap_device->type = BLUETOOTH_DEVICE_ENCRYPTION;
7939 tap_device->data.encryption = lastest_bthci_cmd_data->data.encryption;
7940 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
7942 break;
7943 case 0x0c24: /* Write Class Of Device */
7945 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
7946 if (bluetooth_data) {
7947 tap_device->interface_id = bluetooth_data->interface_id;
7948 tap_device->adapter_id = bluetooth_data->adapter_id;
7949 } else {
7950 tap_device->interface_id = HCI_INTERFACE_DEFAULT;
7951 tap_device->adapter_id = HCI_ADAPTER_DEFAULT;
7953 tap_device->has_bd_addr = false;
7954 tap_device->is_local = true;
7955 tap_device->type = BLUETOOTH_DEVICE_CLASS_OF_DEVICE;
7956 tap_device->data.class_of_device = lastest_bthci_cmd_data->data.class_of_device;
7957 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
7959 break;
7960 case 0x0c26: /* Write Voice Setting */
7962 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
7963 if (bluetooth_data) {
7964 tap_device->interface_id = bluetooth_data->interface_id;
7965 tap_device->adapter_id = bluetooth_data->adapter_id;
7966 } else {
7967 tap_device->interface_id = HCI_INTERFACE_DEFAULT;
7968 tap_device->adapter_id = HCI_ADAPTER_DEFAULT;
7970 tap_device->has_bd_addr = false;
7971 tap_device->is_local = true;
7972 tap_device->type = BLUETOOTH_DEVICE_VOICE_SETTING;
7973 tap_device->data.voice_setting = lastest_bthci_cmd_data->data.voice_setting;
7974 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
7976 break;
7977 case 0x0c33: /* Host Buffer Size */
7979 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
7980 if (bluetooth_data) {
7981 tap_device->interface_id = bluetooth_data->interface_id;
7982 tap_device->adapter_id = bluetooth_data->adapter_id;
7983 } else {
7984 tap_device->interface_id = HCI_INTERFACE_DEFAULT;
7985 tap_device->adapter_id = HCI_ADAPTER_DEFAULT;
7987 tap_device->has_bd_addr = false;
7988 tap_device->is_local = true;
7989 tap_device->type = BLUETOOTH_DEVICE_MTUS;
7990 tap_device->data.mtus.acl_mtu = lastest_bthci_cmd_data->data.mtus.acl_mtu;
7991 tap_device->data.mtus.sco_mtu = lastest_bthci_cmd_data->data.mtus.sco_mtu;
7992 tap_device->data.mtus.acl_packets = lastest_bthci_cmd_data->data.mtus.acl_packets;
7993 tap_device->data.mtus.sco_packets = lastest_bthci_cmd_data->data.mtus.sco_packets;
7994 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
7996 break;
7997 case 0x0c45: /* Write Inquiry Mode */
7999 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
8000 if (bluetooth_data) {
8001 tap_device->interface_id = bluetooth_data->interface_id;
8002 tap_device->adapter_id = bluetooth_data->adapter_id;
8003 } else {
8004 tap_device->interface_id = HCI_INTERFACE_DEFAULT;
8005 tap_device->adapter_id = HCI_ADAPTER_DEFAULT;
8007 tap_device->has_bd_addr = false;
8008 tap_device->is_local = true;
8009 tap_device->type = BLUETOOTH_DEVICE_INQUIRY_MODE;
8010 tap_device->data.inquiry_mode = lastest_bthci_cmd_data->data.inquiry_mode;
8011 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
8013 break;
8014 case 0x0c56: /* Write Simple Pairing */
8016 tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t);
8017 if (bluetooth_data) {
8018 tap_device->interface_id = bluetooth_data->interface_id;
8019 tap_device->adapter_id = bluetooth_data->adapter_id;
8020 } else {
8021 tap_device->interface_id = HCI_INTERFACE_DEFAULT;
8022 tap_device->adapter_id = HCI_ADAPTER_DEFAULT;
8024 tap_device->has_bd_addr = false;
8025 tap_device->is_local = true;
8026 tap_device->type = BLUETOOTH_DEVICE_SIMPLE_PAIRING_MODE;
8027 tap_device->data.simple_pairing_mode = lastest_bthci_cmd_data->data.simple_pairing_mode;
8028 tap_queue_packet(bluetooth_device_tap, pinfo, tap_device);
8030 break;
8034 if (!pinfo->fd->visited && opcode_list_data->command_status == COMMAND_STATUS_PENDING &&
8035 lastest_bthci_cmd_data->pending_in_frame == bluetooth_max_disconnect_in_frame) {
8036 lastest_bthci_cmd_data->pending_in_frame = frame_number;
8037 lastest_bthci_cmd_data->pending_abs_ts = pinfo->abs_ts;
8040 if (!pinfo->fd->visited && opcode_list_data->command_status == COMMAND_STATUS_NORMAL &&
8041 lastest_bthci_cmd_data->response_in_frame == bluetooth_max_disconnect_in_frame) {
8042 lastest_bthci_cmd_data->response_in_frame = frame_number;
8043 lastest_bthci_cmd_data->response_abs_ts = pinfo->abs_ts;
8046 if (!pinfo->fd->visited && opcode_list_data->command_status == COMMAND_STATUS_RESULT &&
8047 lastest_bthci_cmd_data->response_in_frame == bluetooth_max_disconnect_in_frame &&
8048 lastest_bthci_cmd_data->pending_in_frame == bluetooth_max_disconnect_in_frame) {
8049 lastest_bthci_cmd_data->response_in_frame = frame_number;
8050 lastest_bthci_cmd_data->response_abs_ts = pinfo->abs_ts;
8053 if (lastest_bthci_cmd_data->pending_in_frame == frame_number) {
8054 sub_item = proto_tree_add_uint(bthci_evt_tree, hf_command_in_frame, tvb, 0, 0, lastest_bthci_cmd_data->command_in_frame);
8055 proto_item_set_generated(sub_item);
8057 if (lastest_bthci_cmd_data->response_in_frame < bluetooth_max_disconnect_in_frame) {
8058 sub_item = proto_tree_add_uint(bthci_evt_tree, hf_response_in_frame, tvb, 0, 0, lastest_bthci_cmd_data->response_in_frame);
8059 proto_item_set_generated(sub_item);
8062 nstime_delta(&delta, &lastest_bthci_cmd_data->pending_abs_ts, &lastest_bthci_cmd_data->command_abs_ts);
8063 sub_item = proto_tree_add_double(bthci_evt_tree, hf_command_pending_time_delta, tvb, 0, 0, nstime_to_msec(&delta));
8064 proto_item_set_generated(sub_item);
8066 if (lastest_bthci_cmd_data->response_in_frame < bluetooth_max_disconnect_in_frame) {
8067 nstime_delta(&delta, &lastest_bthci_cmd_data->response_abs_ts, &lastest_bthci_cmd_data->pending_abs_ts);
8068 sub_item = proto_tree_add_double(bthci_evt_tree, hf_pending_response_time_delta, tvb, 0, 0, nstime_to_msec(&delta));
8069 proto_item_set_generated(sub_item);
8073 if (lastest_bthci_cmd_data->response_in_frame == frame_number) {
8074 sub_item = proto_tree_add_uint(bthci_evt_tree, hf_command_in_frame, tvb, 0, 0, lastest_bthci_cmd_data->command_in_frame);
8075 proto_item_set_generated(sub_item);
8077 if (lastest_bthci_cmd_data->pending_in_frame < bluetooth_max_disconnect_in_frame) {
8078 sub_item = proto_tree_add_uint(bthci_evt_tree, hf_pending_in_frame, tvb, 0, 0, lastest_bthci_cmd_data->pending_in_frame);
8079 proto_item_set_generated(sub_item);
8081 nstime_delta(&delta, &lastest_bthci_cmd_data->response_abs_ts, &lastest_bthci_cmd_data->pending_abs_ts);
8082 sub_item = proto_tree_add_double(bthci_evt_tree, hf_pending_response_time_delta, tvb, 0, 0, nstime_to_msec(&delta));
8083 proto_item_set_generated(sub_item);
8086 nstime_delta(&delta, &lastest_bthci_cmd_data->response_abs_ts, &lastest_bthci_cmd_data->command_abs_ts);
8087 sub_item = proto_tree_add_double(bthci_evt_tree, hf_command_response_time_delta, tvb, 0, 0, nstime_to_msec(&delta));
8088 proto_item_set_generated(sub_item);
8092 return offset;
8096 /* Register the protocol with Wireshark */
8098 void
8099 proto_register_bthci_evt(void)
8101 module_t *module;
8102 expert_module_t *expert_bthci_evt;
8104 /* Setup list of header fields See Section 1.6.1 for details*/
8105 static hf_register_info hf[] = {
8106 { &hf_bthci_evt_code,
8107 { "Event Code", "bthci_evt.code",
8108 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_evt_evt_code_vals_ext, 0x0,
8109 NULL, HFILL }
8111 { &hf_bthci_evt_param_length,
8112 { "Parameter Total Length", "bthci_evt.param_length",
8113 FT_UINT8, BASE_DEC, NULL, 0x0,
8114 NULL, HFILL }
8116 { &hf_bthci_evt_num_command_packets,
8117 { "Number of Allowed Command Packets", "bthci_evt.num_command_packets",
8118 FT_UINT8, BASE_DEC, NULL, 0x0,
8119 NULL, HFILL }
8121 { &hf_bthci_evt_num_handles,
8122 { "Number of Connection Handles", "bthci_evt.num_handles",
8123 FT_UINT8, BASE_DEC, NULL, 0x0,
8124 "Number of Connection Handles and Num_HCI_Data_Packets parameter pairs", HFILL }
8126 { &hf_bthci_evt_connection_handle,
8127 { "Connection Handle", "bthci_evt.connection_handle",
8128 FT_UINT16, BASE_HEX, NULL, 0x0,
8129 NULL, HFILL }
8132 { &hf_bthci_evt_num_compl_packets,
8133 { "Number of Completed Packets", "bthci_evt.num_compl_packets",
8134 FT_UINT16, BASE_DEC, NULL, 0x0,
8135 "The number of HCI Data Packets that have been completed", HFILL }
8138 { &hf_bthci_evt_opcode,
8139 { "Command Opcode", "bthci_evt.opcode",
8140 FT_UINT16, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_opcode_vals_ext, 0x0,
8141 "HCI Command Opcode", HFILL }
8143 { &hf_bthci_evt_ogf,
8144 { "Opcode Group Field", "bthci_evt.opcode.ogf",
8145 FT_UINT16, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_ogf_vals_ext, 0xfc00,
8146 NULL, HFILL }
8148 { &hf_bthci_evt_ocf_link_control,
8149 { "Opcode Command Field", "bthci_evt.opcode.ocf",
8150 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_ocf_link_control_vals_ext, 0x03ff,
8151 NULL, HFILL }
8153 { &hf_bthci_evt_ocf_link_policy,
8154 { "Opcode Command Field", "bthci_evt.opcode.ocf",
8155 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_ocf_link_policy_vals_ext, 0x03ff,
8156 NULL, HFILL }
8158 { &hf_bthci_evt_ocf_host_controller_and_baseband,
8159 { "Opcode Command Field", "bthci_evt.opcode.ocf",
8160 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_ocf_host_controller_and_baseband_vals_ext, 0x03ff,
8161 NULL, HFILL }
8163 { &hf_bthci_evt_ocf_informational,
8164 { "Opcode Command Field", "bthci_evt.opcode.ocf",
8165 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_ocf_informational_vals_ext, 0x03ff,
8166 NULL, HFILL }
8168 { &hf_bthci_evt_ocf_status,
8169 { "Opcode Command Field", "bthci_evt.opcode.ocf",
8170 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_ocf_status_vals_ext, 0x03ff,
8171 NULL, HFILL }
8173 { &hf_bthci_evt_ocf_testing,
8174 { "Opcode Command Field", "bthci_evt.opcode.ocf",
8175 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_ocf_testing_vals_ext, 0x03ff,
8176 NULL, HFILL }
8178 { &hf_bthci_evt_ocf_low_energy,
8179 { "Opcode Command Field", "bthci_evt.opcode.ocf",
8180 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_ocf_low_energy_vals_ext, 0x03ff,
8181 NULL, HFILL }
8183 { &hf_bthci_evt_ocf_logo_testing,
8184 { "Opcode Command Field", "bthci_evt.opcode.ocf",
8185 FT_UINT16, BASE_HEX, NULL, 0x03ff,
8186 NULL, HFILL }
8188 { &hf_bthci_evt_ocf,
8189 { "Opcode Command Field", "bthci_evt.opcode.ocf",
8190 FT_UINT16, BASE_HEX, NULL, 0x03ff,
8191 NULL, HFILL }
8193 { &hf_bthci_evt_ret_params,
8194 { "Return Parameter", "bthci_evt.ret_params",
8195 FT_NONE, BASE_NONE, NULL, 0x0,
8196 NULL, HFILL }
8198 { &hf_bthci_evt_status,
8199 { "Status", "bthci_evt.status",
8200 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_status_vals_ext, 0x0,
8201 NULL, HFILL }
8203 { &hf_bthci_evt_status_pending,
8204 { "Status", "bthci_evt.status",
8205 FT_UINT8, BASE_HEX, VALS(bthci_cmd_status_pending_vals), 0x0,
8206 NULL, HFILL }
8208 { &hf_bthci_evt_bd_addr,
8209 { "BD_ADDR", "bthci_evt.bd_addr",
8210 FT_ETHER, BASE_NONE, NULL, 0x0,
8211 "Bluetooth Device Address", HFILL}
8213 { &hf_bthci_evt_link_type,
8214 { "Link Type", "bthci_evt.link_type",
8215 FT_UINT8, BASE_HEX, VALS(evt_link_types), 0x0,
8216 NULL, HFILL }
8218 { &hf_bthci_evt_encryption_mode,
8219 { "Encryption Mode", "bthci_evt.encryption_mode",
8220 FT_UINT8, BASE_HEX, VALS(evt_encryption_modes), 0x0,
8221 NULL, HFILL }
8223 { &hf_bthci_evt_reason,
8224 { "Reason", "bthci_evt.reason",
8225 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_status_vals_ext, 0x0,
8226 NULL, HFILL }
8228 { &hf_bthci_evt_remote_name,
8229 { "Remote Name", "bthci_evt.remote_name",
8230 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8231 "Userfriendly descriptive name for the remote device", HFILL }
8233 { &hf_bthci_evt_encryption_enable,
8234 { "Encryption Enable", "bthci_evt.encryption_enable",
8235 FT_UINT8, BASE_HEX, VALS(evt_encryption_enable), 0x0,
8236 NULL, HFILL }
8238 { &hf_bthci_evt_key_flag,
8239 { "Key Flag", "bthci_evt.key_flag",
8240 FT_UINT8, BASE_HEX, VALS(evt_key_flag), 0x0,
8241 NULL, HFILL }
8243 { &hf_bthci_evt_vers_nr,
8244 { "LMP Version", "bthci_evt.lmp_vers_nr",
8245 FT_UINT8, BASE_HEX, VALS(bthci_evt_lmp_version), 0x0,
8246 "Version of the Current LMP", HFILL }
8248 { &hf_bthci_bthci_evt_hci_version,
8249 { "HCI Version", "bthci_evt.hci_vers_nr",
8250 FT_UINT8, BASE_HEX, VALS(bthci_evt_hci_version), 0x0,
8251 "Version of the Current HCI", HFILL }
8253 { &hf_bthci_evt_hci_revision,
8254 { "HCI Revision", "bthci_evt.hci_vers_nr",
8255 FT_UINT16, BASE_DEC, NULL, 0x0,
8256 "Revision of the Current HCI", HFILL }
8258 { &hf_bthci_evt_comp_id,
8259 { "Manufacturer Name", "bthci_evt.comp_id",
8260 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bluetooth_company_id_vals_ext, 0x0,
8261 "Manufacturer Name of Bluetooth Hardware", HFILL }
8263 { &hf_bthci_evt_sub_vers_nr,
8264 { "LMP Subversion", "bthci_evt.lmp_sub_vers_nr",
8265 FT_UINT16, BASE_DEC, NULL, 0x0,
8266 "Subversion of the Current LMP", HFILL }
8268 { &hf_bthci_evt_flags,
8269 { "Flags", "bthci_evt.flags",
8270 FT_UINT8, BASE_HEX, NULL, 0x0,
8271 NULL, HFILL }
8273 { &hf_bthci_evt_service_type,
8274 { "Service Type", "bthci_evt.service_type",
8275 FT_UINT8, BASE_HEX, VALS(evt_service_types), 0x0,
8276 NULL, HFILL }
8278 { &hf_bthci_evt_token_rate,
8279 { "Available Token Rate", "bthci_evt.token_rate",
8280 FT_UINT32, BASE_DEC, NULL, 0x0,
8281 "Available Token Rate, in bytes per second", HFILL }
8283 { &hf_bthci_evt_peak_bandwidth,
8284 { "Available Peak Bandwidth", "bthci_evt.peak_bandwidth",
8285 FT_UINT32, BASE_DEC, NULL, 0x0,
8286 "Available Peak Bandwidth, in bytes per second", HFILL }
8288 { &hf_bthci_evt_latency,
8289 { "Available Latency", "bthci_evt.latency",
8290 FT_UINT32, BASE_DEC, NULL, 0x0,
8291 "Available Latency, in microseconds", HFILL }
8293 { &hf_bthci_evt_delay_variation,
8294 { "Available Delay Variation", "bthci_evt.delay_variation",
8295 FT_UINT32, BASE_DEC, NULL, 0x0,
8296 "Available Delay Variation, in microseconds", HFILL }
8298 { &hf_bthci_evt_hardware_code,
8299 { "Hardware Code", "bthci_evt.hardware_code",
8300 FT_UINT8, BASE_HEX, NULL, 0x0,
8301 "Hardware Code (implementation specific)", HFILL }
8303 { &hf_bthci_evt_role,
8304 { "Role", "bthci_evt.role",
8305 FT_UINT8, BASE_HEX, VALS(evt_role_vals), 0x0,
8306 NULL, HFILL }
8308 { &hf_bthci_evt_curr_mode,
8309 { "Current Mode", "bthci_evt.current_mode",
8310 FT_UINT8, BASE_HEX, VALS(evt_modes), 0x0,
8311 NULL, HFILL }
8313 { &hf_bthci_evt_interval,
8314 { "Interval", "bthci_evt.interval",
8315 FT_UINT16, BASE_CUSTOM, CF_FUNC(bluetooth_unit_0p625_ms), 0x0,
8316 "Interval - Number of Baseband slots", HFILL }
8318 { &hf_bthci_evt_link_key,
8319 { "Link Key", "bthci_evt.link_key",
8320 FT_BYTES, BASE_NONE, NULL, 0x0,
8321 "Link Key for the associated BD_ADDR", HFILL }
8323 { &hf_bthci_evt_key_type,
8324 { "Key Type", "bthci_evt.key_type",
8325 FT_UINT8, BASE_HEX, VALS(evt_key_types), 0x0,
8326 NULL, HFILL }
8328 { &hf_bthci_evt_max_slots,
8329 { "Maximum Number of Slots", "bthci_evt.max_slots",
8330 FT_UINT8, BASE_DEC, NULL, 0x0,
8331 "Maximum Number of slots allowed for baseband packets", HFILL }
8333 { &hf_bthci_evt_clock_offset,
8334 { "Clock Offset", "bthci_evt.clock_offset",
8335 FT_UINT16, BASE_HEX, NULL, 0x7FFF,
8336 "Bit 2-16 of the Clock Offset between CLKNPeripheral-CLK", HFILL }
8338 { &hf_bthci_evt_page_scan_mode,
8339 { "Page Scan Mode", "bthci_evt.page_scan_mode",
8340 FT_UINT8, BASE_HEX, VALS(bthci_cmd_page_scan_modes), 0x0,
8341 NULL, HFILL }
8343 { &hf_bthci_evt_page_scan_repetition_mode,
8344 { "Page Scan Repetition Mode", "bthci_evt.page_scan_repetition_mode",
8345 FT_UINT8, BASE_HEX, VALS(bthci_cmd_page_scan_repetition_modes), 0x0,
8346 NULL, HFILL }
8348 { &hf_bthci_evt_reserved,
8349 { "Reserved", "bthci_evt.reserved",
8350 FT_NONE, BASE_NONE, NULL, 0x0,
8351 NULL, HFILL }
8353 { &hf_bthci_evt_page_scan_period_mode,
8354 { "Page Scan Period Mode", "bthci_evt.page_scan_period_mode",
8355 FT_UINT8, BASE_HEX, VALS(bthci_cmd_page_scan_period_modes), 0x0,
8356 NULL, HFILL }
8358 { &hf_packet_type_acl,
8359 { "Packet Type for ACL", "bthci_evt.packet_type",
8360 FT_UINT16, BASE_HEX, NULL, 0,
8361 NULL, HFILL }
8363 { &hf_packet_type_acl_dh5,
8364 { "DH5 may be used", "bthci_evt.packet_type.dh5",
8365 FT_BOOLEAN, 16, NULL, 0x8000,
8366 NULL, HFILL }
8368 { &hf_packet_type_acl_dm5,
8369 { "DM5 may be used", "bthci_evt.packet_type.dm5",
8370 FT_BOOLEAN, 16, NULL, 0x4000,
8371 NULL, HFILL }
8373 { &hf_packet_type_acl_3dh5,
8374 { "3-DH5 shall NOT be used", "bthci_evt.packet_type.3dh5",
8375 FT_BOOLEAN, 16, NULL, 0x2000,
8376 NULL, HFILL }
8378 { &hf_packet_type_acl_2dh5,
8379 { "2-DH5 shall NOT be used", "bthci_evt.packet_type.2dh5",
8380 FT_BOOLEAN, 16, NULL, 0x1000,
8381 NULL, HFILL }
8383 { &hf_packet_type_acl_dh3,
8384 { "DH3 may be used", "bthci_evt.packet_type.dh3",
8385 FT_BOOLEAN, 16, NULL, 0x0800,
8386 NULL, HFILL }
8388 { &hf_packet_type_acl_dm3,
8389 { "DM3 may be used", "bthci_evt.packet_type.dm3",
8390 FT_BOOLEAN, 16, NULL, 0x0400,
8391 NULL, HFILL }
8393 { &hf_packet_type_acl_3dh3,
8394 { "3-DH3 shall NOT be used", "bthci_evt.packet_type.3dh3",
8395 FT_BOOLEAN, 16, NULL, 0x0200,
8396 NULL, HFILL }
8398 { &hf_packet_type_acl_2dh3,
8399 { "2-DH3 shall NOT be used", "bthci_evt.packet_type.2dh3",
8400 FT_BOOLEAN, 16, NULL, 0x0100,
8401 NULL, HFILL }
8403 { &hf_packet_type_acl_reserved_5_7,
8404 { "Reserved", "bthci_evt.packet_type.reserved_5_7",
8405 FT_UINT16, BASE_HEX, NULL, 0x00E0,
8406 NULL, HFILL }
8408 { &hf_packet_type_acl_dh1,
8409 { "DH1 may be used", "bthci_evt.packet_type.dh1",
8410 FT_BOOLEAN, 16, NULL, 0x0010,
8411 NULL, HFILL }
8413 { &hf_packet_type_acl_dm1,
8414 { "DM1 may be used", "bthci_evt.packet_type.dm1",
8415 FT_BOOLEAN, 16, NULL, 0x0008,
8416 NULL, HFILL }
8418 { &hf_packet_type_acl_3dh1,
8419 { "3-DH1 shall NOT be used", "bthci_evt.packet_type.3dh1",
8420 FT_BOOLEAN, 16, NULL, 0x0004,
8421 NULL, HFILL }
8423 { &hf_packet_type_acl_2dh1,
8424 { "2-DH1 shall NOT be used", "bthci_evt.packet_type.2dh1",
8425 FT_BOOLEAN, 16, NULL, 0x0002,
8426 NULL, HFILL }
8428 { &hf_packet_type_acl_reserved_0,
8429 { "Reserved", "bthci_evt.packet_type.reserved_0",
8430 FT_BOOLEAN, 16, NULL, 0x0001,
8431 NULL, HFILL }
8433 { &hf_packet_type_sco,
8434 { "Packet Type for SCO", "bthci_evt.packet_type",
8435 FT_UINT16, BASE_HEX, NULL, 0,
8436 NULL, HFILL }
8438 { &hf_packet_type_sco_reserved_15_8,
8439 { "Reserved", "bthci_evt.packet_type.reserved_15_8",
8440 FT_UINT16, BASE_HEX, NULL, 0xFF00,
8441 NULL, HFILL }
8443 { &hf_packet_type_sco_hv3,
8444 { "HV3", "bthci_evt.packet_type.hv3",
8445 FT_BOOLEAN, 16, NULL, 0x0080,
8446 NULL, HFILL }
8448 { &hf_packet_type_sco_hv2,
8449 { "HV2", "bthci_evt.packet_type.hv2",
8450 FT_BOOLEAN, 16, NULL, 0x0040,
8451 NULL, HFILL }
8453 { &hf_packet_type_sco_hv1,
8454 { "HV1", "bthci_evt.packet_type.hv1",
8455 FT_BOOLEAN, 16, NULL, 0x0020,
8456 NULL, HFILL }
8458 { &hf_packet_type_sco_reserved_4_0,
8459 { "Reserved", "bthci_evt.packet_type.reserved_4_0",
8460 FT_UINT16, BASE_HEX, NULL, 0x001F,
8461 NULL, HFILL }
8463 { &hf_lmp_features,
8464 { "LMP Features", "bthci_evt.lmp_features",
8465 FT_NONE, BASE_NONE, NULL, 0x00,
8466 NULL, HFILL }
8468 { &hf_lmp_feature_3slot_packets,
8469 { "3-slot packets", "bthci_evt.lmp_features.3slot_packets",
8470 FT_BOOLEAN, 8, NULL, 0x01,
8471 NULL, HFILL }
8473 { &hf_lmp_feature_5slot_packets,
8474 { "5-slot packets", "bthci_evt.lmp_features.5slot_packets",
8475 FT_BOOLEAN, 8, NULL, 0x02,
8476 NULL, HFILL }
8478 { &hf_lmp_feature_encryption,
8479 { "Encryption", "bthci_evt.lmp_features.encryption",
8480 FT_BOOLEAN, 8, NULL, 0x04,
8481 NULL, HFILL }
8483 { &hf_lmp_feature_slot_offset,
8484 { "Slot Offset", "bthci_evt.lmp_features.slot_offset",
8485 FT_BOOLEAN, 8, NULL, 0x08,
8486 NULL, HFILL }
8488 { &hf_lmp_feature_timing_accuracy,
8489 { "Timing Accuracy", "bthci_evt.lmp_features.timing_accuracy",
8490 FT_BOOLEAN, 8, NULL, 0x10,
8491 NULL, HFILL }
8493 { &hf_lmp_feature_role_switch,
8494 { "Role Switch", "bthci_evt.lmp_features.role_switch",
8495 FT_BOOLEAN, 8, NULL, 0x20,
8496 NULL, HFILL }
8498 { &hf_lmp_feature_hold_mode,
8499 { "Hold Mode", "bthci_evt.lmp_features.hold_mode",
8500 FT_BOOLEAN, 8, NULL, 0x40,
8501 NULL, HFILL }
8503 { &hf_lmp_feature_sniff_mode,
8504 { "Sniff Mode", "bthci_evt.lmp_features.sniff_mode",
8505 FT_BOOLEAN, 8, NULL, 0x80,
8506 NULL, HFILL }
8508 { &hf_lmp_feature_park_state,
8509 { "Park Mode", "bthci_evt.lmp_features.park_state",
8510 FT_BOOLEAN, 8, NULL, 0x01,
8511 NULL, HFILL }
8513 { &hf_lmp_feature_power_control_requests,
8514 { "Power Control Requests", "bthci_evt.lmp_features.power_control_requests",
8515 FT_BOOLEAN, 8, NULL, 0x02,
8516 NULL, HFILL }
8518 { &hf_lmp_feature_channel_quality_driven_data_rate,
8519 { "Channel Quality Driven Data Rate", "bthci_evt.lmp_features.channel_quality_driven_data_rate",
8520 FT_BOOLEAN, 8, NULL, 0x04,
8521 NULL, HFILL }
8523 { &hf_lmp_feature_sco_link,
8524 { "SCO Link", "bthci_evt.lmp_features.sco_link",
8525 FT_BOOLEAN, 8, NULL, 0x08,
8526 NULL, HFILL }
8528 { &hf_lmp_feature_hv2_packets,
8529 { "HV2 packets", "bthci_evt.lmp_features.hv2_packets",
8530 FT_BOOLEAN, 8, NULL, 0x10,
8531 NULL, HFILL }
8533 { &hf_lmp_feature_hv3_packets,
8534 { "HV3 packets", "bthci_evt.lmp_features.hv3_packets",
8535 FT_BOOLEAN, 8, NULL, 0x20,
8536 NULL, HFILL }
8538 { &hf_lmp_feature_u_law_log_synchronous_data,
8539 { "u-law Log Synchronous Data", "bthci_evt.lmp_features.u_law_log_synchronous_data",
8540 FT_BOOLEAN, 8, NULL, 0x40,
8541 NULL, HFILL }
8543 { &hf_lmp_feature_a_law_log_synchronous_data,
8544 { "A-law Log Synchronous Data", "bthci_evt.lmp_features.a_law_log_synchronous_data",
8545 FT_BOOLEAN, 8, NULL, 0x80,
8546 NULL, HFILL }
8548 { &hf_lmp_feature_cvsd_synchronous_data,
8549 { "CVSD Synchronous Data", "bthci_evt.lmp_features.cvsd_synchronous_data",
8550 FT_BOOLEAN, 8, NULL, 0x01,
8551 NULL, HFILL }
8553 { &hf_lmp_feature_paging_parameter_negotiation,
8554 { "Paging Parameter Negotiation", "bthci_evt.lmp_features.paging_parameter_negotiation",
8555 FT_BOOLEAN, 8, NULL, 0x02,
8556 NULL, HFILL }
8558 { &hf_lmp_feature_power_control,
8559 { "Power Control", "bthci_evt.lmp_features.power_control",
8560 FT_BOOLEAN, 8, NULL, 0x04,
8561 NULL, HFILL }
8563 { &hf_lmp_feature_transparent_synchronous_data,
8564 { "Transparent Synchronous Data", "bthci_evt.lmp_features.transparent_synchronous_data",
8565 FT_BOOLEAN, 8, NULL, 0x08,
8566 NULL, HFILL }
8568 { &hf_lmp_feature_flow_control_lag,
8569 { "Flow Control Lag", "bthci_evt.lmp_features.flow_control_lag",
8570 FT_UINT8, BASE_DEC, NULL, 0x70,
8571 NULL, HFILL }
8573 { &hf_lmp_feature_broadcast_encryption,
8574 { "Broadband Encryption", "bthci_evt.lmp_features.broadcast_encryption",
8575 FT_BOOLEAN, 8, NULL, 0x80,
8576 NULL, HFILL }
8578 { &hf_lmp_feature_reserved_24,
8579 { "Reserved", "bthci_evt.lmp_features.reserved.24",
8580 FT_BOOLEAN, 8, NULL, 0x01,
8581 NULL, HFILL }
8583 { &hf_lmp_feature_edr_acl_2mbps_mode,
8584 { "EDR ACL 2 Mbps Mode", "bthci_evt.lmp_features.edr_acl_2mbps_mode",
8585 FT_BOOLEAN, 8, NULL, 0x02,
8586 NULL, HFILL }
8588 { &hf_lmp_feature_edr_acl_3mbps_mode,
8589 { "EDR ACL 3 Mbps Mode", "bthci_evt.lmp_features.edr_acl_3mbps_mode",
8590 FT_BOOLEAN, 8, NULL, 0x04,
8591 NULL, HFILL }
8593 { &hf_lmp_feature_enhanced_inquiry_scan,
8594 { "Enhanced Inquiry Scan", "bthci_evt.lmp_features.enhanced_inquiry_scan",
8595 FT_BOOLEAN, 8, NULL, 0x08,
8596 NULL, HFILL }
8598 { &hf_lmp_feature_interlaced_inquiry_scan,
8599 { "Interlaced Inquiry Scan", "bthci_evt.lmp_features.interlaced_inquiry_scan",
8600 FT_BOOLEAN, 8, NULL, 0x10,
8601 NULL, HFILL }
8603 { &hf_lmp_feature_interlaced_page_scan,
8604 { "Interlaced Page Scan", "bthci_evt.lmp_features.interlaced_page_scan",
8605 FT_BOOLEAN, 8, NULL, 0x20,
8606 NULL, HFILL }
8608 { &hf_lmp_feature_rssi_with_inquiry_results,
8609 { "RSSI with Inquiry Results", "bthci_evt.lmp_features.rssi_with_inquiry_results",
8610 FT_BOOLEAN, 8, NULL, 0x40,
8611 NULL, HFILL }
8613 { &hf_lmp_feature_ev3_packets,
8614 { "EV3 Packets", "bthci_evt.lmp_features.ev3_packets",
8615 FT_BOOLEAN, 8, NULL, 0x80,
8616 NULL, HFILL }
8618 { &hf_lmp_feature_ev4_packets,
8619 { "EV4 Packets", "bthci_evt.lmp_features.ev4_packets",
8620 FT_BOOLEAN, 8, NULL, 0x01,
8621 NULL, HFILL }
8623 { &hf_lmp_feature_ev5_packets,
8624 { "EV5 Packets", "bthci_evt.lmp_features.ev5_packets",
8625 FT_BOOLEAN, 8, NULL, 0x02,
8626 NULL, HFILL }
8628 { &hf_lmp_feature_reserved_34,
8629 { "Reserved", "bthci_evt.lmp_features.reserved.34",
8630 FT_BOOLEAN, 8, NULL, 0x04,
8631 NULL, HFILL }
8633 { &hf_lmp_feature_afh_capable_peripheral,
8634 { "AFH Capable Peripheral", "bthci_evt.lmp_features.afh_capable_peripheral",
8635 FT_BOOLEAN, 8, NULL, 0x08,
8636 NULL, HFILL }
8638 { &hf_lmp_feature_afh_classification_peripheral,
8639 { "AFH Classification Peripheral", "bthci_evt.lmp_features.afh_classification_peripheral",
8640 FT_BOOLEAN, 8, NULL, 0x10,
8641 NULL, HFILL }
8643 { &hf_lmp_feature_br_edr_not_supported,
8644 { "BR/EDR Not Supported", "bthci_evt.lmp_features.br_edr_not_supported",
8645 FT_BOOLEAN, 8, NULL, 0x20,
8646 NULL, HFILL }
8648 { &hf_lmp_feature_le_supported_controller,
8649 { "LE Supported Controller", "bthci_evt.lmp_features.le_supported_controller",
8650 FT_BOOLEAN, 8, NULL, 0x40,
8651 NULL, HFILL }
8653 { &hf_lmp_feature_3slot_edr_acl_packets,
8654 { "3-slot EDR ACL packets", "bthci_evt.lmp_features.3slot_edr_acl_packets",
8655 FT_BOOLEAN, 8, NULL, 0x80,
8656 NULL, HFILL }
8658 { &hf_lmp_feature_5slot_edr_acl_packets,
8659 { "5-slot EDR ACL packets", "bthci_evt.lmp_features.5slot_edr_acl_packets",
8660 FT_BOOLEAN, 8, NULL, 0x01,
8661 NULL, HFILL }
8663 { &hf_lmp_feature_sniff_subrating,
8664 { "Sniff Subrating", "bthci_evt.lmp_features.sniff_subrating",
8665 FT_BOOLEAN, 8, NULL, 0x02,
8666 NULL, HFILL }
8668 { &hf_lmp_feature_pause_encryption,
8669 { "Pause Encryption", "bthci_evt.lmp_features.pause_encryption",
8670 FT_BOOLEAN, 8, NULL, 0x04,
8671 NULL, HFILL }
8673 { &hf_lmp_feature_afh_capable_central,
8674 { "AFH Capable Central", "bthci_evt.lmp_features.afh_capable_central",
8675 FT_BOOLEAN, 8, NULL, 0x08,
8676 NULL, HFILL }
8678 { &hf_lmp_feature_afh_classification_central,
8679 { "AFH Classification Central", "bthci_evt.lmp_features.afh_classification_central",
8680 FT_BOOLEAN, 8, NULL, 0x10,
8681 NULL, HFILL }
8683 { &hf_lmp_feature_edr_esco_2mbps_mode,
8684 { "EDR eSCO 2 Mbps Mode", "bthci_evt.lmp_features.edr_esco_2mbps_mode",
8685 FT_BOOLEAN, 8, NULL, 0x20,
8686 NULL, HFILL }
8688 { &hf_lmp_feature_edr_esco_3mbps_mode,
8689 { "EDR eSCO 3 Mbps Mode", "bthci_evt.lmp_features.edr_esco_3mbps_mode",
8690 FT_BOOLEAN, 8, NULL, 0x40,
8691 NULL, HFILL }
8693 { &hf_lmp_feature_3slot_edr_esco_packets,
8694 { "3-slot EDR eSCO Packets", "bthci_evt.lmp_features.3slot_edr_esco_packets",
8695 FT_BOOLEAN, 8, NULL, 0x80,
8696 NULL, HFILL }
8698 { &hf_lmp_feature_extended_inquiry_response,
8699 { "Extended Inquiry Response", "bthci_evt.lmp_features.extended_inquiry_response",
8700 FT_BOOLEAN, 8, NULL, 0x01,
8701 NULL, HFILL }
8703 { &hf_lmp_feature_simultaneous_le_and_br_edr_controller,
8704 {"Simultaneous LE and BR/EDR to Same Device Capable Controller", "bthci_evt.lmp_features.simultaneous_le_and_br_edr.controller",
8705 FT_BOOLEAN, 8, NULL, 0x02,
8706 NULL, HFILL}
8708 { &hf_lmp_feature_reserved_50,
8709 { "Reserved", "bthci_evt.lmp_features.reserved.50",
8710 FT_BOOLEAN, 8, NULL, 0x04,
8711 NULL, HFILL }
8713 { &hf_lmp_feature_secure_simple_pairing,
8714 { "Secure Simple Pairing", "bthci_evt.lmp_features.secure_simple_pairing",
8715 FT_BOOLEAN, 8, NULL, 0x08,
8716 NULL, HFILL }
8718 { &hf_lmp_feature_encapsulated_pdu,
8719 { "Encapsulated PDU", "bthci_evt.lmp_features.encapsulated_pdu",
8720 FT_BOOLEAN, 8, NULL, 0x10,
8721 NULL, HFILL }
8723 { &hf_lmp_feature_erroneous_data_reporting,
8724 { "Erroneous Data Reporting", "bthci_evt.lmp_features.erroneous_data_reporting",
8725 FT_BOOLEAN, 8, NULL, 0x20,
8726 NULL, HFILL }
8728 { &hf_lmp_feature_non_flushable_packet_boundary_flag,
8729 { "Non-flushable Packet Boundary Flag", "bthci_evt.lmp_features.non_flushable_packet_boundary_flag",
8730 FT_BOOLEAN, 8, NULL, 0x40,
8731 NULL, HFILL }
8733 { &hf_lmp_feature_reserved_55,
8734 { "Reserved", "bthci_evt.lmp_features.reserved.55",
8735 FT_BOOLEAN, 8, NULL, 0x80,
8736 NULL, HFILL }
8738 { &hf_lmp_feature_link_supervision_timeout_changed_event,
8739 { "Link Supervision Timeout Changed Event", "bthci_evt.lmp_features.supervision_timeout_changed_event",
8740 FT_BOOLEAN, 8, NULL, 0x01,
8741 NULL, HFILL }
8743 { &hf_lmp_feature_inquiry_tx_power_level,
8744 { "Inquiry TX Power Level", "bthci_evt.lmp_features.inquiry_tx_power_level",
8745 FT_BOOLEAN, 8, NULL, 0x02,
8746 NULL, HFILL }
8748 { &hf_lmp_feature_enhanced_power_control,
8749 { "Enhanced Power Control", "bthci_evt.lmp_features.enhanced_power_control",
8750 FT_BOOLEAN, 8, NULL, 0x04,
8751 NULL, HFILL }
8753 { &hf_lmp_feature_reserved_59_62,
8754 { "Reserved", "bthci_evt.lmp_features.reserved.59_62",
8755 FT_BOOLEAN, 8, NULL, 0x78,
8756 NULL, HFILL }
8758 { &hf_lmp_feature_extended_features,
8759 { "Extended Features", "bthci_evt.lmp_features.extended_features",
8760 FT_BOOLEAN, 8, NULL, 0x80,
8761 NULL, HFILL }
8763 { &hf_lmp_feature_secure_simple_pairing_host,
8764 {"Secure Simple Pairing Host", "bthci_evt.lmp_features.secure_simple_pairing_host",
8765 FT_BOOLEAN, 8, NULL, 0x01,
8766 NULL, HFILL}
8768 { &hf_lmp_feature_le_supported_host,
8769 {"LE Supported Host", "bthci_evt.lmp_features.le_supported.host",
8770 FT_BOOLEAN, 8, NULL, 0x02,
8771 NULL, HFILL}
8773 { &hf_lmp_feature_simultaneous_le_and_br_edr_host,
8774 {"Simultaneous LE and BR/EDR to Same Device Capable Host", "bthci_evt.lmp_features.simultaneous_le_and_br_edr.host",
8775 FT_BOOLEAN, 8, NULL, 0x04,
8776 NULL, HFILL}
8778 { &hf_lmp_feature_secure_connections_host,
8779 {"Secure Connections Host", "bthci_evt.lmp_features.secure_connections_host",
8780 FT_BOOLEAN, 8, NULL, 0x08,
8781 NULL, HFILL}
8783 { &hf_lmp_feature_reserved_68_71,
8784 {"Reserved", "bthci_evt.lmp_features.reserved.68_71",
8785 FT_UINT8, BASE_HEX, NULL, 0xF0,
8786 NULL, HFILL}
8788 { &hf_lmp_feature_cpb_central_operation,
8789 {"Connectionless Peripheral Broadcast Central Operation", "bthci_evt.lmp_features.cpb_central_operation",
8790 FT_BOOLEAN, 8, NULL, 0x01,
8791 NULL, HFILL}
8793 { &hf_lmp_feature_cpb_peripheral_operation,
8794 {"Connectionless Peripheral Broadcast Peripheral Operation", "bthci_evt.lmp_features.cpb_peripheral_operation",
8795 FT_BOOLEAN, 8, NULL, 0x02,
8796 NULL, HFILL}
8798 { &hf_lmp_feature_synchronization_train,
8799 {"Synchronization Train", "bthci_evt.lmp_features.synchronization_train",
8800 FT_BOOLEAN, 8, NULL, 0x04,
8801 NULL, HFILL}
8803 { &hf_lmp_feature_synchronization_scan,
8804 {"Synchronization Scan", "bthci_evt.lmp_features.synchronization_scan",
8805 FT_BOOLEAN, 8, NULL, 0x08,
8806 NULL, HFILL}
8808 { &hf_lmp_feature_inquiry_response_notification_event,
8809 {"Inquiry Response Notification Event", "bthci_evt.lmp_features.inquiry_response_notification_event",
8810 FT_BOOLEAN, 8, NULL, 0x10,
8811 NULL, HFILL}
8813 { &hf_lmp_feature_generalized_interlaced_scan,
8814 {"Generalized Interlaced Scan", "bthci_evt.lmp_features.generalized_interlaced_scan",
8815 FT_BOOLEAN, 8, NULL, 0x20,
8816 NULL, HFILL}
8818 { &hf_lmp_feature_coarse_clock_adjustment,
8819 {"Coarse Clock Adjustment", "bthci_evt.lmp_features.coarse_clock_adjustment",
8820 FT_BOOLEAN, 8, NULL, 0x40,
8821 NULL, HFILL}
8823 { &hf_lmp_feature_reserved_135,
8824 {"Reserved", "bthci_evt.lmp_features.reserved_135",
8825 FT_BOOLEAN, 8, NULL, 0x80,
8826 NULL, HFILL}
8828 { &hf_lmp_feature_secure_connections_controller,
8829 {"Secure Connections Controller", "bthci_evt.lmp_features.secure_connections_controller",
8830 FT_BOOLEAN, 8, NULL, 0x01,
8831 NULL, HFILL}
8833 { &hf_lmp_feature_ping,
8834 {"Ping", "bthci_evt.lmp_features.ping",
8835 FT_BOOLEAN, 8, NULL, 0x02,
8836 NULL, HFILL}
8838 { &hf_lmp_feature_reserved_138,
8839 {"Reserved", "bthci_evt.lmp_features.reserved_138",
8840 FT_BOOLEAN, 8, NULL, 0x04,
8841 NULL, HFILL}
8843 { &hf_lmp_feature_train_nudging,
8844 {"Train Nudging", "bthci_evt.lmp_features.train_nudging",
8845 FT_BOOLEAN, 8, NULL, 0x08,
8846 NULL, HFILL}
8848 { &hf_lmp_feature_slot_availability_mask,
8849 {"Slot Availability Mask", "bthci_evt.lmp_features.slot_availability_mask",
8850 FT_BOOLEAN, 8, NULL, 0x10,
8851 NULL, HFILL}
8853 { &hf_lmp_feature_reserved,
8854 {"Reserved", "bthci_evt.lmp_features.reserved",
8855 FT_BYTES, BASE_NONE, NULL, 0x0,
8856 NULL, HFILL}
8858 { &hf_bthci_evt_num_keys,
8859 { "Number of Link Keys", "bthci_evt.num_keys",
8860 FT_UINT8, BASE_DEC, NULL, 0x0,
8861 "Number of Link Keys contained", HFILL }
8863 { &hf_bthci_evt_num_keys_read,
8864 { "Number of Link Keys Read", "bthci_evt.num_keys_read",
8865 FT_UINT16, BASE_DEC, NULL, 0x0,
8866 NULL, HFILL }
8868 { &hf_bthci_evt_num_keys_deleted,
8869 { "Number of Link Keys Deleted", "bthci_evt.num_keys_deleted",
8870 FT_UINT16, BASE_DEC, NULL, 0x0,
8871 NULL, HFILL }
8873 { &hf_bthci_evt_num_keys_written,
8874 { "Number of Link Keys Written", "bthci_evt.num_keys_written",
8875 FT_UINT8, BASE_DEC, NULL, 0x0,
8876 NULL, HFILL }
8878 { &hf_bthci_evt_max_num_keys,
8879 { "Max Num Keys", "bthci_evt.max_num_keys",
8880 FT_UINT16, BASE_DEC, NULL, 0x0,
8881 "Total Number of Link Keys that the Host Controller can store", HFILL }
8883 { &hf_bthci_evt_num_responses,
8884 { "Number of responses", "bthci_evt.num_responses",
8885 FT_UINT8, BASE_DEC, NULL, 0x0,
8886 NULL, HFILL }
8888 { &hf_bthci_evt_link_policy_setting_switch,
8889 { "Enable Role Switch", "bthci_evt.link_policy_switch",
8890 FT_BOOLEAN, 16, NULL, 0x0001,
8891 NULL, HFILL }
8893 { &hf_bthci_evt_link_policy_setting_hold,
8894 { "Enable Hold Mode", "bthci_evt.link_policy_hold",
8895 FT_BOOLEAN, 16, NULL, 0x0002,
8896 NULL, HFILL }
8898 { &hf_bthci_evt_link_policy_setting_sniff,
8899 { "Enable Sniff Mode", "bthci_evt.link_policy_sniff",
8900 FT_BOOLEAN, 16, NULL, 0x0004,
8901 NULL, HFILL }
8903 { &hf_bthci_evt_link_policy_setting_park,
8904 { "Enable Park Mode", "bthci_evt.link_policy_park",
8905 FT_BOOLEAN, 16, NULL, 0x0008,
8906 NULL, HFILL }
8908 { &hf_bthci_evt_curr_role,
8909 { "Current Role", "bthci_evt.curr_role",
8910 FT_UINT8, BASE_HEX, VALS(evt_role_vals_handle), 0x0,
8911 "Current role for this connection handle", HFILL }
8913 { &hf_bthci_evt_pin_type,
8914 { "PIN Type", "bthci_evt.pin_type",
8915 FT_UINT8, BASE_HEX, VALS(evt_pin_types), 0x0,
8916 "PIN Types", HFILL }
8918 { &hf_bthci_evt_device_name,
8919 { "Device Name", "bthci_evt.device_name",
8920 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8921 "Userfriendly descriptive name for the device", HFILL }
8923 { &hf_bthci_evt_timeout,
8924 { "Timeout", "bthci_evt.timeout",
8925 FT_UINT16, BASE_CUSTOM, CF_FUNC(bluetooth_unit_0p625_ms), 0x0,
8926 "Number of Baseband slots for timeout.", HFILL }
8928 { &hf_bthci_evt_scan_enable,
8929 { "Scan", "bthci_evt.scan_enable",
8930 FT_UINT8, BASE_HEX, VALS(bthci_cmd_scan_enable_values), 0x0,
8931 "Scan Enable", HFILL }
8933 { &hf_bthci_evt_authentication_enable,
8934 { "Authentication", "bthci_evt.auth_enable",
8935 FT_UINT8, BASE_HEX, VALS(evt_auth_enable_values), 0x0,
8936 "Authentication Enable", HFILL }
8938 { &hf_bthci_evt_sco_flow_cont_enable,
8939 { "SCO Flow Control", "bthci_evt.sco_flow_cont_enable",
8940 FT_UINT8, BASE_HEX, VALS(evt_enable_values), 0x0,
8941 "SCO Flow Control Enable", HFILL }
8943 { &hf_bthci_evt_window,
8944 { "Window", "bthci_evt.window",
8945 FT_UINT16, BASE_DEC, NULL, 0x0,
8946 NULL, HFILL }
8948 { &hf_bthci_evt_input_unused,
8949 { "Unused bits", "bthci_evt.voice.unused",
8950 FT_UINT16, BASE_HEX, NULL, 0xfc00,
8951 NULL, HFILL }
8953 { &hf_bthci_evt_input_coding,
8954 { "Input Coding", "bthci_evt.voice.input_coding",
8955 FT_UINT16, BASE_DEC | BASE_EXT_STRING, &bthci_cmd_input_coding_vals_ext, 0x0300,
8956 NULL, HFILL }
8958 { &hf_bthci_evt_input_data_format,
8959 { "Input Data Format", "bthci_evt.voice.input_data_format",
8960 FT_UINT16, BASE_DEC | BASE_EXT_STRING, &bthci_cmd_input_data_format_vals_ext, 0x00c0,
8961 NULL, HFILL }
8963 { &hf_bthci_evt_input_sample_size,
8964 { "Input Sample Size", "bthci_evt.voice.input_sample_size",
8965 FT_UINT16, BASE_DEC | BASE_EXT_STRING, &bthci_cmd_input_sample_size_vals_ext, 0x0020,
8966 NULL, HFILL }
8968 { &hf_bthci_evt_linear_pcm_bit_pos,
8969 { "Linear PCM Bit Position", "bthci_evt.voice.linear_pcm_bit_pos",
8970 FT_UINT16, BASE_DEC, NULL, 0x001c,
8971 "# bit pos. that MSB of sample is away from starting at MSB", HFILL }
8973 { &hf_bthci_evt_air_coding_format,
8974 { "Air Coding Format", "bthci_evt.voice.air_coding_format",
8975 FT_UINT16, BASE_DEC | BASE_EXT_STRING, &bthci_cmd_air_coding_format_vals_ext, 0x0003,
8976 NULL, HFILL }
8978 { &hf_bthci_evt_num_broadcast_retransm,
8979 { "Num Broadcast Retran", "bthci_evt.num_broad_retran",
8980 FT_UINT8, BASE_DEC, NULL, 0x0,
8981 "Number of Broadcast Retransmissions", HFILL }
8983 { &hf_bthci_evt_hold_mode_act_page,
8984 { "Suspend Page Scan", "bthci_evt.hold_mode_page",
8985 FT_BOOLEAN, 8, NULL, 0x1,
8986 "Device can enter low power state", HFILL }
8988 { &hf_bthci_evt_hold_mode_act_inquiry,
8989 { "Suspend Inquiry Scan", "bthci_evt.hold_mode_inquiry",
8990 FT_BOOLEAN, 8, NULL, 0x2,
8991 "Device can enter low power state", HFILL }
8993 { &hf_bthci_evt_hold_mode_act_periodic,
8994 { "Suspend Periodic Inquiries", "bthci_evt.hold_mode_periodic",
8995 FT_BOOLEAN, 8, NULL, 0x4,
8996 "Device can enter low power state", HFILL }
8998 { &hf_bthci_evt_transmit_power_level,
8999 { "Transmit Power Level", "bthci_evt.transmit_power_level",
9000 FT_INT8, BASE_DEC|BASE_UNIT_STRING, UNS(&units_dbm), 0x0,
9001 NULL, HFILL }
9003 { &hf_bthci_evt_max_transmit_power_level,
9004 { "Maximum Transmit Power Level", "bthci_evt.max_transmit_power_level",
9005 FT_INT8, BASE_DEC|BASE_UNIT_STRING, UNS(&units_dbm), 0x0,
9006 NULL, HFILL }
9008 { &hf_bthci_evt_num_supp_iac,
9009 {"Num Support IAC", "bthci_evt.num_supp_iac",
9010 FT_UINT8, BASE_DEC, NULL, 0x0,
9011 "Num of supported IAC the device can simultaneously listen", HFILL }
9013 { &hf_bthci_evt_num_curr_iac,
9014 {"Num Current IAC", "bthci_evt.num_curr_iac",
9015 FT_UINT8, BASE_DEC, NULL, 0x0,
9016 "Num of IACs currently in use to simultaneously listen", HFILL }
9018 { &hf_bthci_evt_iac_lap,
9019 { "IAC LAP", "bthci_evt.iac_lap",
9020 FT_UINT24, BASE_HEX, NULL, 0x0,
9021 "LAP(s)used to create IAC", HFILL }
9023 { &hf_bthci_evt_loopback_mode,
9024 {"Loopback Mode", "bthci_evt.loopback_mode",
9025 FT_UINT8, BASE_HEX, VALS(evt_loopback_modes), 0x0,
9026 NULL, HFILL }
9028 { &hf_bthci_evt_country_code,
9029 {"Country Code", "bthci_evt.country_code",
9030 FT_UINT8, BASE_HEX, VALS(evt_country_code_values), 0x0,
9031 NULL, HFILL }
9033 { &hf_bthci_evt_failed_contact_counter,
9034 {"Failed Contact Counter", "bthci_evt.failed_contact_counter",
9035 FT_UINT16, BASE_DEC, NULL, 0x0,
9036 NULL, HFILL }
9038 { &hf_bthci_evt_link_quality,
9039 {"Link Quality", "bthci_evt.link_quality",
9040 FT_UINT8, BASE_DEC, NULL, 0x0,
9041 "Link Quality (0x00 - 0xFF Higher Value = Better Link)", HFILL }
9043 { &hf_bthci_evt_rssi,
9044 { "RSSI", "bthci_evt.rssi",
9045 FT_INT8, BASE_DEC|BASE_UNIT_STRING, UNS(&units_dbm), 0x0,
9046 NULL, HFILL }
9048 { &hf_bthci_evt_host_data_packet_length_acl,
9049 {"Host ACL Data Packet Length (bytes)", "bthci_evt.max_data_length_acl",
9050 FT_UINT16, BASE_DEC, NULL, 0x0,
9051 "Max Host ACL Data Packet length of data portion host is able to accept", HFILL }
9053 { &hf_bthci_evt_host_data_packet_length_sco,
9054 {"Host SCO Data Packet Length (bytes)", "bthci_evt.max_data_length_sco",
9055 FT_UINT8, BASE_DEC, NULL, 0x0,
9056 "Max Host SCO Data Packet length of data portion host is able to accept", HFILL }
9058 { &hf_bthci_evt_host_total_num_acl_data_packets,
9059 {"Host Total Num ACL Data Packets", "bthci_evt.max_data_num_acl",
9060 FT_UINT16, BASE_DEC, NULL, 0x0,
9061 "Total Number of HCI ACL Data Packets that can be stored in the data buffers of the Host", HFILL }
9063 { &hf_bthci_evt_host_total_num_sco_data_packets,
9064 {"Host Total Num SCO Data Packets", "bthci_evt.max_data_num_sco",
9065 FT_UINT16, BASE_DEC, NULL, 0x0,
9066 "Total Number of HCI SCO Data Packets that can be stored in the data buffers of the Host", HFILL }
9068 { &hf_bthci_evt_page_number,
9069 {"Page Number", "bthci_evt.page_number",
9070 FT_UINT8, BASE_DEC, NULL, 0x0,
9071 NULL, HFILL}
9073 { &hf_bthci_evt_max_page_number,
9074 {"Max Page Number", "bthci_evt.max_page_number",
9075 FT_UINT8, BASE_DEC, NULL, 0x0,
9076 NULL, HFILL}
9078 { &hf_bthci_evt_local_supported_cmds,
9079 { "Local Supported Commands", "bthci_evt.local_supported_cmds",
9080 FT_BYTES, BASE_NONE, NULL, 0x0,
9081 NULL, HFILL }
9083 { &hf_bthci_evt_fec_required,
9084 {"FEC Required", "bthci_evt.fec_required",
9085 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
9086 NULL, HFILL}
9088 { &hf_bthci_evt_err_data_reporting,
9089 {"Erroneous Data Reporting", "bthci_evt.err_data_reporting",
9090 FT_UINT8, BASE_DEC, VALS(evt_enable_values), 0x0,
9091 NULL, HFILL}
9093 { &hf_bthci_evt_scan_type,
9094 {"Scan Type", "bthci_evt.inq_scan_type",
9095 FT_UINT8, BASE_DEC, VALS(evt_scan_types), 0x0,
9096 NULL, HFILL}
9098 { &hf_bthci_evt_inq_mode,
9099 {"Inquiry Mode", "bthci_evt.inq_mode",
9100 FT_UINT8, BASE_DEC, VALS(bthci_cmd_inq_modes), 0x0,
9101 NULL, HFILL}
9103 { &hf_bthci_evt_power_level_type,
9104 {"Type", "bthci_evt.power_level_type",
9105 FT_UINT8, BASE_HEX, VALS(evt_power_level_types), 0x0,
9106 NULL, HFILL}
9108 { &hf_bthci_evt_sync_link_type,
9109 {"Link Type", "bthci_evt.sync_link_type",
9110 FT_UINT8, BASE_HEX, VALS(evt_sync_link_types), 0x0,
9111 NULL, HFILL}
9113 { &hf_bthci_evt_sync_tx_interval,
9114 {"Transmit Interval", "bthci_evt.sync_tx_interval",
9115 FT_UINT8, BASE_CUSTOM, CF_FUNC(bluetooth_unit_0p625_ms), 0x0,
9116 NULL, HFILL}
9118 { &hf_bthci_evt_le_local_p_256_public_key,
9119 { "Local-256_Public_Key", "bthci_evt.le_local_p_256_public_key",
9120 FT_BYTES, BASE_NONE, NULL, 0x0,
9121 NULL, HFILL }
9123 { &hf_bthci_evt_le_dhkey,
9124 { "DHKey", "bthci_evt.dhkey",
9125 FT_BYTES, BASE_NONE, NULL, 0x0,
9126 NULL, HFILL }
9128 { &hf_bthci_evt_sync_rtx_window,
9129 {"Retransmit Window", "bthci_evt.sync_rtx_window",
9130 FT_UINT8, BASE_CUSTOM, CF_FUNC(bluetooth_unit_0p625_ms), 0x0,
9131 NULL, HFILL}
9133 { &hf_bthci_evt_sync_rx_packet_length,
9134 {"Rx Packet Length", "bthci_evt.sync_rx_pkt_len",
9135 FT_UINT16, BASE_DEC, NULL, 0x0,
9136 NULL, HFILL}
9138 { &hf_bthci_evt_sync_tx_packet_length,
9139 {"Tx Packet Length", "bthci_evt.sync_tx_pkt_len",
9140 FT_UINT16, BASE_DEC, NULL, 0x0,
9141 NULL, HFILL}
9143 { &hf_bthci_evt_air_mode,
9144 {"Air Mode", "bthci_evt.air_mode",
9145 FT_UINT8, BASE_DEC, VALS(evt_air_mode_vals), 0x0,
9146 NULL, HFILL}
9148 { &hf_bthci_evt_max_tx_latency,
9149 {"Max. Tx Latency", "bthci_evt.max_tx_latency",
9150 FT_UINT16, BASE_CUSTOM, CF_FUNC(bluetooth_unit_0p625_ms), 0x0,
9151 NULL, HFILL}
9153 { &hf_bthci_evt_max_rx_latency,
9154 {"Max. Rx Latency", "bthci_evt.max_rx_latency",
9155 FT_UINT16, BASE_CUSTOM, CF_FUNC(bluetooth_unit_0p625_ms), 0x0,
9156 NULL, HFILL}
9158 { &hf_bthci_evt_min_remote_timeout,
9159 {"Min. Remote Timeout", "bthci_evt.min_remote_timeout",
9160 FT_UINT16, BASE_CUSTOM, CF_FUNC(bluetooth_unit_0p625_ms), 0x0,
9161 NULL, HFILL}
9163 { &hf_bthci_evt_min_local_timeout,
9164 {"Min. Local Timeout", "bthci_evt.min_local_timeout",
9165 FT_UINT16, BASE_CUSTOM, CF_FUNC(bluetooth_unit_0p625_ms), 0x0,
9166 NULL, HFILL}
9168 { &hf_bthci_evt_link_supervision_timeout,
9169 {"Link Supervision Timeout", "bthci_evt.link_supervision_timeout",
9170 FT_UINT16, BASE_CUSTOM, CF_FUNC(bluetooth_unit_0p625_ms), 0x0,
9171 NULL, HFILL}
9173 { &hf_bthci_evt_token_bucket_size,
9174 { "Token Bucket Size", "bthci_evt.token_bucket_size",
9175 FT_UINT32, BASE_DEC, NULL, 0x0,
9176 "Token Bucket Size (bytes)", HFILL }
9178 { &hf_bthci_evt_flow_direction,
9179 {"Flow Direction", "bthci_evt.flow_direction",
9180 FT_UINT8, BASE_DEC, VALS(evt_flow_direction_values), 0x0,
9181 NULL, HFILL}
9183 { &hf_bthci_evt_afh_ch_assessment_mode,
9184 {"AFH Channel Assessment Mode", "bthci_evt.afh_ch_assessment_mode",
9185 FT_UINT8, BASE_DEC, VALS(evt_enable_values), 0x0,
9186 NULL, HFILL}
9188 { &hf_bthci_evt_lmp_handle,
9189 { "LMP Handle", "bthci_evt.lmp_handle",
9190 FT_UINT16, BASE_HEX, NULL, 0x0,
9191 NULL, HFILL }
9193 { &hf_bthci_evt_clock,
9194 { "Clock", "bthci_evt.clock",
9195 FT_UINT32, BASE_HEX, NULL, 0x0,
9196 NULL, HFILL }
9198 { &hf_bthci_evt_clock_accuracy,
9199 { "Clock", "bthci_evt.clock_accuracy",
9200 FT_UINT16, BASE_HEX, NULL, 0x0,
9201 NULL, HFILL }
9203 { &hf_bthci_evt_afh_mode,
9204 {"AFH Mode", "bthci_evt.afh_mode",
9205 FT_UINT8, BASE_DEC, VALS(evt_enable_values), 0x0,
9206 NULL, HFILL}
9208 /* TODO: More detailed dissection */
9209 { &hf_bthci_evt_afh_channel_map,
9210 {"AFH Channel Map", "bthci_evt.afh_channel_map",
9211 FT_BYTES, BASE_NONE, NULL, 0x0,
9212 NULL, HFILL}
9214 { &hf_bthci_evt_simple_pairing_mode,
9215 {"Simple Pairing Mode", "bthci_evt.simple_pairing_mode",
9216 FT_UINT8, BASE_DEC, VALS(evt_enable_values), 0x0,
9217 NULL, HFILL}
9219 { &hf_bthci_evt_hash_c,
9220 {"Hash C", "bthci_evt.hash_c",
9221 FT_BYTES, BASE_NONE, NULL, 0x0,
9222 NULL, HFILL}
9224 { &hf_bthci_evt_randomizer_r,
9225 {"Randomizer R", "bthci_evt.randomizer_r",
9226 FT_BYTES, BASE_NONE, NULL, 0x0,
9227 NULL, HFILL}
9229 { &hf_bthci_evt_io_capability,
9230 {"IO Capability", "bthci_evt.io_capability",
9231 FT_UINT8, BASE_HEX, VALS(bthci_cmd_io_capability_vals), 0x0,
9232 NULL, HFILL}
9234 { &hf_bthci_evt_oob_data_present,
9235 {"OOB Data Present", "bthci_evt.oob_data_present",
9236 FT_UINT8, BASE_DEC, VALS(bthci_cmd_oob_data_present_vals), 0x0,
9237 NULL, HFILL}
9239 { &hf_bthci_evt_auth_requirements,
9240 {"Authentication Requirements", "bthci_evt.auth_requirements",
9241 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &bthci_cmd_auth_req_vals_ext, 0x0,
9242 NULL, HFILL}
9244 { &hf_bthci_evt_numeric_value,
9245 {"Numeric Value", "bthci_evt.numeric_value",
9246 FT_UINT32, BASE_DEC, NULL, 0x0,
9247 NULL, HFILL}
9249 { &hf_bthci_evt_passkey,
9250 {"Passkey", "bthci_evt.passkey",
9251 FT_UINT32, BASE_DEC, NULL, 0x0,
9252 NULL, HFILL}
9254 { &hf_bthci_evt_notification_type,
9255 {"Notification Type", "bthci_evt.notification_type",
9256 FT_UINT8, BASE_DEC, VALS(bthci_cmd_notification_types), 0x0,
9257 NULL, HFILL}
9259 { &hf_bthci_evt_data_length,
9260 { "Data Length", "bthci_evt.data_length",
9261 FT_UINT8, BASE_DEC, NULL, 0x0,
9262 NULL, HFILL }
9264 { &hf_bthci_evt_location_domain_aware,
9265 { "Location Domain Aware", "bthci_evt.location_domain_aware",
9266 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
9267 NULL, HFILL }
9269 { &hf_bthci_evt_location_domain,
9270 { "Location Domain", "bthci_evt.location_domain",
9271 FT_STRING, BASE_NONE, NULL, 0x0,
9272 "ISO 3166-1 Country Code", HFILL }
9274 { &hf_bthci_evt_location_domain_options,
9275 { "Location Domain Options", "bthci_evt.location_domain_options",
9276 FT_STRING, BASE_NONE, NULL, 0x0,
9277 NULL, HFILL }
9279 { &hf_bthci_evt_location_options,
9280 { "Location Options", "bthci_evt.location_options",
9281 FT_UINT8, BASE_HEX, NULL, 0x0,
9282 NULL, HFILL }
9284 { &hf_bthci_evt_flow_control_mode,
9285 { "Flow Control Mode", "bthci_evt.flow_control_mode",
9286 FT_UINT8, BASE_HEX, VALS(evt_flow_ctrl_mode), 0x0,
9287 NULL, HFILL }
9289 { &hf_bthci_evt_physical_link_handle,
9290 { "Physical Link Handle", "bthci_evt.physical_link_handle",
9291 FT_UINT8, BASE_HEX, NULL, 0x0,
9292 NULL, HFILL }
9294 { &hf_bthci_evt_flow_spec_identifier,
9295 { "Flow Spec Identifier", "bthci_evt.flow_spec_id",
9296 FT_UINT8, BASE_HEX, NULL, 0x0,
9297 NULL, HFILL }
9299 { &hf_bthci_evt_logical_link_handle,
9300 { "Logical Link Handle", "bthci_evt.logical_link_handle",
9301 FT_UINT16, BASE_HEX, NULL, 0x0,
9302 NULL, HFILL}
9304 { &hf_bthci_evt_max_acl_data_packet_length,
9305 { "Max. ACL Data Packet Length", "bthci_evt.max_acl_data_packet_length",
9306 FT_UINT16, BASE_HEX, NULL, 0x0,
9307 NULL, HFILL}
9309 { &hf_bthci_evt_data_block_length,
9310 { "Max. Data Block Length", "bthci_evt.data_block_length",
9311 FT_UINT16, BASE_HEX, NULL, 0x0,
9312 NULL, HFILL}
9314 { &hf_bthci_evt_total_num_data_blocks,
9315 { "Total Number of Data Blocks", "bthci_evt.total_num_data_blocks",
9316 FT_UINT16, BASE_HEX, NULL, 0x0,
9317 NULL, HFILL}
9319 { &hf_bthci_evt_enc_key_size,
9320 { "Encryption Key Size", "bthci_evt.enc_key_size",
9321 FT_INT8, BASE_DEC, NULL, 0x0,
9322 NULL, HFILL }
9324 { &hf_bthci_evt_amp_remaining_assoc_length,
9325 { "AMP Remaining Assoc Length", "bthci_evt.amp_remaining_assoc_length",
9326 FT_UINT16, BASE_DEC, 0x0, 0x0,
9327 NULL, HFILL }
9329 { &hf_bthci_evt_amp_assoc_fragment,
9330 { "AMP Assoc Fragment", "bthci_evt.amp_assoc_fragment",
9331 FT_BYTES, BASE_NONE, 0x0, 0x0,
9332 NULL, HFILL }
9334 { &hf_bthci_evt_amp_status,
9335 { "AMP Status", "bthci_evt.amp_status",
9336 FT_UINT8, BASE_HEX, VALS(evt_amp_status), 0x0,
9337 NULL, HFILL }
9339 { &hf_bthci_evt_total_bandwidth,
9340 { "Total Bandwidth (kbps)", "bthci_evt.total_bandwidth",
9341 FT_UINT32, BASE_DEC, 0x0, 0x0,
9342 NULL, HFILL }
9344 { &hf_bthci_evt_max_guaranteed_bandwidth,
9345 { "Max Guaranteed Bandwidth (kbps)", "bthci_evt.max_guaranteed_bandwidth",
9346 FT_UINT32, BASE_DEC, 0x0, 0x0,
9347 NULL, HFILL }
9349 { &hf_bthci_evt_min_latency,
9350 { "Min Latency (us)", "bthci_evt.min_latency",
9351 FT_UINT32, BASE_DEC, 0x0, 0x0,
9352 NULL, HFILL }
9354 { &hf_bthci_evt_max_pdu_size,
9355 { "Max PDU Size", "bthci_evt.max_pdu_size",
9356 FT_UINT32, BASE_DEC, 0x0, 0x0,
9357 NULL, HFILL }
9359 { &hf_bthci_evt_amp_controller_type,
9360 { "Controller Type", "bthci_evt.controller_type",
9361 FT_UINT8, BASE_HEX, VALS(bthci_evt_controller_types), 0x0,
9362 NULL, HFILL }
9364 { &hf_bthci_evt_pal_capabilities_00,
9365 { "Guaranteed Service", "bthci_evt.pal_capabilities",
9366 FT_BOOLEAN, 16, NULL, 0x0001,
9367 NULL, HFILL }
9369 { &hf_bthci_evt_max_amp_assoc_length,
9370 { "Max AMP Assoc Length", "bthci_evt.max_amp_assoc_length",
9371 FT_UINT32, BASE_DEC, 0x0, 0x0,
9372 NULL, HFILL }
9374 { &hf_bthci_evt_max_flush_to_us,
9375 { "Max Flush Timeout (us)", "bthci_evt.max_flush_to",
9376 FT_UINT32, BASE_DEC, 0x0, 0x0,
9377 NULL, HFILL }
9379 { &hf_bthci_evt_best_effort_flush_to_us,
9380 { "Best Effort Flush Timeout (us)", "bthci_evt.best_effort_flush_to",
9381 FT_UINT32, BASE_DEC, 0x0, 0x0,
9382 NULL, HFILL }
9384 { &hf_bthci_evt_link_loss_reason,
9385 { "Reason", "bthci_evt.link_loss_reason",
9386 FT_UINT8, BASE_HEX, VALS(evt_link_loss_reasons), 0x0,
9387 NULL, HFILL }
9389 { &hf_bthci_evt_num_compl_blocks,
9390 { "Number Of Completed Blocks", "bthci_evt.num_compl_blocks",
9391 FT_UINT16, BASE_DEC, NULL, 0x0,
9392 NULL, HFILL }
9394 { &hf_bthci_evt_test_scenario,
9395 { "Test Scenario", "bthci_evt.test_scenario",
9396 FT_UINT8, BASE_HEX, NULL, 0x0,
9397 NULL, HFILL }
9399 { &hf_bthci_evt_report_reason,
9400 { "Reason", "bthci_evt.report_reason",
9401 FT_UINT8, BASE_HEX, VALS(evt_report_reasons), 0x0,
9402 NULL, HFILL }
9404 { &hf_bthci_evt_report_event_type,
9405 { "Report Event Type", "bthci_evt.report_event_type",
9406 FT_UINT8, BASE_HEX, VALS(evt_report_event_types), 0x0,
9407 NULL, HFILL }
9409 { &hf_bthci_evt_num_frames,
9410 { "Number Of Frames", "bthci_evt.num_frames",
9411 FT_UINT16, BASE_DEC, NULL, 0x0,
9412 NULL, HFILL }
9414 { &hf_bthci_evt_num_error_frames,
9415 { "Number Of Error Frames", "bthci_evt.num_error_frames",
9416 FT_UINT16, BASE_DEC, NULL, 0x0,
9417 NULL, HFILL }
9419 { &hf_bthci_evt_num_bits,
9420 { "Number Of Bits", "bthci_evt.num_bits",
9421 FT_UINT32, BASE_DEC, NULL, 0x0,
9422 NULL, HFILL }
9424 { &hf_bthci_evt_num_error_bits,
9425 { "Number Of Error Bits", "bthci_evt.num_error_bits",
9426 FT_UINT32, BASE_DEC, NULL, 0x0,
9427 NULL, HFILL }
9429 { &hf_bthci_evt_short_range_mode_state,
9430 { "Short Range Mode State", "bthci_evt.short_range_mode_state",
9431 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
9432 NULL, HFILL }
9434 { &hf_bthci_evt_transmit_power_level_gfsk,
9435 { "Transmit Power Level GFSK (dBm)", "bthci_evt.transmit_power_level_gfsk",
9436 FT_INT8, BASE_DEC, NULL, 0x0,
9437 NULL, HFILL }
9439 { &hf_bthci_evt_transmit_power_level_dqpsk,
9440 { "Transmit Power Level DQPSK (dBm)", "bthci_evt.transmit_power_level_dqpsk",
9441 FT_INT8, BASE_DEC, NULL, 0x0,
9442 NULL, HFILL }
9444 { &hf_bthci_evt_transmit_power_level_8dpsk,
9445 { "Transmit Power Level 8DPSK (dBm)", "bthci_evt.transmit_power_level_8dpsk",
9446 FT_INT8, BASE_DEC, NULL, 0x0,
9447 NULL, HFILL }
9449 { &hf_bthci_evt_flush_to_us,
9450 { "Flush Timeout (us)", "bthci_evt.flushto",
9451 FT_UINT32, BASE_DEC, NULL, 0x0,
9452 NULL, HFILL }
9454 { &hf_bthci_evt_le_supported_host,
9455 { "LE Supported Host", "bthci_evt.le_supported_host",
9456 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
9457 NULL, HFILL }
9459 { &hf_bthci_evt_le_simultaneous_host,
9460 { "Simultaneous LE Host", "bthci_evt.le_simultaneous_host",
9461 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
9462 "Support for both LE and BR/EDR to same device", HFILL }
9464 { &hf_bthci_evt_le_acl_data_pkt_len,
9465 { "LE ACL Data Packet Length", "bthci_evt.le_acl_data_pkt_len",
9466 FT_UINT16, BASE_DEC, NULL, 0x0,
9467 NULL, HFILL }
9469 { &hf_bthci_evt_total_num_le_acl_data_pkts,
9470 { "Total Number LE ACL Data Packets", "bthci_evt.le_total_num_acl_data_pkts",
9471 FT_UINT8, BASE_DEC, NULL, 0x0,
9472 NULL, HFILL }
9474 { &hf_bthci_evt_iso_data_pkt_len,
9475 { "ISO Data Packet Length", "bthci_evt.iso_data_pkt_len",
9476 FT_UINT16, BASE_DEC, NULL, 0x0,
9477 NULL, HFILL }
9479 { &hf_bthci_evt_total_num_iso_data_pkts,
9480 { "Total Number ISO Data Packets", "bthci_evt.total_num_iso_data_pkts",
9481 FT_UINT8, BASE_DEC, NULL, 0x0,
9482 NULL, HFILL }
9484 { &hf_bthci_evt_filter_accept_list_size,
9485 { "Filter Accept List Size", "bthci_evt.le_filter_accept_list_size",
9486 FT_UINT8, BASE_DEC, NULL, 0x0,
9487 "Max. total filter accept list entries storable in controller", HFILL }
9489 { &hf_bthci_evt_le_channel_map,
9490 { "Channel Map", "bthci_evt.le_channel_map",
9491 FT_BYTES, BASE_NONE, NULL, 0x0,
9492 NULL, HFILL }
9494 { &hf_bthci_evt_encrypted_data,
9495 { "Plaintext", "bthci_evt.le_encrypted_data",
9496 FT_BYTES, BASE_NONE, NULL, 0x0,
9497 NULL, HFILL }
9499 { &hf_bthci_evt_random_number,
9500 { "Random Number", "bthci_evt.le_random_number",
9501 FT_BYTES, BASE_NONE, NULL, 0x0,
9502 NULL, HFILL }
9504 { &hf_bthci_evt_le_num_packets,
9505 { "Number of Packets", "bthci_evt.le_num_packets",
9506 FT_UINT16, BASE_DEC, NULL, 0x0,
9507 NULL, HFILL }
9509 { &hf_bthci_evt_le_meta_subevent,
9510 { "Sub Event", "bthci_evt.le_meta_subevent",
9511 FT_UINT8, BASE_HEX, VALS(evt_le_meta_subevent), 0x00,
9512 NULL, HFILL }
9514 { &hf_bthci_evt_le_peer_address_type,
9515 { "Peer Address Type", "bthci_evt.le_peer_address_type",
9516 FT_UINT8, BASE_HEX, VALS(bthci_cmd_address_types_vals), 0x0,
9517 NULL, HFILL }
9519 { &hf_bthci_evt_le_local_rpa,
9520 { "Local Resolvable Private Address", "bthci_evt.le_local_rpa",
9521 FT_ETHER, BASE_NONE, NULL, 0x0,
9522 NULL, HFILL}
9524 { &hf_bthci_evt_le_peer_rpa,
9525 { "Peer Resolvable Private Address", "bthci_evt.le_peer_rpa",
9526 FT_ETHER, BASE_NONE, NULL, 0x0,
9527 NULL, HFILL}
9529 { &hf_bthci_evt_le_con_interval,
9530 { "Connection Interval", "bthci_evt.le_con_interval",
9531 FT_UINT16, BASE_CUSTOM, CF_FUNC(bluetooth_unit_1p25_ms), 0x0,
9532 NULL, HFILL }
9534 { &hf_bthci_evt_le_min_interval,
9535 { "Min Connection Interval", "bthci_evt.le_min_interval",
9536 FT_UINT16, BASE_CUSTOM, CF_FUNC(bluetooth_unit_1p25_ms), 0x0,
9537 NULL, HFILL }
9539 { &hf_bthci_evt_le_max_interval,
9540 { "Max Connection Interval", "bthci_evt.le_max_interval",
9541 FT_UINT16, BASE_CUSTOM, CF_FUNC(bluetooth_unit_1p25_ms), 0x0,
9542 NULL, HFILL }
9544 { &hf_bthci_evt_le_con_latency,
9545 { "Connection Latency", "bthci_evt.le_con_latency",
9546 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_number_events), 0x0,
9547 NULL, HFILL }
9549 { &hf_bthci_evt_le_supervision_timeout,
9550 { "Supervision Timeout", "bthci_evt.le_supv_timeout",
9551 FT_UINT16, BASE_CUSTOM, CF_FUNC(bluetooth_unit_0p01_sec), 0x0,
9552 NULL, HFILL }
9554 { &hf_bthci_evt_le_max_tx_octets,
9555 { "Max TX Octets", "bthci_evt.max_tx_octets",
9556 FT_UINT16, BASE_DEC, NULL, 0x0,
9557 NULL, HFILL }
9559 { &hf_bthci_evt_le_max_tx_time,
9560 { "Max TX Time", "bthci_evt.max_tx_time",
9561 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_microseconds), 0x0,
9562 NULL, HFILL }
9564 { &hf_bthci_evt_le_max_rx_octets,
9565 { "Max RX Octets", "bthci_evt.max_rx_octets",
9566 FT_UINT16, BASE_DEC, NULL, 0x0,
9567 NULL, HFILL }
9569 { &hf_bthci_evt_le_max_rx_time,
9570 { "Max RX Time", "bthci_evt.max_rx_time",
9571 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_microseconds), 0x0,
9572 NULL, HFILL }
9574 { &hf_bthci_evt_encrypted_diversifier,
9575 { "Encrypted Diversifier", "bthci_evt.le_encrypted_diversifier",
9576 FT_UINT16, BASE_HEX, NULL, 0x0,
9577 NULL, HFILL }
9579 { &hf_bthci_evt_le_central_clock_accuracy,
9580 { "Central Clock Accuracy", "bthci_evt.le_central_clock_accuracy",
9581 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_clock_accuray_vals_ext, 0x0,
9582 NULL, HFILL }
9584 { &hf_bthci_evt_num_reports,
9585 { "Num Reports", "bthci_evt.le_num_reports",
9586 FT_UINT8, BASE_DEC, NULL, 0x0,
9587 NULL, HFILL }
9589 { &hf_bthci_evt_advts_event_type,
9590 { "Event Type", "bthci_evt.le_advts_event_type",
9591 FT_UINT8, BASE_HEX, VALS(evt_le_advertising_evt_types), 0x0,
9592 NULL, HFILL }
9594 { &hf_bthci_evt_ext_advts_event_type,
9595 { "Event Type", "bthci_evt.le_ext_advts_event_type",
9596 FT_UINT16, BASE_HEX, NULL, 0x0,
9597 NULL, HFILL }
9599 { &hf_bthci_evt_le_states,
9600 { "Supported LE States", "bthci_evt.le_states",
9601 FT_NONE, BASE_NONE, NULL, 0x00,
9602 NULL, HFILL }
9604 { &hf_bthci_evt_le_states_00,
9605 { "Non-connectable Advertising State", "bthci_evt.le_states_00",
9606 FT_BOOLEAN, 8, NULL, 0x01,
9607 NULL, HFILL }
9609 { &hf_bthci_evt_le_states_01,
9610 { "Scannable Advertising State", "bthci_evt.le_states_01",
9611 FT_BOOLEAN, 8, NULL, 0x02,
9612 NULL, HFILL }
9614 { &hf_bthci_evt_le_states_02,
9615 { "Connectable Advertising State", "bthci_evt.le_states_02",
9616 FT_BOOLEAN, 8, NULL, 0x04,
9617 NULL, HFILL }
9619 { &hf_bthci_evt_le_states_03,
9620 { "Directed Advertising State", "bthci_evt.le_states_03",
9621 FT_BOOLEAN, 8, NULL, 0x08,
9622 NULL, HFILL }
9624 { &hf_bthci_evt_le_states_04,
9625 { "Passive Scanning State", "bthci_evt.le_states_04",
9626 FT_BOOLEAN, 8, NULL, 0x10,
9627 NULL, HFILL }
9629 { &hf_bthci_evt_le_states_05,
9630 { "Active Scanning State", "bthci_evt.le_states_05",
9631 FT_BOOLEAN, 8, NULL, 0x20,
9632 NULL, HFILL }
9634 { &hf_bthci_evt_le_states_06,
9635 { "Initiating State. Connection State in Central Role", "bthci_evt.le_states_06",
9636 FT_BOOLEAN, 8, NULL, 0x40,
9637 NULL, HFILL }
9639 { &hf_bthci_evt_le_states_07,
9640 { "Connection State in Peripheral Role", "bthci_evt.le_states_07",
9641 FT_BOOLEAN, 8, NULL, 0x80,
9642 NULL, HFILL }
9644 { &hf_bthci_evt_le_states_10,
9645 { "Non-connectable Advertising State and Passive Scanning State combination", "bthci_evt.le_states_10",
9646 FT_BOOLEAN, 8, NULL, 0x01,
9647 NULL, HFILL }
9649 { &hf_bthci_evt_le_states_11,
9650 { "Scannable Advertising State and Passive Scanning State combination", "bthci_evt.le_states_11",
9651 FT_BOOLEAN, 8, NULL, 0x02,
9652 NULL, HFILL }
9654 { &hf_bthci_evt_le_states_12,
9655 { "Connectable Advertising State and Passive Scanning State combination", "bthci_evt.le_states_12",
9656 FT_BOOLEAN, 8, NULL, 0x04,
9657 NULL, HFILL }
9659 { &hf_bthci_evt_le_states_13,
9660 { "Directed Advertising State and Passive Scanning State combination", "bthci_evt.le_states_13",
9661 FT_BOOLEAN, 8, NULL, 0x08,
9662 NULL, HFILL }
9664 { &hf_bthci_evt_le_states_14,
9665 { "Non-connectable Advertising State and Active Scanning State combination", "bthci_evt.le_states_14",
9666 FT_BOOLEAN, 8, NULL, 0x10,
9667 NULL, HFILL }
9669 { &hf_bthci_evt_le_states_15,
9670 { "Scannable Advertising State and Active Scanning State combination", "bthci_evt.le_states_15",
9671 FT_BOOLEAN, 8, NULL, 0x20,
9672 NULL, HFILL }
9674 { &hf_bthci_evt_le_states_16,
9675 { "Connectable Advertising State and Active Scanning State combination", "bthci_evt.le_states_16",
9676 FT_BOOLEAN, 8, NULL, 0x40,
9677 NULL, HFILL }
9679 { &hf_bthci_evt_le_states_17,
9680 { "Directed Advertising State and Active Scanning State combination", "bthci_evt.le_states_17",
9681 FT_BOOLEAN, 8, NULL, 0x80,
9682 NULL, HFILL }
9684 { &hf_bthci_evt_le_states_20,
9685 { "Non-connectable Advertising State and Initiating State combination", "bthci_evt.le_states_20",
9686 FT_BOOLEAN, 8, NULL, 0x01,
9687 NULL, HFILL }
9689 { &hf_bthci_evt_le_states_21,
9690 { "Scannable Advertising State and Initiating State combination", "bthci_evt.le_states_21",
9691 FT_BOOLEAN, 8, NULL, 0x02,
9692 NULL, HFILL }
9694 { &hf_bthci_evt_le_states_22,
9695 { "Non-connectable Advertising State and Central Role combination", "bthci_evt.le_states_22",
9696 FT_BOOLEAN, 8, NULL, 0x04,
9697 NULL, HFILL }
9699 { &hf_bthci_evt_le_states_23,
9700 { "Scannable Advertising State and Central Role combination", "bthci_evt.le_states_23",
9701 FT_BOOLEAN, 8, NULL, 0x08,
9702 NULL, HFILL }
9704 { &hf_bthci_evt_le_states_24,
9705 { "Non-connectable Advertising State and Peripheral Role combination", "bthci_evt.le_states_24",
9706 FT_BOOLEAN, 8, NULL, 0x10,
9707 NULL, HFILL }
9709 { &hf_bthci_evt_le_states_25,
9710 { "Scannable Advertising State and Peripheral Role combination", "bthci_evt.le_states_25",
9711 FT_BOOLEAN, 8, NULL, 0x20,
9712 NULL, HFILL }
9714 { &hf_bthci_evt_le_states_26,
9715 { "Passive Scanning State and Initiating State combination", "bthci_evt.le_states_26",
9716 FT_BOOLEAN, 8, NULL, 0x40,
9717 NULL, HFILL }
9719 { &hf_bthci_evt_le_states_27,
9720 { "Active Scanning State and Initiating State combination", "bthci_evt.le_states_27",
9721 FT_BOOLEAN, 8, NULL, 0x80,
9722 NULL, HFILL }
9724 { &hf_bthci_evt_le_states_30,
9725 { "Passive Scanning State and Central Role combination", "bthci_evt.le_states_30",
9726 FT_BOOLEAN, 8, NULL, 0x01,
9727 NULL, HFILL }
9729 { &hf_bthci_evt_le_states_31,
9730 { "Active Scanning State and Central Role combination", "bthci_evt.le_states_31",
9731 FT_BOOLEAN, 8, NULL, 0x02,
9732 NULL, HFILL }
9734 { &hf_bthci_evt_le_states_32,
9735 { "Passive Scanning state and Peripheral Role combination", "bthci_evt.le_states_32",
9736 FT_BOOLEAN, 8, NULL, 0x04,
9737 NULL, HFILL }
9739 { &hf_bthci_evt_le_states_33,
9740 { "Active Scanning state and Peripheral Role combination", "bthci_evt.le_states_33",
9741 FT_BOOLEAN, 8, NULL, 0x08,
9742 NULL, HFILL }
9744 { &hf_bthci_evt_le_states_34,
9745 { "Initiating State and Central Role combination. Central Role and Central Role combination", "bthci_evt.le_states_34",
9746 FT_BOOLEAN, 8, NULL, 0x10,
9747 NULL, HFILL }
9749 { &hf_changed_in_frame,
9750 { "Change in Frame", "bthci_evt.change_in_frame",
9751 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
9752 NULL, HFILL }
9754 { &hf_command_in_frame,
9755 { "Command in frame", "bthci_evt.command_in_frame",
9756 FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_REQUEST), 0x0,
9757 NULL, HFILL }
9759 { &hf_pending_in_frame,
9760 { "Pending in frame", "bthci_evt.pending_in_frame",
9761 FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_RESPONSE), 0x0,
9762 NULL, HFILL }
9764 { &hf_response_in_frame,
9765 { "Response in frame", "bthci_evt.response_in_frame",
9766 FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_RESPONSE), 0x0,
9767 NULL, HFILL }
9769 { &hf_command_response_time_delta,
9770 { "Command-Response Delta", "bthci_evt.command_response_delta",
9771 FT_DOUBLE, BASE_NONE|BASE_UNIT_STRING, UNS(&units_milliseconds), 0x00,
9772 NULL, HFILL }
9774 { &hf_command_pending_time_delta,
9775 { "Command-Pending Delta", "bthci_evt.command_pending_delta",
9776 FT_DOUBLE, BASE_NONE|BASE_UNIT_STRING, UNS(&units_milliseconds), 0x00,
9777 NULL, HFILL }
9779 { &hf_pending_response_time_delta,
9780 { "Pending-Response Delta", "bthci_evt.pending_response_delta",
9781 FT_DOUBLE, BASE_NONE|BASE_UNIT_STRING, UNS(&units_milliseconds), 0x00,
9782 NULL, HFILL }
9784 { &hf_bthci_evt_le_features,
9785 { "Supported LE Features", "bthci_evt.le_features",
9786 FT_UINT64, BASE_HEX, NULL, 0x00,
9787 NULL, HFILL }
9789 { &hf_bthci_evt_le_features_encryption,
9790 { "Encryption", "bthci_evt.le_features.encryption",
9791 FT_BOOLEAN, 64, NULL, 0x0000000000000001,
9792 NULL, HFILL }
9794 { &hf_bthci_evt_le_features_connection_parameters_request_procedure,
9795 { "Connection Parameters Request Procedure", "bthci_evt.le_features.connection_parameters_request_procedure",
9796 FT_BOOLEAN, 64, NULL, 0x0000000000000002,
9797 NULL, HFILL }
9799 { &hf_bthci_evt_le_features_extended_reject_indication,
9800 { "Extended Reject Indication", "bthci_evt.le_features.extended_reject_indication",
9801 FT_BOOLEAN, 64, NULL, 0x0000000000000004,
9802 NULL, HFILL }
9804 { &hf_bthci_evt_le_features_peripheral_initiated_features_exchange,
9805 { "Peripheral-Initiated Features Exchange", "bthci_evt.le_features.peripheral_initiated_features_exchange",
9806 FT_BOOLEAN, 64, NULL, 0x0000000000000008,
9807 NULL, HFILL }
9809 { &hf_bthci_evt_le_features_ping,
9810 { "Ping", "bthci_evt.le_features.ping",
9811 FT_BOOLEAN, 64, NULL, 0x0000000000000010,
9812 NULL, HFILL }
9814 { &hf_bthci_evt_le_features_data_packet_length_extension,
9815 { "Data Packet Length Extension", "bthci_evt.le_features.data_packet_length_extension",
9816 FT_BOOLEAN, 64, NULL, 0x0000000000000020,
9817 NULL, HFILL }
9819 { &hf_bthci_evt_le_features_ll_privacy,
9820 { "LL Privacy", "bthci_evt.le_features.ll_privacy",
9821 FT_BOOLEAN, 64, NULL, 0x0000000000000040,
9822 NULL, HFILL }
9824 { &hf_bthci_evt_le_features_extended_scanner_filter_policies,
9825 { "Extended Scanner Filter Policies", "bthci_evt.le_features.extended_scanner_filter_policies",
9826 FT_BOOLEAN, 64, NULL, 0x0000000000000080,
9827 NULL, HFILL }
9829 { &hf_bthci_evt_le_features_2m_phy,
9830 { "LE 2M PHY", "bthci_evt.le_features.2m_phy",
9831 FT_BOOLEAN, 64, NULL, 0x0000000000000100,
9832 NULL, HFILL }
9834 { &hf_bthci_evt_le_features_stable_modulation_index_tx,
9835 { "Stable Modulation Index - Tx", "bthci_evt.le_features.stable_modulation_index_tx",
9836 FT_BOOLEAN, 64, NULL, 0x0000000000000200,
9837 NULL, HFILL }
9839 { &hf_bthci_evt_le_features_stable_modulation_index_rx,
9840 { "Stable Modulation Index - Rx", "bthci_evt.le_features.stable_modulation_index_rx",
9841 FT_BOOLEAN, 64, NULL, 0x0000000000000400,
9842 NULL, HFILL }
9844 { &hf_bthci_evt_le_features_coded_phy,
9845 { "Coded PHY", "bthci_evt.le_features.coded_phy",
9846 FT_BOOLEAN, 64, NULL, 0x0000000000000800,
9847 NULL, HFILL }
9849 { &hf_bthci_evt_le_features_extended_advertising,
9850 { "Extended Advertising", "bthci_evt.le_features.extended_advertising",
9851 FT_BOOLEAN, 64, NULL, 0x0000000000001000,
9852 NULL, HFILL }
9854 { &hf_bthci_evt_le_features_periodic_advertising,
9855 { "Periodic Advertising", "bthci_evt.le_features.periodic_advertising",
9856 FT_BOOLEAN, 64, NULL, 0x0000000000002000,
9857 NULL, HFILL }
9859 { &hf_bthci_evt_le_features_channel_selection_algorithm_2,
9860 { "Channel Selection Algorithm #2", "bthci_evt.le_features.channel_selection_algorithm_2",
9861 FT_BOOLEAN, 64, NULL, 0x0000000000004000,
9862 NULL, HFILL }
9864 { &hf_bthci_evt_le_features_power_class_1,
9865 { "Power Class 1", "bthci_evt.le_features.power_class_1",
9866 FT_BOOLEAN, 64, NULL, 0x0000000000008000,
9867 NULL, HFILL }
9869 { &hf_bthci_evt_le_features_minimum_number_of_used_channels_procedure,
9870 { "Minimum Number of Used Channels Procedure", "bthci_evt.le_features.minimum_number_of_used_channels_procedure",
9871 FT_BOOLEAN, 64, NULL, 0x0000000000010000,
9872 NULL, HFILL }
9874 { &hf_bthci_evt_le_features_connection_cte_request,
9875 { "Connection CTE Request", "bthci_evt.le_features.connection_cte_request",
9876 FT_BOOLEAN, 64, NULL, 0x0000000000020000,
9877 NULL, HFILL }
9879 { &hf_bthci_evt_le_features_connection_cte_response,
9880 { "Connection CTE Response", "bthci_evt.le_features.connection_cte_response",
9881 FT_BOOLEAN, 64, NULL, 0x0000000000040000,
9882 NULL, HFILL }
9884 { &hf_bthci_evt_le_features_connectionless_cte_tx,
9885 { "Connectionless CTE Tx", "bthci_evt.le_features.connectionless_cte_tx",
9886 FT_BOOLEAN, 64, NULL, 0x0000000000080000,
9887 NULL, HFILL }
9889 { &hf_bthci_evt_le_features_connectionless_cte_rx,
9890 { "Connectionless CTE Rx", "bthci_evt.le_features.connectionless_cte_rx",
9891 FT_BOOLEAN, 64, NULL, 0x0000000000100000,
9892 NULL, HFILL }
9894 { &hf_bthci_evt_le_features_antenna_switching_during_cte_tx_aod,
9895 { "Antenna Switching During CTE Tx (AoD)", "bthci_evt.le_features.antenna_switching_during_cte_tx_aod",
9896 FT_BOOLEAN, 64, NULL, 0x0000000000200000,
9897 NULL, HFILL }
9899 { &hf_bthci_evt_le_features_antenna_switching_during_cte_rx_aoa,
9900 { "Antenna Switching During CTE Rx (AoA)", "bthci_evt.le_features.antenna_switching_during_cte_rx_aoa",
9901 FT_BOOLEAN, 64, NULL, 0x0000000000400000,
9902 NULL, HFILL }
9904 { &hf_bthci_evt_le_features_receiving_cte,
9905 { "Receiving CTE", "bthci_evt.le_features.receiving_cte",
9906 FT_BOOLEAN, 64, NULL, 0x0000000000800000,
9907 NULL, HFILL }
9909 { &hf_bthci_evt_le_features_periodic_advertising_sync_transfer_sender,
9910 { "Periodic Advertising Sync Transfer - Sender", "bthci_evt.le_features.periodic_advertising_sync_transfer_sender",
9911 FT_BOOLEAN, 64, NULL, 0x0000000001000000,
9912 NULL, HFILL }
9914 { &hf_bthci_evt_le_features_periodic_advertising_sync_transfer_receiver,
9915 { "Periodic Advertising Sync Transfer - Receiver", "bthci_evt.le_features.periodic_advertising_sync_transfer_receiver",
9916 FT_BOOLEAN, 64, NULL, 0x0000000002000000,
9917 NULL, HFILL }
9919 { &hf_bthci_evt_le_features_sleep_clock_accuracy_updates,
9920 { "Sleep Clock Accuracy Updates", "bthci_evt.le_features.sleep_clock_accuracy_updates",
9921 FT_BOOLEAN, 64, NULL, 0x0000000004000000,
9922 NULL, HFILL }
9924 { &hf_bthci_evt_le_features_remote_public_key_validation,
9925 { "Remote Public Key Validation", "bthci_evt.le_features.remote_public_key_validation",
9926 FT_BOOLEAN, 64, NULL, 0x0000000008000000,
9927 NULL, HFILL }
9929 { &hf_bthci_evt_le_features_cis_central,
9930 { "Connected Isochronous Stream - Central", "bthci_evt.le_features.cis_central",
9931 FT_BOOLEAN, 64, NULL, 0x0000000010000000,
9932 NULL, HFILL }
9934 { &hf_bthci_evt_le_features_cis_peripheral,
9935 { "Connected Isochronous Stream - Peripheral", "bthci_evt.le_features.cis_peripheral",
9936 FT_BOOLEAN, 64, NULL, 0x0000000020000000,
9937 NULL, HFILL }
9939 { &hf_bthci_evt_le_features_isochronous_broadcaster,
9940 { "Isochronous Broadcaster", "bthci_evt.le_features.isochronous_broadcaster",
9941 FT_BOOLEAN, 64, NULL, 0x0000000040000000,
9942 NULL, HFILL }
9944 { &hf_bthci_evt_le_features_synchronized_receiver,
9945 { "Synchronized Receiver", "bthci_evt.le_features.synchronized_receiver",
9946 FT_BOOLEAN, 64, NULL, 0x0000000080000000,
9947 NULL, HFILL }
9949 { &hf_bthci_evt_le_features_isochronous_channels_host_support,
9950 { "Isochronous Channels (Host_support)", "bthci_evt.le_features.isochronous_channels_host_support",
9951 FT_BOOLEAN, 64, NULL, 0x0000000100000000,
9952 NULL, HFILL }
9954 { &hf_bthci_evt_le_features_power_control_request,
9955 { "Power Control Request", "bthci_evt.le_features.power_control_request",
9956 FT_BOOLEAN, 64, NULL, 0x0000000200000000,
9957 NULL, HFILL }
9959 { &hf_bthci_evt_le_features_power_change_indication,
9960 { "Power Change Indication", "bthci_evt.le_features.power_change_indication",
9961 FT_BOOLEAN, 64, NULL, 0x0000000400000000,
9962 NULL, HFILL }
9964 { &hf_bthci_evt_le_features_path_loss_monitoring,
9965 { "Path Loss Monitoring", "bthci_evt.le_features.path_loss_monitoring",
9966 FT_BOOLEAN, 64, NULL, 0x0000000800000000,
9967 NULL, HFILL }
9969 { &hf_bthci_evt_le_features_periodic_advertising_adi,
9970 { "Periodic Advertising ADI", "bthci_evt.le_features.periodic_advertising_adi",
9971 FT_BOOLEAN, 64, NULL, 0x0000001000000000,
9972 NULL, HFILL }
9974 { &hf_bthci_evt_le_features_connection_subrating,
9975 { "Connection Subrating", "bthci_evt.le_features.connection_subrating",
9976 FT_BOOLEAN, 64, NULL, 0x0000002000000000,
9977 NULL, HFILL }
9979 { &hf_bthci_evt_le_features_connection_subrating_host_support,
9980 { "Connection Subrating (Host support)", "bthci_evt.le_features.connection_subrating_host_support",
9981 FT_BOOLEAN, 64, NULL, 0x0000004000000000,
9982 NULL, HFILL }
9984 { &hf_bthci_evt_le_features_channel_classification,
9985 { "Channel Classification", "bthci_evt.le_features.channel_classification",
9986 FT_BOOLEAN, 64, NULL, 0x0000008000000000,
9987 NULL, HFILL }
9989 { &hf_bthci_evt_le_features_coding_selection,
9990 { "Coding Selection", "bthci_evt.le_features.coding_selection",
9991 FT_BOOLEAN, 64, NULL, 0x0000010000000000,
9992 NULL, HFILL }
9994 { &hf_bthci_evt_le_features_coding_selection_host_support,
9995 { "Coding Selection (Host support)", "bthci_evt.le_features.coding_selection_host_support",
9996 FT_BOOLEAN, 64, NULL, 0x0000020000000000,
9997 NULL, HFILL }
9999 { &hf_bthci_evt_le_features_decision_based_advertising_filtering,
10000 { "Decision-based Advertising Filtering", "bthci_evt.le_features.decision_based_advertising_filtering",
10001 FT_BOOLEAN, 64, NULL, 0x0000040000000000,
10002 NULL, HFILL }
10004 { &hf_bthci_evt_le_features_periodic_advertising_responses_advertiser,
10005 { "Periodic Advertising with Responses - Advertiser", "bthci_evt.le_features.periodic_advertising_responses_advertiser",
10006 FT_BOOLEAN, 64, NULL, 0x0000080000000000,
10007 NULL, HFILL }
10009 { &hf_bthci_evt_le_features_periodic_advertising_responses_scanner,
10010 { "Periodic Advertising with Responses - Scanner", "bthci_evt.le_features.periodic_advertising_responses_scanner",
10011 FT_BOOLEAN, 64, NULL, 0x0000100000000000,
10012 NULL, HFILL }
10014 { &hf_bthci_evt_le_features_unsegmented_framed_mode,
10015 { "Unsegmented Framed Mode", "bthci_evt.le_features.unsegmented_framed_mode",
10016 FT_BOOLEAN, 64, NULL, 0x0000200000000000,
10017 NULL, HFILL }
10019 { &hf_bthci_evt_le_features_channel_sounding,
10020 { "Channel Sounding", "bthci_evt.le_features.channel_sounding",
10021 FT_BOOLEAN, 64, NULL, 0x0000400000000000,
10022 NULL, HFILL }
10024 { &hf_bthci_evt_le_features_channel_sounding_host_support,
10025 { "Channel Sounding (Host support)", "bthci_evt.le_features.channel_sounding_host_support",
10026 FT_BOOLEAN, 64, NULL, 0x0000800000000000,
10027 NULL, HFILL }
10029 { &hf_bthci_evt_le_features_channel_sounding_tone_quality_indication,
10030 { "Channel Sounding - Tone Quality Indication", "bthci_evt.le_features.channel_sounding_tone_quality_indication",
10031 FT_BOOLEAN, 64, NULL, 0x0001000000000000,
10032 NULL, HFILL }
10034 { &hf_bthci_evt_le_features_ext_feature_set,
10035 { "Extended Feature Set", "bthci_evt.le_features.ext_feature_set",
10036 FT_BOOLEAN, 64, NULL, 0x8000000000000000,
10037 NULL, HFILL }
10039 { &hf_bthci_evt_le_features_reserved,
10040 { "Reserved", "bthci_evt.le_features.reserved",
10041 FT_UINT64, BASE_HEX, NULL, UINT64_C(0x7FFE000000000000),
10042 NULL, HFILL }
10044 { &hf_bthci_evt_le_ext_features_1,
10045 { "Supported LE Extended Features - Bit 64-127", "bthci_evt.le_ext_features_1",
10046 FT_UINT64, BASE_HEX, NULL, 0x00,
10047 NULL, HFILL }
10049 { &hf_bthci_evt_le_ext_features_1_monitoring_advertisers,
10050 { "Monitoring Advertisers", "bthci_evt.le_ext_features_1.monitoring_advertisers",
10051 FT_BOOLEAN, 64, NULL, 0x0000000000000001,
10052 NULL, HFILL }
10054 { &hf_bthci_evt_le_ext_features_1_frame_space_update,
10055 { "Frame Space Update", "bthci_evt.le_ext_features_page1.frame_space_update",
10056 FT_BOOLEAN, 64, NULL, 0x0000000000000002,
10057 NULL, HFILL }
10059 { &hf_bthci_evt_le_ext_features_1_reserved,
10060 { "Reserved", "bthci_evt.le_ext_features_1.reserved",
10061 FT_UINT64, BASE_HEX, NULL, UINT64_C(0xFFFFFFFFFFFFFFFC),
10062 NULL, HFILL }
10064 { &hf_bthci_evt_mws_number_of_transports,
10065 { "Number of Transports", "bthci_evt.mws.number_of_transports",
10066 FT_UINT8, BASE_DEC, NULL, 0x0,
10067 NULL, HFILL }
10069 { &hf_bthci_evt_mws_transport_layers,
10070 { "Transport Layers", "bthci_evt.mws.transport_layers",
10071 FT_NONE, BASE_NONE, NULL, 0x0,
10072 NULL, HFILL }
10074 { &hf_bthci_evt_mws_transport_layers_item,
10075 { "Transport Layer Item", "bthci_evt.mws.transport_layers.item",
10076 FT_NONE, BASE_NONE, NULL, 0x0,
10077 NULL, HFILL }
10079 { &hf_bthci_evt_mws_transport_layer,
10080 { "Transport Layer", "bthci_evt.mws.transport_layers.item.transport_layer",
10081 FT_UINT8, BASE_HEX, VALS(bthci_evt_mws_transport_layer_vals), 0x0,
10082 NULL, HFILL }
10084 { &hf_bthci_evt_mws_number_of_baud_rates,
10085 { "Number of Baud Rates", "bthci_evt.mws.number_of_baud_rates",
10086 FT_UINT8, BASE_DEC, NULL, 0x0,
10087 NULL, HFILL }
10089 { &hf_bthci_evt_mws_to_mws_baud_rates,
10090 { "To MWS Baud Rates", "bthci_evt.mws.to_mws_baud_rates",
10091 FT_NONE, BASE_NONE, NULL, 0x0,
10092 NULL, HFILL }
10094 { &hf_bthci_evt_mws_to_mws_baud_rates_tranport_item,
10095 { "To MWS Baud Rates Item", "bthci_evt.mws.to_mws_baud_rates.item",
10096 FT_NONE, BASE_NONE, NULL, 0x0,
10097 NULL, HFILL }
10099 { &hf_bthci_evt_mws_to_mws_baud_rate,
10100 { "To MWS Baud Rate", "bthci_evt.mws.to_mws_baud_rates.item.baud_rate",
10101 FT_UINT32, BASE_DEC, NULL, 0x0,
10102 NULL, HFILL }
10104 { &hf_bthci_evt_mws_from_mws_baud_rates,
10105 { "From MWS Baud Rates", "bthci_evt.mws.from_mws_baud_rates",
10106 FT_NONE, BASE_NONE, NULL, 0x0,
10107 NULL, HFILL }
10109 { &hf_bthci_evt_mws_from_mws_baud_rates_tranport_item,
10110 { "From MWS Baud Rates Item", "bthci_evt.mws.from_mws_baud_rates.item",
10111 FT_NONE, BASE_NONE, NULL, 0x0,
10112 NULL, HFILL }
10114 { &hf_bthci_evt_mws_from_mws_baud_rate,
10115 { "From MWS Baud Rate", "bthci_evt.mws.from_mws_baud_rates.item.baud_rate",
10116 FT_UINT32, BASE_DEC, NULL, 0x0,
10117 NULL, HFILL }
10119 { &hf_bthci_evt_selected_tx_power,
10120 { "Selected TX Power (dBm)", "bthci_evt.transmit_power_level",
10121 FT_INT8, BASE_DEC, NULL, 0x0,
10122 NULL, HFILL }
10124 { &hf_bthci_evt_which_clock,
10125 { "Which Clock", "bthci_evt.which_clock",
10126 FT_UINT8, BASE_HEX, VALS(which_clock_vals), 0x0,
10127 NULL, HFILL }
10129 { &hf_bthci_evt_slot_offset,
10130 { "Slot Offset", "bthci_evt.slot_offset",
10131 FT_UINT16, BASE_DEC, NULL, 0x0,
10132 NULL, HFILL }
10134 { &hf_bthci_evt_clock_offset_32,
10135 { "Clock Offset", "bthci_evt.clock_offset_32",
10136 FT_UINT32, BASE_HEX, NULL, 0x0FFFFFFF,
10137 "Bits 0-27 of the Clock Offset between CLKNreceiver-CLKNtransmitter", HFILL }
10139 { &hf_bthci_evt_next_broadcast_instant,
10140 { "Next Broadcast Instant", "bthci_evt.next_broadcast_instant",
10141 FT_UINT32, BASE_HEX, NULL, 0x0FFFFFFF,
10142 "CLK of a future broadcast on this channel", HFILL }
10144 { &hf_bthci_evt_lt_addr,
10145 { "LT_ADDR", "bthci_evt.lt_addr",
10146 FT_UINT8, BASE_HEX, NULL, 0x0,
10147 NULL, HFILL }
10149 { &hf_bthci_evt_connectionless_peripheral_broadcast_interval,
10150 { "Connectionless Peripheral Broadcast Interval", "bthci_evt.connectionless_peripheral_broadcast_interval",
10151 FT_UINT16, BASE_DEC, NULL, 0x0,
10152 NULL, HFILL }
10154 { &hf_bthci_evt_service_data,
10155 { "Service Data", "bthci_evt.service_data",
10156 FT_UINT8, BASE_HEX, NULL, 0x0,
10157 NULL, HFILL }
10159 { &hf_bthci_evt_local_sam_index,
10160 { "Local SAM Index", "bthci_evt.local_sam_index",
10161 FT_UINT8, BASE_HEX|BASE_SPECIAL_VALS, VALS(unique_sam_disabled), 0x0,
10162 NULL, HFILL }
10164 { &hf_bthci_evt_local_sam_tx_availability,
10165 { "Local SAM Tx Availability", "bthci_evt.local_sam_tx_availability",
10166 FT_UINT8, BASE_DEC, NULL, 0x0,
10167 NULL, HFILL }
10169 { &hf_bthci_evt_local_sam_rx_availability,
10170 { "Local SAM Rx Availability", "bthci_evt.local_sam_rx_availability",
10171 FT_UINT8, BASE_DEC, NULL, 0x0,
10172 NULL, HFILL }
10174 { &hf_bthci_evt_remote_sam_index,
10175 { "Remote SAM Index", "bthci_evt.remote_sam_index",
10176 FT_UINT8, BASE_HEX|BASE_SPECIAL_VALS, VALS(unique_sam_disabled), 0x0,
10177 NULL, HFILL }
10179 { &hf_bthci_evt_remote_sam_tx_availability,
10180 { "Remote SAM Tx Availability", "bthci_evt.remote_sam_tx_availability",
10181 FT_UINT8, BASE_DEC, NULL, 0x0,
10182 NULL, HFILL }
10184 { &hf_bthci_evt_remote_sam_rx_availability,
10185 { "Remote SAM Rx Availability", "bthci_evt.remote_sam_rx_availability",
10186 FT_UINT8, BASE_DEC, NULL, 0x0,
10187 NULL, HFILL }
10189 { &hf_bthci_evt_receive_status,
10190 { "Receive Status", "bthci_evt.receive_status",
10191 FT_UINT8, BASE_HEX, VALS(receive_status_vals), 0x0,
10192 NULL, HFILL }
10194 { &hf_bthci_evt_fragment,
10195 { "Fragment", "bthci_evt.fragment",
10196 FT_UINT8, BASE_HEX, VALS(fragment_vals), 0x0,
10197 NULL, HFILL }
10199 { &hf_bthci_evt_data,
10200 { "Data", "bthci_evt.data",
10201 FT_BYTES, BASE_NONE, NULL, 0x0,
10202 NULL, HFILL }
10204 { &hf_bthci_evt_le_number_of_reports,
10205 { "Number of Reports", "bthci_evt.number_of_reports",
10206 FT_UINT8, BASE_DEC, NULL, 0x0,
10207 NULL, HFILL }
10209 { &hf_bthci_evt_le_report,
10210 { "Report", "bthci_evt.report",
10211 FT_NONE, BASE_NONE, NULL, 0x0,
10212 NULL, HFILL }
10214 { &hf_bthci_evt_le_event_type,
10215 { "Event Type", "bthci_evt.event_type",
10216 FT_UINT8, BASE_HEX, VALS(event_type_vals), 0x0,
10217 NULL, HFILL }
10219 { &hf_bthci_evt_le_direct_bd_addr,
10220 { "Direct BD_ADDR", "bthci_evt.direct_bd_addr",
10221 FT_ETHER, BASE_NONE, NULL, 0x0,
10222 NULL, HFILL}
10224 { &hf_bthci_evt_le_direct_address_type,
10225 { "Direct Address Type", "bthci_evt.le_direct_address_type",
10226 FT_UINT8, BASE_HEX, VALS(bthci_cmd_address_types_vals), 0x0,
10227 NULL, HFILL }
10229 { &hf_bthci_evt_le_address_type,
10230 { "Address Type", "bthci_evt.le_address_type",
10231 FT_UINT8, BASE_HEX, VALS(bthci_cmd_address_types_vals), 0x0,
10232 NULL, HFILL }
10234 { &hf_bthci_evt_le_rssi,
10235 { "RSSI (dBm)", "bthci_evt.le_rssi",
10236 FT_INT8, BASE_DEC, NULL, 0x0,
10237 NULL, HFILL }
10239 { &hf_bthci_evt_le_tx_phy,
10240 { "Tx PHY", "bthci_evt.le_tx_phy",
10241 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_le_phy_vals_ext, 0x0,
10242 NULL, HFILL }
10244 { &hf_bthci_evt_le_rx_phy,
10245 { "Rx PHY", "bthci_evt.le_rx_phy",
10246 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_le_phy_vals_ext, 0x0,
10247 NULL, HFILL }
10249 { &hf_bthci_evt_max_adv_data_length,
10250 { "Maximum Advertising Data Length", "bthci_evt.max_adv_data_length",
10251 FT_UINT16, BASE_DEC, NULL, 0x0,
10252 NULL, HFILL }
10254 { &hf_bthci_evt_num_supported_adv_sets,
10255 { "Number of Supported Advertising Sets", "bthci_evt.num_supported_adv_sets",
10256 FT_UINT8, BASE_DEC, NULL, 0x0,
10257 NULL, HFILL }
10259 { &hf_bthci_evt_number_of_supported_codecs,
10260 { "Number of Supported Codecs", "bthci_evt.number_of_supported_codecs",
10261 FT_UINT8, BASE_DEC, NULL, 0x0,
10262 NULL, HFILL }
10264 { &hf_bthci_evt_number_of_supported_vendor_codecs,
10265 { "Number of Supported Vendor Codecs", "bthci_evt.number_of_supported_vendor_codecs",
10266 FT_UINT8, BASE_DEC, NULL, 0x0,
10267 NULL, HFILL }
10269 { &hf_bthci_evt_codecs,
10270 { "Codecs", "bthci_evt.codecs",
10271 FT_NONE, BASE_NONE, NULL, 0x0,
10272 NULL, HFILL }
10274 { &hf_bthci_evt_vendor_codecs,
10275 { "Vendor Codecs", "bthci_evt.vendor_codecs",
10276 FT_NONE, BASE_NONE, NULL, 0x0,
10277 NULL, HFILL }
10279 { &hf_bthci_evt_vendor_codecs_item,
10280 { "Item", "bthci_evt.vendor_codecs.item",
10281 FT_STRING, BASE_NONE, NULL, 0x0,
10282 NULL, HFILL }
10284 { &hf_bthci_evt_codec_id,
10285 { "Codec", "bthci_evt.codec_id",
10286 FT_UINT8, BASE_HEX, VALS(bthci_evt_codec_id_vals), 0x0,
10287 NULL, HFILL }
10289 { &hf_bthci_evt_vendor_codec_id,
10290 { "Vendor Codec ID", "bthci_evt.vendor_codecs.item.codec_id",
10291 FT_UINT16, BASE_HEX, NULL, 0x0,
10292 NULL, HFILL }
10294 { &hf_bthci_evt_mws_bt_rx_priority_assert_offset,
10295 { "Bluetooth Rx Priority Assert Offset", "bthci_evt.mws.bt.rx_priority.assert.offset",
10296 FT_INT16, BASE_DEC, NULL, 0x0,
10297 NULL, HFILL }
10299 { &hf_bthci_evt_mws_bt_rx_priority_assert_jitter,
10300 { "Bluetooth Rx Priority Assert Jitter", "bthci_evt.mws.bt.rx_priority.assert.jitter",
10301 FT_UINT16, BASE_DEC, NULL, 0x0,
10302 NULL, HFILL }
10304 { &hf_bthci_evt_mws_bt_rx_priority_deassert_offset,
10305 { "Bluetooth Rx Priority Deassert Offset", "bthci_evt.mws.bt.rx_priority.deassert.offset",
10306 FT_INT16, BASE_DEC, NULL, 0x0,
10307 NULL, HFILL }
10309 { &hf_bthci_evt_mws_bt_rx_priority_deassert_jitter,
10310 { "Bluetooth Rx Priority Deassert Jitter", "bthci_evt.mws.bt.rx_priority.deassert.jitter",
10311 FT_UINT16, BASE_DEC, NULL, 0x0,
10312 NULL, HFILL }
10314 { &hf_bthci_evt_mws_bt_tx_priority_assert_offset,
10315 { "Bluetooth Tx Priority Assert Offset", "bthci_evt.mws.bt.tx_priority.assert.offset",
10316 FT_INT16, BASE_DEC, NULL, 0x0,
10317 NULL, HFILL }
10319 { &hf_bthci_evt_mws_bt_tx_priority_assert_jitter,
10320 { "Bluetooth Tx Priority Assert Jitter", "bthci_evt.mws.bt.tx_priority.assert.jitter",
10321 FT_UINT16, BASE_DEC, NULL, 0x0,
10322 NULL, HFILL }
10324 { &hf_bthci_evt_mws_bt_tx_priority_deassert_offset,
10325 { "Bluetooth Tx Priority Deassert Offset", "bthci_evt.mws.bt.tx_priority.deassert.offset",
10326 FT_INT16, BASE_DEC, NULL, 0x0,
10327 NULL, HFILL }
10329 { &hf_bthci_evt_mws_bt_tx_priority_deassert_jitter,
10330 { "Bluetooth Tx Priority Deassert Jitter", "bthci_evt.mws.bt.tx_priority.deassert.jitter",
10331 FT_UINT16, BASE_DEC, NULL, 0x0,
10332 NULL, HFILL }
10334 { &hf_bthci_evt_mws_802_rx_priority_assert_offset,
10335 { "802 Rx Priority Assert Offset", "bthci_evt.mws.802.rx_priority.assert.offset",
10336 FT_INT16, BASE_DEC, NULL, 0x0,
10337 NULL, HFILL }
10339 { &hf_bthci_evt_mws_802_rx_priority_assert_jitter,
10340 { "802 Rx Priority Assert Jitter", "bthci_evt.mws.802.rx_priority.assert.jitter",
10341 FT_UINT16, BASE_DEC, NULL, 0x0,
10342 NULL, HFILL }
10344 { &hf_bthci_evt_mws_802_rx_priority_deassert_offset,
10345 { "802 Rx Priority Deassert Offset", "bthci_evt.mws.802.rx_priority.deassert.offset",
10346 FT_INT16, BASE_DEC, NULL, 0x0,
10347 NULL, HFILL }
10349 { &hf_bthci_evt_mws_802_rx_priority_deassert_jitter,
10350 { "802 Rx Priority Deassert Jitter", "bthci_evt.mws.802.rx_priority.deassert.jitter",
10351 FT_UINT16, BASE_DEC, NULL, 0x0,
10352 NULL, HFILL }
10354 { &hf_bthci_evt_mws_802_tx_priority_assert_offset,
10355 { "802 Tx Priority Assert Offset", "bthci_evt.mws.802.tx_priority.assert.offset",
10356 FT_INT16, BASE_DEC, NULL, 0x0,
10357 NULL, HFILL }
10359 { &hf_bthci_evt_mws_802_tx_priority_assert_jitter,
10360 { "802 Tx Priority Assert Jitter", "bthci_evt.mws.802.tx_priority.assert.jitter",
10361 FT_UINT16, BASE_DEC, NULL, 0x0,
10362 NULL, HFILL }
10364 { &hf_bthci_evt_mws_802_tx_priority_deassert_offset,
10365 { "802 Tx Priority Deassert Offset", "bthci_evt.mws.802.tx_priority.deassert.offset",
10366 FT_INT16, BASE_DEC, NULL, 0x0,
10367 NULL, HFILL }
10369 { &hf_bthci_evt_mws_802_tx_priority_deassert_jitter,
10370 { "802 Tx Priority Deassert Jitter", "bthci_evt.mws.802.tx_priority.deassert.jitter",
10371 FT_UINT16, BASE_DEC, NULL, 0x0,
10372 NULL, HFILL }
10374 { &hf_bthci_evt_sync_train_interval,
10375 { "Synchronization Train Interval", "bthci_evt.sync_train_interval",
10376 FT_UINT16, BASE_DEC, NULL, 0x0,
10377 NULL, HFILL }
10379 { &hf_bthci_evt_sync_train_to,
10380 { "Synchronization Train To", "bthci_evt.sync_train_to",
10381 FT_UINT32, BASE_DEC, NULL, 0x0,
10382 NULL, HFILL }
10384 { &hf_bthci_evt_secure_connection_host_support,
10385 { "Secure Connection Host Support", "bthci_evt.secure_connection_host_support",
10386 FT_UINT8, BASE_HEX, VALS(evt_enable_values), 0x0,
10387 NULL, HFILL }
10389 { &hf_bthci_evt_authenticated_payload_timeout,
10390 { "Authenticated Payload Timeout", "bthci_evt.authenticated_payload_timeout",
10391 FT_UINT16, BASE_CUSTOM, CF_FUNC(bluetooth_unit_0p01_sec), 0x0,
10392 NULL, HFILL }
10394 { &hf_bthci_evt_c192,
10395 { "C 192", "bthci_evt.c192",
10396 FT_BYTES, BASE_NONE, NULL, 0x0,
10397 NULL, HFILL }
10399 { &hf_bthci_evt_r192,
10400 { "R 192", "bthci_evt.r192",
10401 FT_BYTES, BASE_NONE, NULL, 0x0,
10402 NULL, HFILL }
10404 { &hf_bthci_evt_c256,
10405 { "C 256", "bthci_evt.c256",
10406 FT_BYTES, BASE_NONE, NULL, 0x0,
10407 NULL, HFILL }
10409 { &hf_bthci_evt_r256,
10410 { "R 256", "bthci_evt.r256",
10411 FT_BYTES, BASE_NONE, NULL, 0x0,
10412 NULL, HFILL }
10414 { &hf_bthci_evt_extended_inquiry_length,
10415 { "Extended Inquiry Length", "bthci_evt.extended_inquiry_length",
10416 FT_UINT16, BASE_CUSTOM, CF_FUNC(bluetooth_unit_0p625_ms), 0x0,
10417 NULL, HFILL }
10419 { &hf_bthci_evt_suggested_max_tx_octets,
10420 { "Suggested Max Tx Octets", "bthci_evt.suggested_max_tx_octets",
10421 FT_UINT16, BASE_DEC, NULL, 0x0,
10422 NULL, HFILL }
10424 { &hf_bthci_evt_suggested_max_tx_time,
10425 { "Suggested Max Tx Time", "bthci_evt.suggested_max_tx_time",
10426 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_microseconds), 0x0,
10427 NULL, HFILL }
10429 { &hf_bthci_evt_suggested_max_rx_octets,
10430 { "Suggested Max Rx Octets", "bthci_evt.suggested_max_rx_octets",
10431 FT_UINT16, BASE_DEC, NULL, 0x0,
10432 NULL, HFILL }
10434 { &hf_bthci_evt_suggested_max_rx_time,
10435 { "Suggested Max Rx Time", "bthci_evt.suggested_max_rx_time",
10436 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_microseconds), 0x0,
10437 NULL, HFILL }
10439 { &hf_bthci_evt_resolving_list_size,
10440 { "Resolving List Size", "bthci_evt.resolving_list_size",
10441 FT_UINT8, BASE_DEC, NULL, 0x0,
10442 NULL, HFILL }
10444 { &hf_bthci_evt_ext_advts_event_type_connectable,
10445 { "Connectable", "bthci_evt.le_ext_advts_event_type.connectable",
10446 FT_BOOLEAN, 16, NULL, 0x0001,
10447 NULL, HFILL }
10449 { &hf_bthci_evt_ext_advts_event_type_scannable,
10450 { "Scannable", "bthci_evt.le_ext_advts_event_type.scannable",
10451 FT_BOOLEAN, 16, NULL, 0x0002,
10452 NULL, HFILL }
10454 { &hf_bthci_evt_ext_advts_event_type_directed,
10455 { "Directed", "bthci_evt.le_ext_advts_event_type.directed",
10456 FT_BOOLEAN, 16, NULL, 0x0004,
10457 NULL, HFILL }
10459 { &hf_bthci_evt_ext_advts_event_type_scan_response,
10460 { "Scan Response", "bthci_evt.le_ext_advts_event_type.scan_response",
10461 FT_BOOLEAN, 16, NULL, 0x0008,
10462 NULL, HFILL }
10464 { &hf_bthci_evt_ext_advts_event_type_legacy,
10465 { "Legacy", "bthci_evt.le_ext_advts_event_type.legacy",
10466 FT_BOOLEAN, 16, NULL, 0x0010,
10467 NULL, HFILL }
10469 { &hf_bthci_evt_ext_advts_event_type_data_status,
10470 { "Data Status", "bthci_evt.le_ext_advts_event_type.data_status",
10471 FT_UINT16, BASE_HEX, VALS(ext_adv_data_status_vals), 0x0060,
10472 NULL, HFILL }
10474 { &hf_bthci_evt_ext_advts_event_type_reserved,
10475 { "Reserved", "bthci_evt.le_ext_advts_event_type.reserved",
10476 FT_UINT16, BASE_HEX, NULL, 0xFF80,
10477 NULL, HFILL }
10479 { &hf_bthci_evt_primary_phy,
10480 { "Primary PHY", "bthci_evt.primary_phy",
10481 FT_UINT8, BASE_HEX, VALS(bthci_evt_primary_phy_vals), 0x0,
10482 NULL, HFILL }
10484 { &hf_bthci_evt_secondary_phy,
10485 { "Secondary PHY", "bthci_evt.secondary_phy",
10486 FT_UINT8, BASE_HEX, VALS(bthci_evt_secondary_phy_vals), 0x0,
10487 NULL, HFILL }
10489 { &hf_bthci_evt_advertising_sid,
10490 { "Advertising SID", "bthci_evt.advertising_sid",
10491 FT_UINT8, BASE_HEX, NULL, 0x0,
10492 NULL, HFILL }
10494 { &hf_bthci_evt_tx_power,
10495 { "TX Power", "bthci_evt.tx_power",
10496 FT_INT8, BASE_DEC|BASE_UNIT_STRING, UNS(&units_dbm), 0x0,
10497 NULL, HFILL }
10499 { &hf_bthci_evt_periodic_advertising_interval,
10500 { "Periodic Advertising Interval", "bthci_evt.periodic_advertising_interval",
10501 FT_UINT16, BASE_CUSTOM, CF_FUNC(bluetooth_unit_1p25_ms), 0x0,
10502 NULL, HFILL }
10504 { &hf_bthci_evt_sync_handle,
10505 { "Sync Handle", "bthci_evt.sync_handle",
10506 FT_UINT16, BASE_HEX|BASE_SPECIAL_VALS, VALS(uint16_no_handle), 0x0,
10507 NULL, HFILL }
10509 { &hf_bthci_evt_data_status,
10510 { "Data Status", "bthci_evt.data_status",
10511 FT_UINT8, BASE_HEX, VALS(ext_adv_data_status_vals), 0x0,
10512 NULL, HFILL }
10514 { &hf_bthci_evt_advertising_handle,
10515 { "Advertising Handle", "bthci_evt.adv_handle",
10516 FT_UINT8, BASE_HEX|BASE_SPECIAL_VALS, VALS(uint8_no_handle), 0x0,
10517 NULL, HFILL }
10519 { &hf_bthci_evt_num_compl_ext_advertising_events,
10520 { "Number Completed Extended Advertising Events", "bthci_evt.num_compl_ext_adv_events",
10521 FT_UINT8, BASE_DEC, NULL, 0x0,
10522 NULL, HFILL }
10524 { &hf_bthci_evt_channel_selection_algorithm,
10525 { "Channel Selection Algorithm", "bthci_evt.channel_selection_algorithm",
10526 FT_UINT8, BASE_HEX, VALS(channel_selection_algo_vals), 0x0,
10527 NULL, HFILL }
10529 { &hf_bthci_evt_advertiser_clock_accuracy,
10530 { "Advertiser Clock Accuracy", "bthci_evt.adv_clock_accuracy",
10531 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_clock_accuray_vals_ext, 0x0,
10532 NULL, HFILL }
10534 { &hf_bthci_evt_advertiser_phy,
10535 { "Advertiser PHY", "bthci_evt.adv_phy",
10536 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_le_phy_vals_ext, 0x0,
10537 NULL, HFILL }
10539 { &hf_bthci_evt_periodic_adv_list_size,
10540 { "Periodic Advertiser List Size", "bthci_evt.le_periodic_adv_list_size",
10541 FT_UINT8, BASE_DEC, NULL, 0x0,
10542 NULL, HFILL }
10544 { &hf_bthci_evt_min_tx_power,
10545 { "Minimum TX Power", "bthci_evt.min_tx_power",
10546 FT_INT8, BASE_DEC|BASE_UNIT_STRING, UNS(&units_dbm), 0x0,
10547 NULL, HFILL }
10549 { &hf_bthci_evt_max_tx_power,
10550 { "Maximum TX Power", "bthci_evt.max_tx_power",
10551 FT_INT8, BASE_DEC|BASE_UNIT_STRING, UNS(&units_dbm), 0x0,
10552 NULL, HFILL }
10554 { &hf_bthci_evt_rf_tx_path_compensation,
10555 { "RF Tx Path Compensation Value", "bthci_evt.rf_tx_path_compensation_value",
10556 FT_INT16, BASE_DEC, NULL, 0x0,
10557 NULL, HFILL }
10559 { &hf_bthci_evt_rf_rx_path_compensation,
10560 { "RF Rx Path Compensation Value", "bthci_evt.rf_rx_path_compensation_value",
10561 FT_INT16, BASE_DEC, NULL, 0x0,
10562 NULL, HFILL }
10564 { &hf_bthci_evt_channel_index,
10565 { "Channel Index", "bthci_evt.channel_index",
10566 FT_UINT8, BASE_DEC, NULL, 0x0,
10567 NULL, HFILL }
10569 { &hf_bthci_evt_cte_rssi,
10570 { "RSSI", "bthci_evt.cte_rssi",
10571 FT_INT16, BASE_DEC, NULL, 0x0,
10572 NULL, HFILL }
10574 { &hf_bthci_evt_antenna_id,
10575 { "Antenna Id", "bthci_evt.antenna_id",
10576 FT_UINT8, BASE_DEC, NULL, 0x0,
10577 NULL, HFILL }
10579 { &hf_bthci_evt_cte_type,
10580 { "CTE Type", "bthci_evt.cte_type",
10581 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_cte_type_vals_ext, 0x0,
10582 NULL, HFILL }
10584 { &hf_bthci_evt_slot_durations,
10585 { "Slot Durations", "bthci_evt.slot_durations",
10586 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_slot_durations_vals_ext, 0x0,
10587 NULL, HFILL }
10589 { &hf_bthci_evt_packet_status,
10590 { "Packet Status", "bthci_evt.packet_status",
10591 FT_UINT8, BASE_HEX, VALS(packet_status_vals), 0x0,
10592 NULL, HFILL }
10594 { &hf_bthci_evt_event_counter,
10595 { "Event Counter", "bthci_evt.event_counter",
10596 FT_UINT16, BASE_HEX, NULL, 0x0,
10597 NULL, HFILL }
10599 { &hf_bthci_evt_sample_count,
10600 { "Sample Count", "bthci_evt.sample_count",
10601 FT_UINT8, BASE_DEC, NULL, 0x0,
10602 NULL, HFILL }
10604 { &hf_bthci_evt_i_sample,
10605 { "I", "bthci_evt.i_sample",
10606 FT_INT8, BASE_DEC, NULL, 0x0,
10607 NULL, HFILL }
10609 { &hf_bthci_evt_q_sample,
10610 { "Q", "bthci_evt.q_sample",
10611 FT_INT8, BASE_DEC, NULL, 0x0,
10612 NULL, HFILL }
10614 { &hf_bthci_evt_service_data_past,
10615 { "Service Data", "bthci_evt.service_data_past",
10616 FT_UINT16, BASE_HEX, NULL, 0x0,
10617 NULL, HFILL }
10619 { &hf_bthci_evt_number_antennae,
10620 { "Number of Antennas", "bthci_evt.number_antennae",
10621 FT_UINT8, BASE_DEC, NULL, 0x0,
10622 NULL, HFILL }
10624 { &hf_bthci_evt_max_cte_length,
10625 { "Max CTE Length", "bthci_evt.max_cte_length",
10626 FT_UINT8, BASE_DEC, NULL, 0x0,
10627 NULL, HFILL }
10629 { &hf_bthci_evt_max_length_antenna_switching_pattern,
10630 { "Max Length Antenna Switching Pattern", "bthci_evt.max_length_antenna_switching_pattern",
10631 FT_UINT8, BASE_DEC, NULL, 0x0,
10632 NULL, HFILL }
10634 { &hf_bthci_evt_supported_switching_sample_rates,
10635 { "Supported Switching Sampling Rates", "bthci_evt.supported_switching_sample_rates",
10636 FT_UINT8, BASE_HEX, NULL, 0x0,
10637 NULL, HFILL }
10639 { &hf_bthci_evt_supported_switching_sample_rates_1us_switching_aod_tx,
10640 { "1 usec switching for AoD Tx", "bthci_evt.supported_switching_sample_rates.1us_switching_aod_tx",
10641 FT_BOOLEAN, 8, NULL, 0x01,
10642 NULL, HFILL }
10644 { &hf_bthci_evt_supported_switching_sample_rates_1us_sampling_aod_rx,
10645 { "1 usec sampling for AoD Rx", "bthci_evt.supported_switching_sample_rates.1us_sampling_aod_rx",
10646 FT_BOOLEAN, 8, NULL, 0x02,
10647 NULL, HFILL }
10649 { &hf_bthci_evt_supported_switching_sample_rates_1us_switching_and_sampling_aoa_rx,
10650 { "1 usec switching and sampling for AoA Rx", "bthci_evt.supported_switching_sample_rates.1us_switching_and_sampling_aoa_rx",
10651 FT_BOOLEAN, 8, NULL, 0x04,
10652 NULL, HFILL }
10654 { &hf_bthci_evt_supported_switching_sample_rates_reserved,
10655 { "Reserved", "bthci_evt.supported_switching_sample_rates.reserved",
10656 FT_UINT8, BASE_HEX, NULL, 0xF8,
10657 NULL, HFILL }
10659 { &hf_bthci_evt_simple_pairing_options,
10660 { "Simple Pairing Options", "bthci_evt.simple_pairing_options",
10661 FT_UINT8, BASE_HEX, NULL, 0x0,
10662 NULL, HFILL }
10664 { &hf_bthci_evt_simple_pairing_options_remote_public_key_validation,
10665 { "Remote Public Key Validation", "bthci_evt.simple_pairing_options.remote_public_key_validation",
10666 FT_BOOLEAN, 8, NULL, 0x01,
10667 NULL, HFILL }
10669 { &hf_bthci_evt_simple_pairing_options_reserved,
10670 { "Reserved", "bthci_evt.simple_pairing_options.reserved",
10671 FT_UINT8, BASE_HEX, NULL, 0xFE,
10672 NULL, HFILL }
10674 { &hf_bthci_evt_max_encryption_key_size,
10675 { "Max Encryption Key Size", "bthci_evt.max_encryption_key_size",
10676 FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&units_octet_octets), 0x0,
10677 NULL, HFILL }
10679 { &hf_bthci_evt_sdu_packet_seq_num,
10680 { "SDU Packet Sequence Number", "bthci_evt.sdu_packet_seq_num",
10681 FT_UINT16, BASE_DEC, NULL, 0x0,
10682 NULL, HFILL }
10684 { &hf_bthci_evt_sdu_packet_timestamp,
10685 { "SDU Packet Timestamp", "bthci_evt.sdu_packet_timestamp",
10686 FT_UINT32, BASE_DEC|BASE_UNIT_STRING, UNS(&units_microseconds), 0x0,
10687 NULL, HFILL }
10689 { &hf_bthci_evt_sdu_packet_offset,
10690 { "SDU Packet Offset", "bthci_evt.sdu_packet_offset",
10691 FT_UINT24, BASE_DEC|BASE_UNIT_STRING, UNS(&units_microseconds), 0x0,
10692 NULL, HFILL }
10694 { &hf_bthci_evt_cig_id,
10695 { "CIG Id", "bthci_evt.cig_id",
10696 FT_UINT8, BASE_HEX, NULL, 0x0,
10697 NULL, HFILL }
10699 { &hf_bthci_evt_cis_id,
10700 { "CIS Id", "bthci_evt.cis_id",
10701 FT_UINT8, BASE_HEX, NULL, 0x0,
10702 NULL, HFILL }
10704 { &hf_bthci_evt_cis_count,
10705 { "CIS Count", "bthci_evt.cis_count",
10706 FT_UINT8, BASE_DEC, NULL, 0x0,
10707 NULL, HFILL }
10709 { &hf_bthci_evt_cis_handle,
10710 { "CIS Handle", "bthci_evt.cis_handle",
10711 FT_UINT16, BASE_HEX, NULL, 0x0,
10712 NULL, HFILL }
10714 { &hf_bthci_evt_cis_bis_handle,
10715 { "CIS/BIS Handle", "bthci_evt.cis_bis_handle",
10716 FT_UINT16, BASE_HEX, NULL, 0x0,
10717 NULL, HFILL }
10719 { &hf_bthci_evt_big_handle,
10720 { "BIG Handle", "bthci_evt.big_handle",
10721 FT_UINT8, BASE_HEX, NULL, 0x0,
10722 NULL, HFILL }
10724 { &hf_bthci_evt_received_packet_counter,
10725 { "Received Packet Counter", "bthci_evt.received_packet_counter",
10726 FT_UINT32, BASE_DEC, NULL, 0x0,
10727 NULL, HFILL }
10729 { &hf_bthci_evt_missed_packet_counter,
10730 { "Missed Packet Counter", "bthci_evt.missed_packet_counter",
10731 FT_UINT32, BASE_DEC, NULL, 0x0,
10732 NULL, HFILL }
10734 { &hf_bthci_evt_failed_packet_counter,
10735 { "Failed Packet Counter", "bthci_evt.failed_packet_counter",
10736 FT_UINT32, BASE_DEC, NULL, 0x0,
10737 NULL, HFILL }
10739 { &hf_bthci_evt_pkt_count_tx_unacked,
10740 { "Tx UnACKed Packets", "bthci_evt.pkt_count_tx_unacked",
10741 FT_UINT32, BASE_DEC, NULL, 0x0,
10742 NULL, HFILL }
10744 { &hf_bthci_evt_pkt_count_tx_flushed,
10745 { "Tx Flushed Packets", "bthci_evt.pkt_count_tx_flushed",
10746 FT_UINT32, BASE_DEC, NULL, 0x0,
10747 NULL, HFILL }
10749 { &hf_bthci_evt_pkt_count_tx_last_subevent,
10750 { "Tx Last Subevent Packets", "bthci_evt.pkt_count_tx_last_subevent",
10751 FT_UINT32, BASE_DEC, NULL, 0x0,
10752 NULL, HFILL }
10754 { &hf_bthci_evt_pkt_count_tx_retransmitted,
10755 { "Tx Retransmitted Packets", "bthci_evt.pkt_count_tx_retransmitted",
10756 FT_UINT32, BASE_DEC, NULL, 0x0,
10757 NULL, HFILL }
10759 { &hf_bthci_evt_pkt_count_rx_crc_error,
10760 { "Rx CRC Error Packets", "bthci_evt.pkt_count_rx_crc_error",
10761 FT_UINT32, BASE_DEC, NULL, 0x0,
10762 NULL, HFILL }
10764 { &hf_bthci_evt_pkt_count_rx_unreceived,
10765 { "Rx Unreceived Packets", "bthci_evt.pkt_count_rx_unreceived",
10766 FT_UINT32, BASE_DEC, NULL, 0x0,
10767 NULL, HFILL }
10769 { &hf_bthci_evt_pkt_count_rx_duplicate,
10770 { "Rx Duplicate Packets", "bthci_evt.pkt_count_rx_duplicate",
10771 FT_UINT32, BASE_DEC, NULL, 0x0,
10772 NULL, HFILL }
10774 { &hf_bthci_evt_phy_and_coding,
10775 { "PHY", "bthci_evt.phy_and_coding",
10776 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_phy_and_coding_vals_ext, 0x0,
10777 NULL, HFILL }
10779 { &hf_bthci_evt_cig_sync_delay,
10780 { "CIG Sync Delay", "bthci_evt.cig_sync_delay",
10781 FT_UINT24, BASE_DEC|BASE_UNIT_STRING, UNS(&units_microseconds), 0x0,
10782 NULL, HFILL }
10784 { &hf_bthci_evt_big_sync_delay,
10785 { "BIG Sync Delay", "bthci_evt.big_sync_delay",
10786 FT_UINT24, BASE_DEC|BASE_UNIT_STRING, UNS(&units_microseconds), 0x0,
10787 NULL, HFILL }
10789 { &hf_bthci_evt_cis_sync_delay,
10790 { "CIS Sync Delay", "bthci_evt.cis_sync_delay",
10791 FT_UINT24, BASE_DEC|BASE_UNIT_STRING, UNS(&units_microseconds), 0x0,
10792 NULL, HFILL }
10794 { &hf_bthci_evt_transport_latency_c_to_p,
10795 { "Transport Latency Central to Peripheral", "bthci_evt.transport_latency_c_to_p",
10796 FT_UINT24, BASE_DEC|BASE_UNIT_STRING, UNS(&units_microseconds), 0x0,
10797 NULL, HFILL }
10799 { &hf_bthci_evt_transport_latency_p_to_c,
10800 { "Transport Latency Peripheral to Central", "bthci_evt.transport_latency_p_to_c",
10801 FT_UINT24, BASE_DEC|BASE_UNIT_STRING, UNS(&units_microseconds), 0x0,
10802 NULL, HFILL }
10804 { &hf_bthci_evt_big_transport_latency,
10805 { "BIG Transport Latency", "bthci_evt.big_transport_latency",
10806 FT_UINT24, BASE_DEC|BASE_UNIT_STRING, UNS(&units_microseconds), 0x0,
10807 NULL, HFILL }
10809 { &hf_bthci_evt_phy_c_to_p,
10810 { "PHY Central to Peripheral", "bthci_evt.phy_c_to_p",
10811 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_le_phy_vals_ext, 0x0,
10812 NULL, HFILL }
10814 { &hf_bthci_evt_phy_p_to_c,
10815 { "PHY Peripheral to Central", "bthci_evt.phy_p_to_c",
10816 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_le_phy_vals_ext, 0x0,
10817 NULL, HFILL }
10819 { &hf_bthci_evt_bn_c_to_p,
10820 { "Burst Number Central to Peripheral", "bthci_evt.bn_c_to_p",
10821 FT_UINT8, BASE_DEC, NULL, 0x0,
10822 NULL, HFILL }
10824 { &hf_bthci_evt_bn_p_to_c,
10825 { "Burst Number Peripheral to Central", "bthci_evt.bn_p_to_c",
10826 FT_UINT8, BASE_DEC, NULL, 0x0,
10827 NULL, HFILL }
10829 { &hf_bthci_evt_ft_c_to_p,
10830 { "Flush Timeout Central to Peripheral", "bthci_evt.ft_c_to_p",
10831 FT_UINT8, BASE_DEC, NULL, 0x0,
10832 NULL, HFILL }
10834 { &hf_bthci_evt_ft_p_to_c,
10835 { "Flush Timeout Peripheral to Central", "bthci_evt.ft_p_to_c",
10836 FT_UINT8, BASE_DEC, NULL, 0x0,
10837 NULL, HFILL }
10839 { &hf_bthci_evt_max_pdu_c_to_p,
10840 { "Max PDU Central to Peripheral", "bthci_evt.max_pdu_c_to_p",
10841 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_octet_octets), 0x0,
10842 NULL, HFILL }
10844 { &hf_bthci_evt_max_pdu_p_to_c,
10845 { "Max PDU Peripheral to Central", "bthci_evt.max_pdu_p_to_c",
10846 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_octet_octets), 0x0,
10847 NULL, HFILL }
10849 { &hf_bthci_evt_sub_interval,
10850 { "Sub-Interval", "bthci_evt.sub_interval",
10851 FT_UINT24, BASE_DEC|BASE_UNIT_STRING, UNS(&units_microseconds), 0x0,
10852 NULL, HFILL }
10854 { &hf_bthci_evt_max_sdu_c_to_p,
10855 { "Max SDU Central to Peripheral", "bthci_evt.max_sdu_c_to_p",
10856 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_octet_octets), 0x0,
10857 NULL, HFILL }
10859 { &hf_bthci_evt_max_sdu_p_to_c,
10860 { "Max SDU Peripheral to Central", "bthci_evt.max_sdu_p_to_c",
10861 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_octet_octets), 0x0,
10862 NULL, HFILL }
10864 { &hf_bthci_evt_sdu_interval_c_to_p,
10865 { "SDU Interval Central to Peripheral", "bthci_evt.sdu_interval_c_to_p",
10866 FT_UINT24, BASE_DEC|BASE_UNIT_STRING, UNS(&units_microseconds), 0x0,
10867 NULL, HFILL }
10869 { &hf_bthci_evt_sdu_interval_p_to_c,
10870 { "SDU Interval Peripheral to Central", "bthci_evt.sdu_interval_p_to_c",
10871 FT_UINT24, BASE_DEC|BASE_UNIT_STRING, UNS(&units_microseconds), 0x0,
10872 NULL, HFILL }
10874 { &hf_bthci_evt_phy,
10875 { "PHY", "bthci_evt.phy",
10876 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_le_phy_vals_ext, 0x0,
10877 NULL, HFILL }
10879 { &hf_bthci_evt_nse,
10880 { "Number of Sub-Events", "bthci_evt.nse",
10881 FT_UINT8, BASE_DEC, NULL, 0x0,
10882 NULL, HFILL }
10884 { &hf_bthci_evt_bn,
10885 { "Burst Number", "bthci_evt.bn",
10886 FT_UINT8, BASE_DEC, NULL, 0x0,
10887 NULL, HFILL }
10889 { &hf_bthci_evt_pto,
10890 { "Pre-Transmission Offset", "bthci_evt.pto",
10891 FT_UINT8, BASE_DEC, NULL, 0x0,
10892 NULL, HFILL }
10894 { &hf_bthci_evt_irc,
10895 { "Scheduled Payload Retransmissions", "bthci_evt.irc",
10896 FT_UINT8, BASE_DEC, NULL, 0x0,
10897 NULL, HFILL }
10899 { &hf_bthci_evt_max_pdu,
10900 { "Max PDU", "bthci_evt.max_pdu",
10901 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_octet_octets), 0x0,
10902 NULL, HFILL }
10904 { &hf_bthci_evt_iso_interval,
10905 { "ISO Interval", "bthci_evt.iso_interval",
10906 FT_UINT16, BASE_CUSTOM, CF_FUNC(bluetooth_unit_1p25_ms), 0x0,
10907 NULL, HFILL }
10909 { &hf_bthci_evt_num_bis,
10910 { "Number of BISes", "bthci_evt.num_bis",
10911 FT_UINT8, BASE_DEC, NULL, 0x0,
10912 NULL, HFILL }
10914 { &hf_bthci_evt_bis_handle,
10915 { "BIS Handle", "bthci_evt.bis_handle",
10916 FT_UINT16, BASE_HEX, NULL, 0x0,
10917 NULL, HFILL }
10919 { &hf_bthci_evt_current_path_loss,
10920 { "Current Path Loss", "bthci_evt.current_path_loss",
10921 FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&units_decibels), 0x0,
10922 NULL, HFILL }
10924 { &hf_bthci_evt_zone_entered,
10925 { "Zone Entered", "bthci_evt.zone_entered",
10926 FT_UINT8, BASE_HEX, VALS(zone_entered_vals), 0x0,
10927 NULL, HFILL }
10929 { &hf_bthci_evt_power_report_reason,
10930 { "Reason", "bthci_evt.power_report_reason",
10931 FT_UINT8, BASE_HEX, VALS(power_report_reason_vals), 0x0,
10932 NULL, HFILL }
10934 { &hf_bthci_evt_transmit_power_level_flags,
10935 { "Transmit Power Level Flags", "bthci_evt.power_level_flags",
10936 FT_UINT8, BASE_HEX, NULL, 0x0,
10937 NULL, HFILL }
10939 { &hf_bthci_evt_transmit_power_level_flags_minimum_power,
10940 { "At Minimum Power Level", "bthci_evt.transmit_power_level_flags.minimum_power",
10941 FT_BOOLEAN, 8, NULL, 0x01,
10942 NULL, HFILL }
10944 { &hf_bthci_evt_transmit_power_level_flags_maximum_power,
10945 { "At Maximum Power Level", "bthci_evt.transmit_power_level_flags.maximum_power",
10946 FT_BOOLEAN, 8, NULL, 0x02,
10947 NULL, HFILL }
10949 { &hf_bthci_evt_transmit_power_level_flags_reserved,
10950 { "Reserved", "bthci_evt.transmit_power_level_flags.reserved",
10951 FT_UINT8, BASE_HEX, NULL, 0xFC,
10952 NULL, HFILL }
10954 { &hf_bthci_evt_power_level_delta,
10955 { "Transmit Power Delta", "bthci_evt.power_level_delta",
10956 FT_INT8, BASE_DEC|BASE_UNIT_STRING, UNS(&units_decibels), 0x0,
10957 NULL, HFILL }
10959 { &hf_bthci_evt_sdu_interval,
10960 { "SDU Interval", "bthci_evt.sdu_interval",
10961 FT_UINT24, BASE_DEC|BASE_UNIT_STRING, UNS(&units_microseconds), 0x0,
10962 NULL, HFILL }
10964 { &hf_bthci_evt_max_sdu,
10965 { "Max SDU", "bthci_evt.max_sdu",
10966 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_octet_octets), 0x0,
10967 NULL, HFILL }
10969 { &hf_bthci_evt_framing,
10970 { "Framing", "bthci_evt.framing",
10971 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_framing_vals_ext, 0x0,
10972 NULL, HFILL }
10974 { &hf_bthci_evt_peer_clock_accuracy,
10975 { "Peer Clock Accuracy", "bthci_evt.peer_clock_accuracy",
10976 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_clock_accuray_vals_ext, 0x0,
10977 NULL, HFILL }
10979 { &hf_bthci_evt_subrate_factor,
10980 { "Subrate Factor", "bthci_evt.subrate_factor",
10981 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_number_events), 0x0,
10982 NULL, HFILL }
10984 { &hf_bthci_evt_continuation_number,
10985 { "Continuation Number", "bthci_evt.continuation_number",
10986 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_number_events), 0x0,
10987 NULL, HFILL }
10989 { &hf_bthci_evt_subevent_start,
10990 { "Sub-event Start", "bthci_evt.subevent_start",
10991 FT_UINT8, BASE_DEC, NULL, 0x0,
10992 NULL, HFILL }
10994 { &hf_bthci_evt_subevent_count,
10995 { "Sub-event Count", "bthci_evt.subevent_count",
10996 FT_UINT8, BASE_DEC, NULL, 0x0,
10997 NULL, HFILL }
10999 { &hf_bthci_evt_subevent,
11000 { "Sub-event", "bthci_evt.subevent",
11001 FT_UINT8, BASE_DEC, NULL, 0x0,
11002 NULL, HFILL }
11004 { &hf_bthci_evt_subevent_tx_status,
11005 { "Sub-event Tx Status", "bthci_evt.subevent_tx_status",
11006 FT_UINT8, BASE_HEX, VALS(tx_status_vals), 0x0,
11007 NULL, HFILL }
11009 { &hf_bthci_evt_subevent_responses,
11010 { "Sub-events Responses", "bthci_evt.subevent_responses",
11011 FT_NONE, BASE_NONE, NULL, 0x0,
11012 NULL, HFILL }
11014 { &hf_bthci_evt_response_slot,
11015 { "Response Slot", "bthci_evt.response_slot",
11016 FT_UINT8, BASE_DEC, NULL, 0x0,
11017 NULL, HFILL }
11019 { &hf_bthci_evt_num_subevents,
11020 { "Number of Sub-events", "bthci_evt.num_subevents",
11021 FT_UINT8, BASE_DEC, NULL, 0x0,
11022 NULL, HFILL }
11024 { &hf_bthci_evt_subevent_interval,
11025 { "Sub-event Interval", "bthci_evt.subevent_interval",
11026 FT_UINT8, BASE_CUSTOM, CF_FUNC(bluetooth_unit_1p25_ms), 0x0,
11027 NULL, HFILL }
11029 { &hf_bthci_evt_response_slot_delay,
11030 { "Response Slot Delay", "bthci_evt.resp_slot_delay",
11031 FT_UINT8, BASE_CUSTOM, CF_FUNC(bluetooth_unit_1p25_ms), 0x0,
11032 NULL, HFILL }
11034 { &hf_bthci_evt_response_slot_spacing,
11035 { "Response Slot Spacing", "bthci_evt.resp_slot_spacing",
11036 FT_UINT8, BASE_CUSTOM, CF_FUNC(bluetooth_unit_0p125_ms), 0x0,
11037 NULL, HFILL }
11039 { &hf_bthci_evt_periodic_event_counter,
11040 { "Periodic Event Counter", "bthci_evt.periodic_evt_counter",
11041 FT_UINT16, BASE_DEC, NULL, 0x0,
11042 NULL, HFILL }
11044 { &hf_bthci_evt_monitoring_adv_list_size,
11045 { "Monitoring Advertisers List Size", "bthci_evt.monitoring_adv_list_size",
11046 FT_UINT8, BASE_DEC, NULL, 0x0,
11047 NULL, HFILL }
11049 { &hf_bthci_evt_max_remote_page,
11050 { "Max Remote Page", "bthci_evt.max_remote_page",
11051 FT_UINT8, BASE_DEC, NULL, 0x0,
11052 NULL, HFILL }
11054 { &hf_bthci_evt_max_valid_page,
11055 { "Max Valid Page", "bthci_evt.max_valid_page",
11056 FT_UINT8, BASE_DEC, NULL, 0x0,
11057 NULL, HFILL }
11059 { &hf_bthci_evt_config_id,
11060 { "Config Id", "bthci_evt.config_id",
11061 FT_UINT8, BASE_DEC, NULL, 0x0,
11062 NULL, HFILL }
11064 { &hf_bthci_evt_num_config,
11065 { "Number of Configurations", "bthci_evt.num_config",
11066 FT_UINT8, BASE_DEC, NULL, 0x0,
11067 NULL, HFILL }
11069 { &hf_bthci_evt_max_consecutive_procedures,
11070 { "Max Consecutive Procedures", "bthci_evt.max_consecutive_procedures",
11071 FT_UINT16, BASE_DEC|BASE_SPECIAL_VALS, VALS(bluetooth_procedure_count_special), 0x0,
11072 NULL, HFILL }
11074 { &hf_bthci_evt_remote_fae_table,
11075 {"Channel Map", "bthci_evt.remote_fae_table",
11076 FT_BYTES, BASE_NONE, NULL, 0x0,
11077 NULL, HFILL}
11079 { &hf_bthci_evt_channel_map,
11080 {"Channel Map", "bthci_evt.channel_map",
11081 FT_BYTES, BASE_NONE, NULL, 0x0,
11082 NULL, HFILL}
11084 { &hf_bthci_evt_cs_action,
11085 { "Action", "bthci_evt.cs_action",
11086 FT_UINT8, BASE_HEX, VALS(cs_action_vals), 0x0,
11087 NULL, HFILL }
11089 { &hf_bthci_evt_main_mode_type,
11090 { "Main Mode Type", "bthci_evt.main_mode_type",
11091 FT_UINT8, BASE_DEC, NULL, 0x0,
11092 NULL, HFILL }
11094 { &hf_bthci_evt_sub_mode_type,
11095 { "Sub Mode Type", "bthci_evt.sub_mode_type",
11096 FT_UINT8, BASE_DEC|BASE_SPECIAL_VALS, VALS(bluetooth_not_used_0xff_special), 0x0,
11097 NULL, HFILL }
11099 { &hf_bthci_evt_min_main_mode_steps,
11100 { "Min Main Mode Steps", "bthci_evt.min_main_mode_steps",
11101 FT_UINT8, BASE_DEC, NULL, 0x0,
11102 NULL, HFILL }
11104 { &hf_bthci_evt_max_main_mode_steps,
11105 { "Max Main Mode Steps", "bthci_evt.max_main_mode_steps",
11106 FT_UINT8, BASE_DEC, NULL, 0x0,
11107 NULL, HFILL }
11109 { &hf_bthci_evt_main_mode_repetition,
11110 { "Main Mode Repetitions", "bthci_evt.main_mode_repetition",
11111 FT_UINT8, BASE_DEC, NULL, 0x0,
11112 NULL, HFILL }
11114 { &hf_bthci_evt_mode_0_steps,
11115 { "Mode-0 Steps", "bthci_evt.mode0_steps",
11116 FT_UINT8, BASE_DEC, NULL, 0x0,
11117 NULL, HFILL }
11119 { &hf_bthci_evt_cs_role,
11120 { "Role", "bthci_evt.cs_role",
11121 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_cs_role_vals_ext, 0x0,
11122 NULL, HFILL }
11124 { &hf_bthci_evt_rtt_type,
11125 { "RTT Type", "bthci_evt.rtt_type",
11126 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_cs_rtt_type_vals_ext, 0x0,
11127 NULL, HFILL }
11129 { &hf_bthci_evt_cs_sync_phy,
11130 { "CS Sync PHY", "bthci_evt.cs_sync_phy",
11131 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_le_phy_vals_ext, 0x0,
11132 NULL, HFILL }
11134 { &hf_bthci_evt_channel_map_repetition,
11135 { "Channel Map Repetitions", "bthci_evt.channel_map_repetition",
11136 FT_UINT8, BASE_DEC, NULL, 0x0,
11137 NULL, HFILL }
11139 { &hf_bthci_evt_channel_selection_type,
11140 { "Channel Selection Type", "bthci_evt.channel_selection_type",
11141 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_cs_ch_selection_type_vals_ext, 0x0,
11142 NULL, HFILL }
11144 { &hf_bthci_evt_ch3c_shape,
11145 { "Ch3c Shape", "bthci_evt.ch3c_shape",
11146 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_cs_shape_vals_ext, 0x0,
11147 NULL, HFILL }
11149 { &hf_bthci_evt_ch3c_jump,
11150 { "Ch3c Jump", "bthci_evt.ch3c_jump",
11151 FT_UINT8, BASE_DEC, NULL, 0x0,
11152 NULL, HFILL }
11154 { &hf_bthci_evt_companion_signal_enable,
11155 { "Companion Signal Enable", "bthci_evt.companion_signal_enable",
11156 FT_UINT8, BASE_HEX, VALS(evt_enable_values), 0x0,
11157 NULL, HFILL }
11159 { &hf_bthci_evt_t_ip1_time,
11160 { "T_IP1 Time", "bthci_evt.t_ip1_time",
11161 FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&units_microseconds), 0x0,
11162 NULL, HFILL }
11164 { &hf_bthci_evt_t_ip2_time,
11165 { "T_IP2 Time", "bthci_evt.t_ip2_time",
11166 FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&units_microseconds), 0x0,
11167 NULL, HFILL }
11169 { &hf_bthci_evt_t_fcs_time,
11170 { "T_FCS Time", "bthci_evt.t_fcs_time",
11171 FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&units_microseconds), 0x0,
11172 NULL, HFILL }
11174 { &hf_bthci_evt_t_pm_time,
11175 { "T_PM Time", "bthci_evt.t_pm_time",
11176 FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&units_microseconds), 0x0,
11177 NULL, HFILL }
11179 { &hf_bthci_evt_cs_state,
11180 { "State", "bthci_evt.cs_state",
11181 FT_UINT8, BASE_HEX, VALS(evt_enable_values), 0x0,
11182 NULL, HFILL }
11184 { &hf_bthci_evt_tone_antenna_selection,
11185 { "Antenna Config Selection Index", "bthci_evt.tone_antenna_selection",
11186 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_aci_vals_ext, 0x0,
11187 NULL, HFILL }
11189 { &hf_bthci_evt_cs_subevent_len,
11190 { "Subevent Length", "bthci_evt.cs_subevent_len",
11191 FT_UINT24, BASE_DEC|BASE_UNIT_STRING, UNS(&units_microseconds), 0x0,
11192 NULL, HFILL }
11194 { &hf_bthci_evt_cs_subevents_per_event,
11195 { "Subevents Per Event", "bthci_evt.subevents_per_event",
11196 FT_UINT8, BASE_DEC, NULL, 0x0,
11197 NULL, HFILL }
11199 { &hf_bthci_evt_cs_subevent_interval,
11200 { "Subevent Interval", "bthci_evt.cs_subevent_interval",
11201 FT_UINT16, BASE_CUSTOM, CF_FUNC(bluetooth_unit_0p625_ms), 0x0,
11202 NULL, HFILL }
11204 { &hf_bthci_evt_cs_event_interval,
11205 { "Event Interval", "bthci_evt.cs_event_interval",
11206 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_number_events), 0x0,
11207 NULL, HFILL }
11209 { &hf_bthci_evt_cs_procedure_interval,
11210 { "Procedure Interval", "bthci_evt.cs_procedure_interval",
11211 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_number_events), 0x0,
11212 NULL, HFILL }
11214 { &hf_bthci_evt_cs_procedure_count,
11215 { "Procedure Count", "bthci_evt.cs_procedure_count",
11216 FT_UINT16, BASE_DEC|BASE_SPECIAL_VALS, VALS(bluetooth_procedure_count_special), 0x0,
11217 NULL, HFILL }
11219 { &hf_bthci_evt_max_procedure_len,
11220 { "Max Procedure Length", "bthci_evt.max_procedure_len",
11221 FT_UINT16, BASE_CUSTOM, CF_FUNC(bluetooth_unit_0p625_ms), 0x0,
11222 NULL, HFILL }
11224 { &hf_bthci_evt_start_acl_conn_event,
11225 { "Start ACL Connection Event", "bthci_evt.start_acl_conn_event",
11226 FT_UINT16, BASE_DEC, NULL, 0x0,
11227 NULL, HFILL }
11229 { &hf_bthci_evt_procedure_counter,
11230 { "Procedure Counter", "bthci_evt.procedure_counter",
11231 FT_UINT16, BASE_DEC, NULL, 0x0,
11232 NULL, HFILL }
11234 { &hf_bthci_evt_freq_compensation,
11235 { "Frequency Compensation", "bthci_evt.freq_compensation",
11236 FT_INT16, BASE_CUSTOM, CF_FUNC(freq_compensation), 0x0,
11237 NULL, HFILL }
11239 { &hf_bthci_evt_ref_power_level,
11240 { "Reference Power Level", "bthci_evt.ref_power_level",
11241 FT_INT8, BASE_CUSTOM, CF_FUNC(ref_power_level), 0x0,
11242 NULL, HFILL }
11244 { &hf_bthci_evt_procedure_done_status,
11245 { "Procedure Done Status", "bthci_evt.procedure_done_status",
11246 FT_UINT8, BASE_HEX, VALS(cs_done_status_vals), 0x0,
11247 NULL, HFILL }
11249 { &hf_bthci_evt_subevent_done_status,
11250 { "Subevent Done Status", "bthci_evt.subevent_done_status",
11251 FT_UINT8, BASE_HEX, VALS(cs_done_status_vals), 0x0,
11252 NULL, HFILL }
11254 { &hf_bthci_evt_cs_abort_reason,
11255 { "Procedure Abort Reason", "bthci_evt.cs_abort_reason",
11256 FT_UINT8, BASE_HEX, NULL, 0x0,
11257 NULL, HFILL }
11259 { &hf_bthci_evt_cs_abort_reason_procedure,
11260 { "Procedure Abort Reason", "bthci_evt.cs_abort_reason_procedure",
11261 FT_UINT8, BASE_HEX, VALS(cs_procedure_abort_reason_vals), 0x0F,
11262 NULL, HFILL }
11264 { &hf_bthci_evt_cs_abort_reason_subevent,
11265 { "Subevent Abort Reason", "bthci_evt.cs_abort_reason_subevent",
11266 FT_UINT8, BASE_HEX, VALS(cs_subevent_abort_reason_vals), 0xF0,
11267 NULL, HFILL }
11269 { &hf_bthci_evt_num_antenna_paths,
11270 { "Number of Antenna Paths", "bthci_evt.num_antenna_paths",
11271 FT_UINT8, BASE_DEC, NULL, 0x0,
11272 NULL, HFILL }
11274 { &hf_bthci_evt_cs_roles,
11275 { "Roles", "bthci_evt.cs_roles",
11276 FT_UINT8, BASE_HEX, NULL, 0x0,
11277 NULL, HFILL }
11279 { &hf_bthci_evt_cs_roles_initiator,
11280 { "Initiator", "bthci_evt.cs_roles.initiator",
11281 FT_BOOLEAN, 8, NULL, 0x01,
11282 NULL, HFILL }
11284 { &hf_bthci_evt_cs_roles_reflector,
11285 { "Reflector", "bthci_evt.cs_roles.reflector",
11286 FT_BOOLEAN, 8, NULL, 0x02,
11287 NULL, HFILL }
11289 { &hf_bthci_evt_cs_roles_reserved,
11290 { "Reserved", "bthci_evt.cs_roles.reserved",
11291 FT_UINT8, BASE_HEX, NULL, 0xfc,
11292 NULL, HFILL }
11294 { &hf_bthci_evt_cs_modes_supported,
11295 { "Modes Supported", "bthci_evt.cs_modes_supported",
11296 FT_UINT8, BASE_HEX, NULL, 0x0,
11297 NULL, HFILL }
11299 { &hf_bthci_evt_cs_modes_supported_3,
11300 { "Mode-3", "bthci_evt.cs_modes_supported.3",
11301 FT_BOOLEAN, 8, NULL, 0x01,
11302 NULL, HFILL }
11304 { &hf_bthci_evt_cs_modes_supported_reserved,
11305 { "Reserved", "bthci_evt.cs_modes_supported.reserved",
11306 FT_UINT8, BASE_HEX, NULL, 0xfe,
11307 NULL, HFILL }
11309 { &hf_bthci_evt_rtt_capability,
11310 { "RTT Capability", "bthci_evt.rtt_capability",
11311 FT_UINT8, BASE_HEX, NULL, 0x0,
11312 NULL, HFILL }
11314 { &hf_bthci_evt_rtt_capability_coarse_precision,
11315 { "10ns Coarse Precision", "bthci_evt.rtt_capability.coarse_precision",
11316 FT_BOOLEAN, 8, NULL, 0x01,
11317 NULL, HFILL }
11319 { &hf_bthci_evt_rtt_capability_sounding_precision,
11320 { "10ns Sounding Precision", "bthci_evt.rtt_capability.sounding_precision",
11321 FT_BOOLEAN, 8, NULL, 0x02,
11322 NULL, HFILL }
11324 { &hf_bthci_evt_rtt_capability_random_precision,
11325 { "10ns Random Precision", "bthci_evt.rtt_capability.random_precision",
11326 FT_BOOLEAN, 8, NULL, 0x04,
11327 NULL, HFILL }
11329 { &hf_bthci_evt_rtt_capability_reserved,
11330 { "Reserved", "bthci_evt.rtt_capability.reserved",
11331 FT_UINT8, BASE_HEX, NULL, 0xf8,
11332 NULL, HFILL }
11334 { &hf_bthci_evt_rtt_aa_only_n,
11335 { "RTT Coarse, CS Sync exchanges needed", "bthci_evt.rtt_aa_only_n",
11336 FT_UINT8, BASE_DEC|BASE_SPECIAL_VALS, VALS(bluetooth_not_supported_0x00_special), 0x0,
11337 NULL, HFILL }
11339 { &hf_bthci_evt_rtt_sounding_n,
11340 { "RTT Sounding, CS Sync exchanges needed", "bthci_evt.rtt_sounding_n",
11341 FT_UINT8, BASE_DEC|BASE_SPECIAL_VALS, VALS(bluetooth_not_supported_0x00_special), 0x0,
11342 NULL, HFILL }
11344 { &hf_bthci_evt_rtt_random_n,
11345 { "RTT Random Payload, CS Sync exchanges needed", "bthci_evt.rtt_random_n",
11346 FT_UINT8, BASE_DEC|BASE_SPECIAL_VALS, VALS(bluetooth_not_supported_0x00_special), 0x0,
11347 NULL, HFILL }
11349 { &hf_bthci_evt_nadm_sounding_capability,
11350 { "Optional NADM Sounding Capability", "bthci_evt.optional_nadm_sounding_capability",
11351 FT_UINT16, BASE_HEX, NULL, 0x0,
11352 NULL, HFILL }
11354 { &hf_bthci_evt_nadm_sounding_capability_supported,
11355 { "Phase-based NADM Metric", "bthci_evt.optional_nadm_sounding_capability.supported",
11356 FT_BOOLEAN, 16, NULL, 0x0001,
11357 NULL, HFILL }
11359 { &hf_bthci_evt_nadm_sounding_capability_reserved,
11360 { "Reserved", "bthci_evt.optional_nadm_sounding_capability.reserved",
11361 FT_UINT16, BASE_HEX, NULL, 0xfffe,
11362 NULL, HFILL }
11364 { &hf_bthci_evt_nadm_random_capability,
11365 { "Optional NADM Random Capability", "bthci_evt.optional_nadm_random_capability",
11366 FT_UINT16, BASE_HEX, NULL, 0x0,
11367 NULL, HFILL }
11369 { &hf_bthci_evt_nadm_random_capability_supported,
11370 { "Phase-based NADM Metric", "bthci_evt.optional_nadm_random_capability.supported",
11371 FT_BOOLEAN, 16, NULL, 0x0001,
11372 NULL, HFILL }
11374 { &hf_bthci_evt_nadm_random_capability_reserved,
11375 { "Reserved", "bthci_evt.optional_nadm_random_capability.reserved",
11376 FT_BOOLEAN, 16, NULL, 0xfffe,
11377 NULL, HFILL }
11379 { &hf_bthci_evt_cs_sync_phys_supported,
11380 { "Optional CS_SYNC PHYs", "bthci_evt.cs_sync_phys_supported",
11381 FT_UINT8, BASE_HEX, NULL, 0x0,
11382 NULL, HFILL }
11384 { &hf_bthci_evt_cs_sync_phys_supported_2m,
11385 { "LE 2M", "bthci_evt.cs_sync_phys_supported.2m",
11386 FT_BOOLEAN, 8, NULL, 0x02,
11387 NULL, HFILL }
11389 { &hf_bthci_evt_cs_sync_phys_supported_2m2bt,
11390 { "LE 2M 2BT", "bthci_evt.cs_sync_phys_supported.2m2bt",
11391 FT_BOOLEAN, 8, NULL, 0x04,
11392 NULL, HFILL }
11394 { &hf_bthci_evt_cs_sync_phys_supported_reserved,
11395 { "Reserved", "bthci_evt.cs_sync_phys_supported.reserved",
11396 FT_UINT8, BASE_HEX, NULL, 0xf9,
11397 NULL, HFILL }
11399 { &hf_bthci_evt_cs_subfeatures,
11400 { "Optional Subfeatures", "bthci_evt.optional_cs_subfeatures",
11401 FT_UINT16, BASE_HEX, NULL, 0x0,
11402 NULL, HFILL }
11404 { &hf_bthci_evt_cs_subfeatures_companion_signal,
11405 { "Companion Signal", "bthci_evt.optional_cs_subfeatures.companion_signal",
11406 FT_BOOLEAN, 16, NULL, 0x0001,
11407 NULL, HFILL }
11409 { &hf_bthci_evt_cs_subfeatures_freq_actuation_error,
11410 { "Zero Freq. Actuation Error Relative to Mode-0 Tx in Reflector", "bthci_evt.optional_cs_subfeatures.freq_actuation_error",
11411 FT_BOOLEAN, 16, NULL, 0x0002,
11412 NULL, HFILL }
11414 { &hf_bthci_evt_cs_subfeatures_channel_selection_3c,
11415 { "Channel Selection Algorithm #3c", "bthci_evt.optional_cs_subfeatures.channel_selection_3c",
11416 FT_BOOLEAN, 16, NULL, 0x0004,
11417 NULL, HFILL }
11419 { &hf_bthci_evt_cs_subfeatures_pbr_from_rtt,
11420 { "Phase-based Ranging from RTT sounding sequence", "bthci_evt.optional_cs_subfeatures.pbr_from_rtt",
11421 FT_BOOLEAN, 16, NULL, 0x0008,
11422 NULL, HFILL }
11424 { &hf_bthci_evt_cs_subfeatures_reserved,
11425 { "Reserved", "bthci_evt.optional_cs_subfeatures.reserved",
11426 FT_UINT16, BASE_HEX, NULL, 0xfff0,
11427 NULL, HFILL }
11429 { &hf_bthci_evt_tip1_times_supported,
11430 { "T_IP1 Times Supported", "bthci_evt.tip1_times_supported",
11431 FT_UINT16, BASE_HEX, NULL, 0x0,
11432 NULL, HFILL }
11434 { &hf_bthci_evt_tip2_times_supported,
11435 { "T_IP2 Times Supported", "bthci_evt.tip2_times_supported",
11436 FT_UINT16, BASE_HEX, NULL, 0x0,
11437 NULL, HFILL }
11439 { &hf_bthci_evt_tip_times_supported_10us,
11440 { "10 microseconds", "bthci_evt.tip_times_supported_10us",
11441 FT_BOOLEAN, 16, NULL, 0x0001,
11442 NULL, HFILL }
11444 { &hf_bthci_evt_tip_times_supported_20us,
11445 { "20 microseconds", "bthci_evt.tip_times_supported_20us",
11446 FT_BOOLEAN, 16, NULL, 0x0002,
11447 NULL, HFILL }
11449 { &hf_bthci_evt_tip_times_supported_30us,
11450 { "30 microseconds", "bthci_evt.tip_times_supported_30us",
11451 FT_BOOLEAN, 16, NULL, 0x0004,
11452 NULL, HFILL }
11454 { &hf_bthci_evt_tip_times_supported_40us,
11455 { "40 microseconds", "bthci_evt.tip_times_supported_40us",
11456 FT_BOOLEAN, 16, NULL, 0x0008,
11457 NULL, HFILL }
11459 { &hf_bthci_evt_tip_times_supported_50us,
11460 { "50 microseconds", "bthci_evt.tip_times_supported_50us",
11461 FT_BOOLEAN, 16, NULL, 0x0010,
11462 NULL, HFILL }
11464 { &hf_bthci_evt_tip_times_supported_60us,
11465 { "60 microseconds", "bthci_evt.tip_times_supported_60us",
11466 FT_BOOLEAN, 16, NULL, 0x0020,
11467 NULL, HFILL }
11469 { &hf_bthci_evt_tip_times_supported_80us,
11470 { "80 microseconds", "bthci_evt.tip_times_supported_80us",
11471 FT_BOOLEAN, 16, NULL, 0x0040,
11472 NULL, HFILL }
11474 { &hf_bthci_evt_tip_times_supported_reserved,
11475 { "Reserved", "bthci_evt.tip_times_supported_reserved",
11476 FT_UINT16, BASE_HEX, NULL, 0xff80,
11477 NULL, HFILL }
11479 { &hf_bthci_evt_tfcs_times_supported,
11480 { "T_FCS Times Supported", "bthci_evt.tfcs_times_supported",
11481 FT_UINT16, BASE_HEX, NULL, 0x0,
11482 NULL, HFILL }
11484 { &hf_bthci_evt_tfcs_times_supported_15us,
11485 { "15 microseconds", "bthci_evt.tfcs_times_supported_15us",
11486 FT_BOOLEAN, 16, NULL, 0x0001,
11487 NULL, HFILL }
11489 { &hf_bthci_evt_tfcs_times_supported_20us,
11490 { "20 microseconds", "bthci_evt.tfcs_times_supported_20us",
11491 FT_BOOLEAN, 16, NULL, 0x0002,
11492 NULL, HFILL }
11494 { &hf_bthci_evt_tfcs_times_supported_30us,
11495 { "30 microseconds", "bthci_evt.tfcs_times_supported_30us",
11496 FT_BOOLEAN, 16, NULL, 0x0004,
11497 NULL, HFILL }
11499 { &hf_bthci_evt_tfcs_times_supported_40us,
11500 { "40 microseconds", "bthci_evt.tfcs_times_supported_40us",
11501 FT_BOOLEAN, 16, NULL, 0x0008,
11502 NULL, HFILL }
11504 { &hf_bthci_evt_tfcs_times_supported_50us,
11505 { "50 microseconds", "bthci_evt.tfcs_times_supported_50us",
11506 FT_BOOLEAN, 16, NULL, 0x0010,
11507 NULL, HFILL }
11509 { &hf_bthci_evt_tfcs_times_supported_60us,
11510 { "60 microseconds", "bthci_evt.tfcs_times_supported_60us",
11511 FT_BOOLEAN, 16, NULL, 0x0020,
11512 NULL, HFILL }
11514 { &hf_bthci_evt_tfcs_times_supported_80us,
11515 { "80 microseconds", "bthci_evt.tfcs_times_supported_80us",
11516 FT_BOOLEAN, 16, NULL, 0x0040,
11517 NULL, HFILL }
11519 { &hf_bthci_evt_tfcs_times_supported_100us,
11520 { "100 microseconds", "bthci_evt.tfcs_times_supported_100us",
11521 FT_BOOLEAN, 16, NULL, 0x0080,
11522 NULL, HFILL }
11524 { &hf_bthci_evt_tfcs_times_supported_120us,
11525 { "120 microseconds", "bthci_evt.tfcs_times_supported_120us",
11526 FT_BOOLEAN, 16, NULL, 0x0100,
11527 NULL, HFILL }
11529 { &hf_bthci_evt_tfcs_times_supported_reserved,
11530 { "Reserved", "bthci_evt.tfcs_times_supported_reserved",
11531 FT_UINT16, BASE_HEX, NULL, 0xfe00,
11532 NULL, HFILL }
11534 { &hf_bthci_evt_tpm_times_supported,
11535 { "T_PM Times Supported", "bthci_evt.tpm_times_supported",
11536 FT_UINT16, BASE_HEX, NULL, 0x0,
11537 NULL, HFILL }
11539 { &hf_bthci_evt_tpm_times_supported_10us,
11540 { "10 microseconds", "bthci_evt.tpm_times_supported_10us",
11541 FT_BOOLEAN, 16, NULL, 0x0001,
11542 NULL, HFILL }
11544 { &hf_bthci_evt_tpm_times_supported_20us,
11545 { "20 microseconds", "bthci_evt.tpm_times_supported_20us",
11546 FT_BOOLEAN, 16, NULL, 0x0002,
11547 NULL, HFILL }
11549 { &hf_bthci_evt_tpm_times_supported_reserved,
11550 { "Reserved", "bthci_evt.tpm_times_supported_reserved",
11551 FT_UINT16, BASE_HEX, NULL, 0xfffc,
11552 NULL, HFILL }
11554 { &hf_bthci_evt_tsw_time_supported,
11555 { "T_SW Time Supported", "bthci_evt.tsw_time_supported",
11556 FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&units_microseconds), 0x0,
11557 NULL, HFILL }
11559 { &hf_bthci_evt_tx_snr_capability,
11560 { "Tx SNR Capability", "bthci_evt.tx_snr_capability",
11561 FT_UINT8, BASE_HEX, NULL, 0x0,
11562 NULL, HFILL }
11564 { &hf_bthci_evt_tx_snr_capability_18dB,
11565 { "18 dB", "bthci_evt.tx_snr_capability_18dB",
11566 FT_BOOLEAN, 8, NULL, 0x01,
11567 NULL, HFILL }
11569 { &hf_bthci_evt_tx_snr_capability_21dB,
11570 { "21 dB", "bthci_evt.tx_snr_capability_21dB",
11571 FT_BOOLEAN, 8, NULL, 0x02,
11572 NULL, HFILL }
11574 { &hf_bthci_evt_tx_snr_capability_24dB,
11575 { "24 dB", "bthci_evt.tx_snr_capability_24dB",
11576 FT_BOOLEAN, 8, NULL, 0x04,
11577 NULL, HFILL }
11579 { &hf_bthci_evt_tx_snr_capability_27dB,
11580 { "27 dB", "bthci_evt.tx_snr_capability_27dB",
11581 FT_BOOLEAN, 8, NULL, 0x08,
11582 NULL, HFILL }
11584 { &hf_bthci_evt_tx_snr_capability_30dB,
11585 { "30 dB", "bthci_evt.tx_snr_capability_30dB",
11586 FT_BOOLEAN, 8, NULL, 0x10,
11587 NULL, HFILL }
11589 { &hf_bthci_evt_tx_snr_capability_reserved,
11590 { "Reserved", "bthci_evt.tx_snr_capability_reserved",
11591 FT_UINT8, BASE_HEX, NULL, 0xe0,
11592 NULL, HFILL }
11594 { &hf_bthci_evt_num_steps_reported,
11595 { "Steps Reported", "bthci_evt.num_steps_reported",
11596 FT_UINT8, BASE_DEC, NULL, 0x0,
11597 NULL, HFILL }
11599 { &hf_bthci_evt_cs_step,
11600 { "Step", "bthci_evt.cs_step",
11601 FT_STRING, BASE_NONE, NULL, 0x0,
11602 NULL, HFILL }
11604 { &hf_bthci_evt_step_mode,
11605 { "Mode", "bthci_evt.step_mode",
11606 FT_UINT8, BASE_DEC, NULL, 0x0,
11607 NULL, HFILL }
11609 { &hf_bthci_evt_step_channel,
11610 { "Channel", "bthci_evt.step_channel",
11611 FT_UINT8, BASE_DEC, NULL, 0x0,
11612 NULL, HFILL }
11614 { &hf_bthci_evt_step_data_length,
11615 { "Data Length", "bthci_evt.step_data_length",
11616 FT_UINT8, BASE_DEC, NULL, 0x0,
11617 NULL, HFILL }
11619 { &hf_bthci_evt_packet_quality,
11620 { "Packet Quality", "bthci_evt.packet_quality",
11621 FT_UINT8, BASE_HEX, NULL, 0x0,
11622 NULL, HFILL }
11624 { &hf_bthci_evt_packet_quality_aa_check,
11625 { "Access Address Check", "bthci_evt.packet_quality.aa_check",
11626 FT_UINT8, BASE_HEX, VALS(access_address_check_vals), 0x0f,
11627 NULL, HFILL }
11629 { &hf_bthci_evt_packet_quality_bit_errors,
11630 { "Bit Errors in Sounding/Random Sequence", "bthci_evt.packet_quality.bit_errors",
11631 FT_UINT8, BASE_DEC, NULL, 0xf0,
11632 NULL, HFILL }
11634 { &hf_bthci_evt_measured_freq_offset,
11635 { "Measured Frequency Offset", "bthci_evt.measured_freq_offset",
11636 FT_INT16, BASE_CUSTOM, CF_FUNC(freq_compensation), 0x0,
11637 NULL, HFILL }
11639 { &hf_bthci_evt_nadm_attack_chance,
11640 { "NADM Attack Chance", "bthci_evt.nadm_attack_chance",
11641 FT_UINT8, BASE_HEX, VALS(nadm_attack_chance_vals), 0x0,
11642 NULL, HFILL }
11644 { &hf_bthci_evt_toa_tod_initiator,
11645 { "ToA-ToD Time, Initiator", "bthci_evt.toa_tod_initiator",
11646 FT_UINT16, BASE_CUSTOM, CF_FUNC(convert_time_unit_0p5_ns), 0x0,
11647 NULL, HFILL }
11649 { &hf_bthci_evt_tod_toa_reflector,
11650 { "ToD-ToA Time, Reflector", "bthci_evt.tod_toa_reflector",
11651 FT_UINT16, BASE_CUSTOM, CF_FUNC(convert_time_unit_0p5_ns), 0x0,
11652 NULL, HFILL }
11654 { &hf_bthci_evt_pct1,
11655 { "PCT1", "bthci_evt.pct1",
11656 FT_STRING, BASE_NONE, NULL, 0x0,
11657 NULL, HFILL }
11659 { &hf_bthci_evt_pct2,
11660 { "PCT2", "bthci_evt.pct2",
11661 FT_STRING, BASE_NONE, NULL, 0x0,
11662 NULL, HFILL }
11664 { &hf_bthci_evt_pct_not_available,
11665 { "PCT Not Available", "bthci_evt.pct_not_available",
11666 FT_UINT32, BASE_HEX, NULL, 0x0,
11667 NULL, HFILL }
11669 { &hf_bthci_evt_tone_pct,
11670 { "Tone PCT", "bthci_evt.tone_pct",
11671 FT_STRING, BASE_NONE, NULL, 0x0,
11672 NULL, HFILL }
11674 { &hf_bthci_evt_pct_i_sample,
11675 { "I Sample", "bthci_evt.pct_i_sample",
11676 FT_UINT24, BASE_CUSTOM, CF_FUNC(sint12_convert), 0x000FFF,
11677 NULL, HFILL }
11679 { &hf_bthci_evt_pct_q_sample,
11680 { "Q Sample", "bthci_evt.pct_q_sample",
11681 FT_UINT24, BASE_CUSTOM, CF_FUNC(sint12_convert), 0xFFF000,
11682 NULL, HFILL }
11684 { &hf_bthci_evt_antenna_permutation_index,
11685 { "Antenna Permutation Index", "bthci_evt.antenna_permutation_index",
11686 FT_UINT8, BASE_DEC, NULL, 0x0,
11687 NULL, HFILL }
11689 { &hf_bthci_evt_tone_quality,
11690 { "Tone Quality", "bthci_evt.tone_quality",
11691 FT_UINT8, BASE_HEX, VALS(tone_quality_vals), 0x0F,
11692 NULL, HFILL }
11694 { &hf_bthci_evt_tone_extension_presence,
11695 { "Tone Extension", "bthci_evt.tone_extension_presence",
11696 FT_UINT8, BASE_HEX, VALS(tone_ext_presence_vals), 0xF0,
11697 NULL, HFILL }
11699 { &hf_bthci_evt_cs_tone,
11700 { "Tone", "bthci_evt.cs_tone",
11701 FT_STRING, BASE_NONE, NULL, 0x0,
11702 NULL, HFILL }
11704 { &hf_bthci_evt_monitoring_condition,
11705 { "Condition", "bthci_evt.monitoring_condition",
11706 FT_UINT8, BASE_HEX, VALS(monitoring_condition_vals), 0x0,
11707 NULL, HFILL }
11709 { &hf_bthci_evt_initiator,
11710 { "Initiator", "bthci_evt.initiator",
11711 FT_UINT8, BASE_HEX, VALS(initiator_vals), 0x0,
11712 NULL, HFILL }
11714 { &hf_bthci_evt_frame_space,
11715 { "Frame Space", "bthci_evt.frame_space",
11716 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_microseconds), 0x0,
11717 NULL, HFILL }
11719 { &hf_bthci_evt_spacing_types,
11720 { "Spacing Types", "bthci_evt.spacing_types",
11721 FT_UINT16, BASE_HEX, NULL, 0x0,
11722 NULL, HFILL }
11724 { &hf_bthci_evt_spacing_types_tifs_acl_cp,
11725 { "T_IFS_ACL_CP", "bthci_evt.spacing_types.tifs_acl_cp",
11726 FT_BOOLEAN, 16, NULL, 0x0001,
11727 NULL, HFILL }
11729 { &hf_bthci_evt_spacing_types_tifs_acl_pc,
11730 { "T_IFS_ACL_PC", "bthci_evt.spacing_types.tifs_acl_pc",
11731 FT_BOOLEAN, 16, NULL, 0x0002,
11732 NULL, HFILL }
11734 { &hf_bthci_evt_spacing_types_tmces,
11735 { "T_MCES", "bthci_evt.spacing_types.tmces",
11736 FT_BOOLEAN, 16, NULL, 0x0004,
11737 NULL, HFILL }
11739 { &hf_bthci_evt_spacing_types_tifs_cis,
11740 { "T_IFS_CIS", "bthci_evt.spacing_types.tifs_cis",
11741 FT_BOOLEAN, 16, NULL, 0x0008,
11742 NULL, HFILL }
11744 { &hf_bthci_evt_spacing_types_tmss_cis,
11745 { "T_MSS_CIS", "bthci_evt.spacing_types.tmss_cis",
11746 FT_BOOLEAN, 16, NULL, 0x0010,
11747 NULL, HFILL }
11749 { &hf_bthci_evt_spacing_types_reserved,
11750 { "Reserved", "bthci_evt.spacing_types.reserved",
11751 FT_UINT16, BASE_HEX, NULL, 0xFFE0,
11752 NULL, HFILL }
11754 { &hf_bthci_evt_le_phys,
11755 { "PHYs", "bthci_evt.le_phys",
11756 FT_UINT8, BASE_HEX, NULL, 0x0,
11757 NULL, HFILL }
11759 { &hf_bthci_evt_le_phys_le_1m,
11760 { "LE 1M", "bthci_evt.le_phys.le_1m",
11761 FT_BOOLEAN, 8, NULL, 0x1,
11762 NULL, HFILL }
11764 { &hf_bthci_evt_le_phys_le_2m,
11765 { "LE 2M", "bthci_evt.le_phys.le_2m",
11766 FT_BOOLEAN, 8, NULL, 0x2,
11767 NULL, HFILL }
11769 { &hf_bthci_evt_le_phys_le_coded,
11770 { "LE Coded", "bthci_evt.le_phys.le_coded",
11771 FT_BOOLEAN, 8, NULL, 0x4,
11772 NULL, HFILL }
11774 { &hf_bthci_evt_le_phys_reserved,
11775 { "Reserved", "bthci_evt.le_phys.reserved",
11776 FT_UINT8, BASE_HEX, NULL, 0xF8,
11777 NULL, HFILL }
11782 static ei_register_info ei[] = {
11783 { &ei_event_undecoded, { "bthci_evt.expert.event.undecoded", PI_UNDECODED, PI_NOTE, "Event undecoded", EXPFILL }},
11784 { &ei_event_unknown_event, { "bthci_evt.expert.event.unknown_event", PI_PROTOCOL, PI_WARN, "Unknown event", EXPFILL }},
11785 { &ei_event_unexpected_event, { "bthci_evt.expert.event.unexpected_event", PI_PROTOCOL, PI_WARN, "Unexpected event", EXPFILL }},
11786 { &ei_event_unexpected_parameter, { "bthci_evt.expert.event.unexpected_parameter", PI_PROTOCOL, PI_WARN, "Unexpected parameter", EXPFILL }},
11787 { &ei_event_unknown_command, { "bthci_evt.expert.event.unknown_command", PI_PROTOCOL, PI_WARN, "Unknown command", EXPFILL }},
11788 { &ei_parameter_unexpected, { "bthci_evt.expert.parameter.unexpected", PI_PROTOCOL, PI_WARN, "Unexpected command parameter", EXPFILL }},
11789 { &ei_manufacturer_data_changed, { "bthci_evt.expert.event.manufacturer_data_changed", PI_PROTOCOL, PI_WARN, "Manufacturer data changed", EXPFILL }},
11790 { &ei_hci_revision_changed, { "bthci_evt.expert.event.hci_revision_changed", PI_PROTOCOL, PI_WARN, "HCI Revision changed", EXPFILL }},
11791 { &ei_lmp_subversion_changed, { "bthci_evt.expert.event.lmp_subversion_changed", PI_PROTOCOL, PI_WARN, "LMP Subversion changed", EXPFILL }},
11792 { &ei_bad_link_type, { "bthci_evt.expert.bad_link_type", PI_PROTOCOL, PI_WARN, "Bad Link type, should be ACL or SCO", EXPFILL }},
11795 /* Setup protocol subtree array */
11796 static int *ett[] = {
11797 &ett_bthci_evt,
11798 &ett_opcode,
11799 &ett_lmp_subtree,
11800 &ett_ptype_subtree,
11801 &ett_le_state_subtree,
11802 &ett_le_channel_map,
11803 &ett_le_features,
11804 &ett_le_report,
11805 &ett_codecs,
11806 &ett_mws_transport_layers,
11807 &ett_mws_transport_layers_item,
11808 &ett_mws_to_mws_baud_rates,
11809 &ett_mws_to_mws_baud_rates_transport_item,
11810 &ett_mws_from_mws_baud_rates,
11811 &ett_mws_from_mws_baud_rates_transport_item,
11812 &ett_expert,
11813 &ett_le_ext_advts_event_type,
11814 &ett_iq_sample_list,
11815 &ett_iq_samples,
11816 &ett_simple_pairing_options,
11817 &ett_supported_switching_sample_rates,
11818 &ett_transmit_power_level_flags,
11819 &ett_adv_subevent_responses,
11820 &ett_cs_abort_reason,
11821 &ett_cs_step,
11822 &ett_cs_tone,
11823 &ett_cs_pct_sample,
11824 &ett_packet_quality,
11825 &ett_cs_roles,
11826 &ett_cs_modes,
11827 &ett_cs_capability,
11828 &ett_cs_times,
11829 &ett_spacing_types,
11830 &ett_phys
11833 /* Decode As handling
11834 This doesn't use register_decode_as_next_proto because it shares a dissector table
11835 with "bthci_cmd.vendor" */
11836 static build_valid_func bthci_evt_vendor_da_build_value[1] = {bthci_evt_vendor_value};
11837 static decode_as_value_t bthci_evt_vendor_da_values = {bthci_evt_vendor_prompt, 1, bthci_evt_vendor_da_build_value};
11838 static decode_as_t bthci_evt_vendor_da = {"bthci_cmd", "bthci_cmd.vendor", 1, 0, &bthci_evt_vendor_da_values, NULL, NULL,
11839 decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL};
11842 /* Register the protocol name and description */
11843 proto_bthci_evt = proto_register_protocol("Bluetooth HCI Event",
11844 "HCI_EVT", "bthci_evt");
11845 bthci_evt_handle = register_dissector("bthci_evt", dissect_bthci_evt, proto_bthci_evt);
11847 /* Required function calls to register the header fields and subtrees used */
11848 proto_register_field_array(proto_bthci_evt, hf, array_length(hf));
11849 proto_register_subtree_array(ett, array_length(ett));
11851 expert_bthci_evt = expert_register_protocol(proto_bthci_evt);
11852 expert_register_field_array(expert_bthci_evt, ei, array_length(ei));
11854 module = prefs_register_protocol_subtree("Bluetooth", proto_bthci_evt, NULL);
11855 prefs_register_static_text_preference(module, "hci_evt.version",
11856 "Bluetooth HCI version: 4.0 (Core) + Addendum 4",
11857 "Version of protocol supported by this dissector.");
11859 register_decode_as(&bthci_evt_vendor_da);
11861 hci_evt_vendor_dissector_table = register_decode_as_next_proto(proto_bthci_evt, "bthci_evt.vendor",
11862 "BT HCI Event Vendor", bthci_evt_vendor_prompt);
11866 void
11867 proto_reg_handoff_bthci_evt(void)
11869 hci_cmd_vendor_dissector_table = find_dissector_table("bthci_cmd.vendor");
11870 hci_vendor_table = find_dissector_table("bluetooth.vendor");
11872 dissector_add_uint("hci_h4.type", HCI_H4_TYPE_EVT, bthci_evt_handle);
11873 dissector_add_uint("hci_h1.type", BTHCI_CHANNEL_EVENT, bthci_evt_handle);
11875 bthci_cmd_handle = find_dissector_add_dependency("bthci_cmd", proto_bthci_evt);
11876 btcommon_cod_handle = find_dissector_add_dependency("btcommon.cod", proto_bthci_evt);
11877 btcommon_eir_handle = find_dissector_add_dependency("btcommon.eir_ad.eir", proto_bthci_evt);
11878 btcommon_ad_handle = find_dissector_add_dependency("btcommon.eir_ad.ad", proto_bthci_evt);
11879 btcommon_le_channel_map_handle = find_dissector_add_dependency("btcommon.le_channel_map", proto_bthci_evt);
11883 * Editor modelines - https://www.wireshark.org/tools/modelines.html
11885 * Local variables:
11886 * c-basic-offset: 4
11887 * tab-width: 8
11888 * indent-tabs-mode: nil
11889 * End:
11891 * vi: set shiftwidth=4 tabstop=8 expandtab:
11892 * :indentSize=4:tabSize=8:noTabs=true: