Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-bthci_vendor_android.c
blobf965a094b0505cf142d4507d10e175479457705c
1 /* packet-bthci_vendor.c
2 * Routines for the Bluetooth HCI Vendors Commands/Events
4 * Copyright 2014, Michal Labedzki for Tieto Corporation
5 * Copyright 2024, Jakub Rotkiewicz for Google LLC
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * SPDX-License-Identifier: GPL-2.0-or-later
14 #include "config.h"
16 #include <epan/packet.h>
17 #include <epan/expert.h>
18 #include <epan/tap.h>
20 #include "packet-bluetooth.h"
21 #include "packet-bthci_cmd.h"
22 #include "packet-bthci_evt.h"
25 static int proto_bthci_vendor_android;
27 static int hf_android_opcode;
28 static int hf_android_opcode_ogf;
29 static int hf_android_opcode_ocf;
30 static int hf_android_parameter_length;
31 static int hf_android_number_of_allowed_command_packets;
32 static int hf_android_event_code;
33 static int hf_android_le_advertising_filter_subcode;
34 static int hf_android_le_scan_condition;
35 static int hf_android_le_filter_index;
36 static int hf_android_le_number_of_available_filters;
37 static int hf_android_status;
38 static int hf_android_bd_addr;
39 static int hf_android_data;
40 static int hf_android_max_advertising_instance;
41 static int hf_android_max_advertising_instance_reserved;
42 static int hf_android_resolvable_private_address_offloading;
43 static int hf_android_resolvable_private_address_offloading_reserved;
44 static int hf_android_total_scan_results;
45 static int hf_android_max_irk_list;
46 static int hf_android_filter_support;
47 static int hf_android_max_filter;
48 static int hf_android_energy_support;
49 static int hf_android_version_support;
50 static int hf_android_total_num_of_advt_tracked;
51 static int hf_android_extended_scan_support;
52 static int hf_android_debug_logging_support;
53 static int hf_android_le_address_generation_offloading_support;
54 static int hf_android_le_address_generation_offloading_support_reserved;
55 static int hf_android_a2dp_source_offload_capability_mask;
56 static int hf_android_a2dp_source_offload_capability_mask_sbc;
57 static int hf_android_a2dp_source_offload_capability_mask_aac;
58 static int hf_android_a2dp_source_offload_capability_mask_aptx;
59 static int hf_android_a2dp_source_offload_capability_mask_aptx_hd;
60 static int hf_android_a2dp_source_offload_capability_mask_ldac;
61 static int hf_android_a2dp_source_offload_capability_mask_reserved;
62 static int hf_android_bluetooth_quality_report_support;
63 static int hf_android_dynamic_audio_buffer_support_mask;
64 static int hf_android_dynamic_audio_buffer_support_mask_sbc;
65 static int hf_android_dynamic_audio_buffer_support_mask_aac;
66 static int hf_android_dynamic_audio_buffer_support_mask_aptx;
67 static int hf_android_dynamic_audio_buffer_support_mask_aptx_hd;
68 static int hf_android_dynamic_audio_buffer_support_mask_ldac;
69 static int hf_android_dynamic_audio_buffer_support_mask_reserved;
70 static int hf_android_a2dp_offload_v2_support;
71 static int hf_android_le_energy_total_rx_time;
72 static int hf_android_le_energy_total_tx_time;
73 static int hf_android_le_energy_total_idle_time;
74 static int hf_android_le_energy_total_energy_used;
75 static int hf_android_le_batch_scan_subcode;
76 static int hf_android_le_batch_scan_report_format;
77 static int hf_android_le_batch_scan_number_of_records;
78 static int hf_android_le_batch_scan_mode;
79 static int hf_android_le_batch_scan_enable;
80 static int hf_android_le_batch_scan_full_max;
81 static int hf_android_le_batch_scan_truncate_max;
82 static int hf_android_le_batch_scan_notify_threshold;
83 static int hf_android_le_batch_scan_window;
84 static int hf_android_le_batch_scan_interval;
85 static int hf_android_le_batch_scan_address_type;
86 static int hf_android_le_batch_scan_discard_rule;
87 static int hf_android_le_multi_advertising_subcode;
88 static int hf_android_le_multi_advertising_enable;
89 static int hf_android_le_multi_advertising_instance_id;
90 static int hf_android_le_multi_advertising_type;
91 static int hf_android_le_multi_advertising_min_interval;
92 static int hf_android_le_multi_advertising_max_interval;
93 static int hf_android_le_multi_advertising_address_type;
94 static int hf_android_le_multi_advertising_filter_policy;
95 static int hf_android_le_multi_advertising_tx_power;
96 static int hf_android_le_multi_advertising_channel_map;
97 static int hf_android_le_multi_advertising_channel_map_reserved;
98 static int hf_android_le_multi_advertising_channel_map_39;
99 static int hf_android_le_multi_advertising_channel_map_38;
100 static int hf_android_le_multi_advertising_channel_map_37;
101 static int hf_android_a2dp_hardware_offload_subcode;
102 static int hf_android_a2dp_hardware_offload_start_legacy_codec;
103 static int hf_android_a2dp_hardware_offload_start_legacy_max_latency;
104 static int hf_android_a2dp_hardware_offload_start_legacy_scms_t_enable_flag;
105 static int hf_android_a2dp_hardware_offload_start_legacy_scms_t_enable_value;
106 static int hf_android_a2dp_hardware_offload_start_legacy_scms_t_enable_value_reserved;
107 static int hf_android_a2dp_hardware_offload_start_legacy_sampling_frequency;
108 static int hf_android_a2dp_hardware_offload_start_legacy_bits_per_sample;
109 static int hf_android_a2dp_hardware_offload_start_legacy_channel_mode;
110 static int hf_android_a2dp_hardware_offload_start_legacy_encoded_audio_bitrate;
111 static int hf_android_a2dp_hardware_offload_start_legacy_encoded_audio_bitrate_unspecified;
112 static int hf_android_a2dp_hardware_offload_start_legacy_encoded_audio_bitrate_reserved;
113 static int hf_android_a2dp_hardware_offload_start_legacy_connection_handle;
114 static int hf_android_a2dp_hardware_offload_start_legacy_l2cap_cid;
115 static int hf_android_a2dp_hardware_offload_start_legacy_l2cap_mtu_size;
116 static int hf_android_a2dp_hardware_offload_start_legacy_codec_information;
117 static int hf_android_a2dp_hardware_offload_start_legacy_codec_information_sbc_block_length;
118 static int hf_android_a2dp_hardware_offload_start_legacy_codec_information_sbc_subbands;
119 static int hf_android_a2dp_hardware_offload_start_legacy_codec_information_sbc_allocation_method;
120 static int hf_android_a2dp_hardware_offload_start_legacy_codec_information_sbc_min_bitpool;
121 static int hf_android_a2dp_hardware_offload_start_legacy_codec_information_sbc_max_bitpool;
122 static int hf_android_a2dp_hardware_offload_start_legacy_codec_information_sbc_sampling_frequency;
123 static int hf_android_a2dp_hardware_offload_start_legacy_codec_information_sbc_channel_mode;
124 static int hf_android_a2dp_hardware_offload_start_legacy_codec_information_sbc_reserved;
125 static int hf_android_a2dp_hardware_offload_start_legacy_codec_information_aac_object_type;
126 static int hf_android_a2dp_hardware_offload_start_legacy_codec_information_aac_vbr;
127 static int hf_android_a2dp_hardware_offload_start_legacy_codec_information_aac_reserved;
128 static int hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_vendor_id;
129 static int hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_codec_id;
130 static int hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_bitrate_index;
131 static int hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_bitrate_index_reserved;
132 static int hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_channel_mode_mask;
133 static int hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_channel_mode_mask_stereo;
134 static int hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_channel_mode_mask_dual;
135 static int hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_channel_mode_mask_mono;
136 static int hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_channel_mode_mask_reserved;
137 static int hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_reserved;
138 static int hf_android_a2dp_hardware_offload_start_legacy_codec_information_reserved;
139 static int hf_android_a2dp_hardware_offload_start_connection_handle;
140 static int hf_android_a2dp_hardware_offload_start_l2cap_cid;
141 static int hf_android_a2dp_hardware_offload_start_data_path_direction;
142 static int hf_android_a2dp_hardware_offload_start_peer_mtu;
143 static int hf_android_a2dp_hardware_offload_start_cp_enable_scmst;
144 static int hf_android_a2dp_hardware_offload_start_cp_header_scmst;
145 static int hf_android_a2dp_hardware_offload_start_cp_header_scmst_reserved;
146 static int hf_android_a2dp_hardware_offload_start_vendor_specific_parameters_length;
147 static int hf_android_a2dp_hardware_offload_start_vendor_specific_parameters;
148 static int hf_android_a2dp_hardware_offload_stop_connection_handle;
149 static int hf_android_a2dp_hardware_offload_stop_l2cap_cid;
150 static int hf_android_a2dp_hardware_offload_stop_data_path_direction;
153 static int * const hfx_android_le_multi_advertising_channel_map[] = {
154 &hf_android_le_multi_advertising_channel_map_reserved,
155 &hf_android_le_multi_advertising_channel_map_39,
156 &hf_android_le_multi_advertising_channel_map_38,
157 &hf_android_le_multi_advertising_channel_map_37,
158 NULL
161 static int * const hfx_android_a2dp_source_offload_capability[] = {
162 &hf_android_a2dp_source_offload_capability_mask_reserved,
163 &hf_android_a2dp_source_offload_capability_mask_ldac,
164 &hf_android_a2dp_source_offload_capability_mask_aptx_hd,
165 &hf_android_a2dp_source_offload_capability_mask_aptx,
166 &hf_android_a2dp_source_offload_capability_mask_aac,
167 &hf_android_a2dp_source_offload_capability_mask_sbc,
168 NULL
171 static int * const hfx_android_dynamic_audio_buffer_support[] = {
172 &hf_android_dynamic_audio_buffer_support_mask_reserved,
173 &hf_android_dynamic_audio_buffer_support_mask_ldac,
174 &hf_android_dynamic_audio_buffer_support_mask_aptx_hd,
175 &hf_android_dynamic_audio_buffer_support_mask_aptx,
176 &hf_android_dynamic_audio_buffer_support_mask_aac,
177 &hf_android_dynamic_audio_buffer_support_mask_sbc,
178 NULL
181 static int * const hfx_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_channel_mode[] = {
182 &hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_channel_mode_mask_reserved,
183 &hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_channel_mode_mask_mono,
184 &hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_channel_mode_mask_dual,
185 &hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_channel_mode_mask_stereo,
186 NULL
189 static int ett_android;
190 static int ett_android_opcode;
191 static int ett_android_channel_map;
192 static int ett_android_a2dp_source_offload_capability_mask;
193 static int ett_android_dynamic_audio_buffer_support_mask;
194 static int ett_android_a2dp_hardware_offload_start_legacy_codec_information;
195 static int ett_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_channel_mode_mask;
197 static expert_field ei_android_undecoded;
198 static expert_field ei_android_unexpected_parameter;
199 static expert_field ei_android_unexpected_data;
201 static dissector_handle_t bthci_vendor_android_handle;
202 static dissector_handle_t btcommon_ad_android_handle;
204 #define ANDROID_OPCODE_VALS(base) \
205 { (base) | 0x0153, "LE Get Vendor Capabilities" }, \
206 { (base) | 0x0154, "LE Multi Advertising" }, \
207 { (base) | 0x0156, "LE Batch Scan" }, \
208 { (base) | 0x0157, "LE Advertising Filter" }, \
209 { (base) | 0x0158, "LE Tracking Advertising" }, \
210 { (base) | 0x0159, "LE Energy Info" }, \
211 { (base) | 0x015D, "A2DP Hardware Offload" }
213 static const value_string android_opcode_ocf_vals[] = {
214 ANDROID_OPCODE_VALS(0x0),
215 { 0, NULL }
218 static const value_string android_opcode_vals[] = {
219 ANDROID_OPCODE_VALS(0x3F << 10),
220 { 0, NULL }
223 static const value_string android_le_subcode_advertising_filter_vals[] = {
224 { 0x00, "Enable" },
225 { 0x01, "Feature Select" },
226 { 0x02, "BDADDR" },
227 { 0x03, "UUID" },
228 { 0x04, "Solicitate UUID" },
229 { 0x05, "Local Name" },
230 { 0x06, "Manufacturer Data" },
231 { 0x07, "Service Data" },
232 { 0x08, "All" },
233 { 0, NULL }
236 static const value_string android_le_scan_condition_vals[] = {
237 { 0x00, "Add" },
238 { 0x01, "Delete" },
239 { 0x02, "Clear" },
240 { 0, NULL }
243 static const value_string android_le_subcode_batch_scan_vals[] = {
244 { 0x01, "Enable/Disable Customer Feature" },
245 { 0x02, "Set Storage Parameter" },
246 { 0x03, "Set Parameter" },
247 { 0x04, "Read Results" },
248 { 0, NULL }
251 static const value_string android_batch_scan_mode_vals[] = {
252 { 0x00, "Disable" },
253 { 0x01, "Pass" },
254 { 0x02, "ACTI" },
255 { 0x03, "Pass ACTI" },
256 { 0, NULL }
259 static const value_string android_batch_scan_discard_rule_vals[] = {
260 { 0x00, "Old Items" },
261 { 0x01, "Lower RSSI Items" },
262 { 0, NULL }
265 static const value_string android_disable_enable_vals[] = {
266 { 0x00, "Disable" },
267 { 0x01, "Enable" },
268 { 0, NULL }
271 static const value_string android_le_subcode_multi_advertising_vals[] = {
272 { 0x01, "Set Parameter" },
273 { 0x02, "Write Advertising Data" },
274 { 0x03, "Write Scan Response Data" },
275 { 0x04, "Set Random Address" },
276 { 0x05, "MultiAdvertising Enable/Disable Customer Feature" },
277 { 0, NULL }
280 static const value_string android_le_filter_policy_vals[] = {
281 { 0x00, "All Connections" },
282 { 0x01, "Whitelist Connections All" },
283 { 0x02, "All Connections Whitelist" },
284 { 0x03, "Whitelist Connections" },
285 { 0, NULL }
288 static const value_string android_a2dp_hardware_offload_vals[] = {
289 { 0x01, "Start A2DP offload (legacy)" },
290 { 0x02, "Stop A2DP offload (legacy)" },
291 { 0x03, "Start A2DP offload" },
292 { 0x04, "Stop A2DP offload" },
293 { 0, NULL }
296 static const value_string android_a2dp_hardware_offload_start_legacy_codec_vals[] = {
297 { 0x01, "SBC" },
298 { 0x02, "AAC" },
299 { 0x04, "APTX" },
300 { 0x08, "APTX HD" },
301 { 0x10, "LDAC" },
302 { 0, NULL }
305 static const value_string android_a2dp_hardware_offload_start_legacy_sampling_frequency_vals[] = {
306 { 0x00000001, "44100 Hz" },
307 { 0x00000002, "48000 Hz" },
308 { 0x00000004, "88200 Hz" },
309 { 0x00000008, "96000 Hz" },
310 { 0, NULL }
313 static const value_string android_a2dp_hardware_offload_start_legacy_bits_per_sample_vals[] = {
314 { 0x01, "16 bits per sample" },
315 { 0x02, "24 bits per sample" },
316 { 0x04, "32 bits per sample" },
317 { 0, NULL }
320 static const value_string android_a2dp_hardware_offload_start_legacy_channel_mode_vals[] = {
321 { 0x01, "Mono" },
322 { 0x02, "Stereo" },
323 { 0, NULL }
326 static const value_string android_a2dp_hardware_offload_start_legacy_codec_information_sbc_block_length_vals[] = {
327 { 0x01, "16" },
328 { 0x02, "12" },
329 { 0x04, "8" },
330 { 0x08, "4" },
331 { 0, NULL }
334 static const value_string android_a2dp_hardware_offload_start_legacy_codec_information_sbc_subbands_vals[] = {
335 { 0x01, "8" },
336 { 0x02, "4" },
337 { 0, NULL }
340 static const value_string android_a2dp_hardware_offload_start_legacy_codec_information_sbc_allocation_method_vals[] = {
341 { 0x01, "Loudness" },
342 { 0x02, "SNR" },
343 { 0, NULL }
346 static const value_string android_a2dp_hardware_offload_start_legacy_sbc_sampling_frequency_vals[] = {
347 { 0x01, "48000 Hz" },
348 { 0x02, "44100 Hz" },
349 { 0x04, "32000 Hz" },
350 { 0x08, "16000 Hz" },
351 { 0, NULL }
354 static const value_string android_a2dp_hardware_offload_start_legacy_sbc_channel_mode_vals[] = {
355 { 0x01, "Joint Stereo" },
356 { 0x02, "Stereo" },
357 { 0x04, "Dual Channel" },
358 { 0x08, "Mono" },
359 { 0, NULL }
362 static const value_string android_a2dp_hardware_offload_data_path_direction_vals[] = {
363 { 0x00, "Output (AVDTP Source/Merge)" },
364 { 0x01, "Input (AVDTP Sink/Split)" },
365 { 0, NULL }
368 static const value_string android_a2dp_hardware_offload_start_legacy_aac_object_type_vals[] = {
369 { 0x01, "RFA (b0)" },
370 { 0x02, "RFA (b1)" },
371 { 0x04, "RFA (b2)" },
372 { 0x08, "RFA (b3)" },
373 { 0x10, "MPEG-4 AAC scalable" },
374 { 0x20, "MPEG-4 AAC LTP" },
375 { 0x40, "MPEG-4 AAC LC" },
376 { 0x80, "MPEG-2 AAC LC" },
377 { 0, NULL }
380 static const value_string android_a2dp_hardware_offload_start_legacy_codec_information_ldac_bitrate_index_vals[] = {
381 { 0x00, "High" },
382 { 0x01, "Mid" },
383 { 0x02, "Low" },
384 { 0x7f, "ABR (Adaptive Bit Rate)" },
385 { 0, NULL }
388 void proto_register_bthci_vendor_android(void);
389 void proto_reg_handoff_bthci_vendor_android(void);
391 static int
392 dissect_bthci_vendor_android(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
394 proto_item *main_item;
395 proto_tree *main_tree;
396 proto_item *opcode_item;
397 proto_tree *opcode_tree;
398 proto_item *sub_item;
399 bluetooth_data_t *bluetooth_data;
400 int offset = 0;
401 uint16_t opcode;
402 uint16_t ocf;
403 const char *description;
404 uint8_t length;
405 uint8_t event_code;
406 uint8_t status;
407 uint8_t subcode;
408 uint8_t condition;
409 uint32_t interface_id;
410 uint32_t adapter_id;
411 proto_item *codec_information_item;
412 proto_tree *codec_information_tree;
414 bluetooth_data = (bluetooth_data_t *) data;
415 if (bluetooth_data) {
416 interface_id = bluetooth_data->interface_id;
417 adapter_id = bluetooth_data->adapter_id;
418 } else {
419 interface_id = HCI_INTERFACE_DEFAULT;
420 adapter_id = HCI_ADAPTER_DEFAULT;
423 main_item = proto_tree_add_item(tree, proto_bthci_vendor_android, tvb, 0, -1, ENC_NA);
424 main_tree = proto_item_add_subtree(main_item, ett_android);
426 switch (pinfo->p2p_dir) {
428 case P2P_DIR_SENT:
429 col_set_str(pinfo->cinfo, COL_PROTOCOL, "HCI_CMD_ANDROID");
430 col_set_str(pinfo->cinfo, COL_INFO, "Sent Android ");
432 opcode_item = proto_tree_add_item(main_tree, hf_android_opcode, tvb, offset, 2, ENC_LITTLE_ENDIAN);
433 opcode_tree = proto_item_add_subtree(opcode_item, ett_android_opcode);
434 opcode = tvb_get_letohs(tvb, offset);
435 proto_tree_add_item(opcode_tree, hf_android_opcode_ogf, tvb, offset, 2, ENC_LITTLE_ENDIAN);
437 proto_tree_add_item(opcode_tree, hf_android_opcode_ocf, tvb, offset, 2, ENC_LITTLE_ENDIAN);
438 ocf = opcode & 0x03ff;
439 offset+=2;
441 description = val_to_str_const(ocf, android_opcode_ocf_vals, "unknown");
442 if (g_strcmp0(description, "unknown") != 0)
443 col_append_str(pinfo->cinfo, COL_INFO, description);
444 else
445 col_append_fstr(pinfo->cinfo, COL_INFO, "Unknown Command 0x%04X (opcode 0x%04X)", ocf, opcode);
447 if (have_tap_listener(bluetooth_hci_summary_tap)) {
448 bluetooth_hci_summary_tap_t *tap_hci_summary;
450 tap_hci_summary = wmem_new(pinfo->pool, bluetooth_hci_summary_tap_t);
451 tap_hci_summary->interface_id = interface_id;
452 tap_hci_summary->adapter_id = adapter_id;
454 tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_VENDOR_OPCODE;
455 tap_hci_summary->ogf = opcode >> 10;
456 tap_hci_summary->ocf = ocf;
457 if (try_val_to_str(ocf, android_opcode_ocf_vals))
458 tap_hci_summary->name = description;
459 else
460 tap_hci_summary->name = NULL;
461 tap_queue_packet(bluetooth_hci_summary_tap, pinfo, tap_hci_summary);
464 proto_tree_add_item(main_tree, hf_android_parameter_length, tvb, offset, 1, ENC_NA);
465 length = tvb_get_uint8(tvb, offset);
466 offset += 1;
468 switch(ocf) {
469 case 0x0154: /* LE Multi Advertising */
470 proto_tree_add_item(main_tree, hf_android_le_multi_advertising_subcode, tvb, offset, 1, ENC_NA);
471 subcode = tvb_get_uint8(tvb, offset);
472 offset += 1;
474 switch (subcode) {
475 case 0x01: /* Set Parameter */
476 proto_tree_add_item(main_tree, hf_android_le_multi_advertising_min_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
477 offset += 2;
479 proto_tree_add_item(main_tree, hf_android_le_multi_advertising_max_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
480 offset += 2;
482 proto_tree_add_item(main_tree, hf_android_le_multi_advertising_type, tvb, offset, 1, ENC_NA);
483 offset += 1;
485 proto_tree_add_item(main_tree, hf_android_le_multi_advertising_address_type, tvb, offset, 1, ENC_NA);
486 offset += 1;
488 offset = dissect_bd_addr(hf_android_bd_addr, pinfo, main_tree, tvb, offset, false, interface_id, adapter_id, NULL);
490 proto_tree_add_item(main_tree, hf_android_le_multi_advertising_address_type, tvb, offset, 1, ENC_NA);
491 offset += 1;
493 offset = dissect_bd_addr(hf_android_bd_addr, pinfo, main_tree, tvb, offset, false, interface_id, adapter_id, NULL);
495 proto_tree_add_bitmask(main_tree, tvb, offset, hf_android_le_multi_advertising_channel_map, ett_android_channel_map, hfx_android_le_multi_advertising_channel_map, ENC_NA);
496 offset += 1;
498 proto_tree_add_item(main_tree, hf_android_le_multi_advertising_filter_policy, tvb, offset, 1, ENC_NA);
499 offset += 1;
501 proto_tree_add_item(main_tree, hf_android_le_multi_advertising_instance_id, tvb, offset, 1, ENC_NA);
502 offset += 1;
504 proto_tree_add_item(main_tree, hf_android_le_multi_advertising_tx_power, tvb, offset, 1, ENC_NA);
505 offset += 1;
507 break;
508 case 0x02: /* Write Advertising Data */
509 case 0x03: /* Write Scan Response Data */
510 call_dissector_with_data(btcommon_ad_android_handle, tvb_new_subset_length(tvb, offset, 31), pinfo, tree, bluetooth_data);
511 save_local_device_name_from_eir_ad(tvb, offset, pinfo, 31, bluetooth_data);
512 offset += 31;
514 proto_tree_add_item(main_tree, hf_android_le_multi_advertising_instance_id, tvb, offset, 1, ENC_NA);
515 offset += 1;
517 break;
518 case 0x04: /* Set Random Address */
519 offset = dissect_bd_addr(hf_android_bd_addr, pinfo, main_tree, tvb, offset, false, interface_id, adapter_id, NULL);
521 proto_tree_add_item(main_tree, hf_android_le_multi_advertising_instance_id, tvb, offset, 1, ENC_NA);
522 offset += 1;
524 break;
525 case 0x05: /* MultiAdvertising Enable/Disable Customer Feature */
526 proto_tree_add_item(main_tree, hf_android_le_multi_advertising_enable, tvb, offset, 1, ENC_NA);
527 offset += 1;
529 proto_tree_add_item(main_tree, hf_android_le_multi_advertising_instance_id, tvb, offset, 1, ENC_NA);
530 offset += 1;
532 break;
535 break;
536 case 0x0156: /* LE Batch Scan */
537 proto_tree_add_item(main_tree, hf_android_le_batch_scan_subcode, tvb, offset, 1, ENC_NA);
538 subcode = tvb_get_uint8(tvb, offset);
539 offset += 1;
541 switch (subcode) {
542 case 0x01: /* Enable/Disable Customer Feature */
543 proto_tree_add_item(main_tree, hf_android_le_batch_scan_enable, tvb, offset, 1, ENC_NA);
544 offset += 1;
546 break;
547 case 0x02: /* Set Storage Parameter */
548 proto_tree_add_item(main_tree, hf_android_le_batch_scan_full_max, tvb, offset, 1, ENC_NA);
549 offset += 1;
551 proto_tree_add_item(main_tree, hf_android_le_batch_scan_truncate_max, tvb, offset, 1, ENC_NA);
552 offset += 1;
554 proto_tree_add_item(main_tree, hf_android_le_batch_scan_notify_threshold, tvb, offset, 1, ENC_NA);
555 offset += 1;
557 break;
558 case 0x03: /* Set Parameter */
559 proto_tree_add_item(main_tree, hf_android_le_batch_scan_mode, tvb, offset, 1, ENC_NA);
560 offset += 1;
562 proto_tree_add_item(main_tree, hf_android_le_batch_scan_window, tvb, offset, 4, ENC_LITTLE_ENDIAN);
563 offset += 4;
565 proto_tree_add_item(main_tree, hf_android_le_batch_scan_interval, tvb, offset, 4, ENC_LITTLE_ENDIAN);
566 offset += 4;
568 proto_tree_add_item(main_tree, hf_android_le_batch_scan_address_type, tvb, offset, 1, ENC_NA);
569 offset += 1;
571 proto_tree_add_item(main_tree, hf_android_le_batch_scan_discard_rule, tvb, offset, 1, ENC_NA);
572 offset += 1;
574 break;
575 case 0x04: /* Read Results */
576 proto_tree_add_item(main_tree, hf_android_le_batch_scan_mode, tvb, offset, 1, ENC_NA);
577 offset += 1;
579 break;
582 break;
583 case 0x0157: /* LE Advertising Filter */
584 proto_tree_add_item(main_tree, hf_android_le_advertising_filter_subcode, tvb, offset, 1, ENC_NA);
585 subcode = tvb_get_uint8(tvb, offset);
586 offset += 1;
588 proto_tree_add_item(main_tree, hf_android_le_scan_condition, tvb, offset, 1, ENC_NA);
589 condition = tvb_get_uint8(tvb, offset);
590 offset += 1;
592 proto_tree_add_item(main_tree, hf_android_le_filter_index, tvb, offset, 1, ENC_NA);
593 offset += 1;
595 if (condition == 0x00) { /* Add */
596 switch (subcode) {
597 case 0x00: /* Enable */
598 case 0x01: /* Feature Select */
599 case 0x02: /* BDADDR */
600 case 0x03: /* UUID */
601 case 0x04: /* Solicitate UUID */
602 case 0x05: /* Local Name */
603 case 0x06: /* Manufacturer Data */
604 case 0x07: /* Service Data */
605 case 0x08: /* All */
606 /* TODO */
607 sub_item = proto_tree_add_item(main_tree, hf_android_data, tvb, offset, length - 3, ENC_NA);
608 expert_add_info(pinfo, sub_item, &ei_android_undecoded);
609 offset += length - 3;
611 break;
612 default:
613 sub_item = proto_tree_add_item(main_tree, hf_android_data, tvb, offset, length - 3, ENC_NA);
614 expert_add_info(pinfo, sub_item, &ei_android_unexpected_data);
615 offset += length - 3;
619 break;
620 case 0x0153: /* LE Get Vendor Capabilities */
621 if (tvb_captured_length_remaining(tvb, offset) > 0) {
622 sub_item = proto_tree_add_item(main_tree, hf_android_data, tvb, offset, length, ENC_NA);
623 expert_add_info(pinfo, sub_item, &ei_android_unexpected_parameter);
625 break;
626 case 0x0159: /* LE Energy Info */
627 if (tvb_captured_length_remaining(tvb, offset) > 0) {
628 sub_item = proto_tree_add_item(main_tree, hf_android_data, tvb, offset, length, ENC_NA);
629 expert_add_info(pinfo, sub_item, &ei_android_unexpected_parameter);
631 break;
632 case 0x015D: /* A2DP Hardware Offload */
633 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_subcode, tvb, offset, 1, ENC_NA);
634 subcode = tvb_get_uint8(tvb, offset);
635 offset += 1;
637 switch (subcode) {
638 case 0x01: { /* Start A2DP offload (legacy) */
639 int codec_id = tvb_get_uint32(tvb, offset, ENC_LITTLE_ENDIAN);
641 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_start_legacy_codec, tvb, offset, 4, ENC_LITTLE_ENDIAN);
642 offset += 4;
644 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_start_legacy_max_latency, tvb, offset, 2, ENC_LITTLE_ENDIAN);
645 offset += 2;
647 /* Flag is the LSB out of the two, read it first */
648 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_start_legacy_scms_t_enable_flag, tvb, offset, 1, ENC_NA);
649 offset += 1;
651 bool scms_t_enabled = tvb_get_uint8(tvb, offset) == 0x01;
652 if (scms_t_enabled) {
653 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_start_legacy_scms_t_enable_value, tvb, offset, 1, ENC_NA);
654 } else {
655 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_start_legacy_scms_t_enable_value_reserved, tvb, offset, 1, ENC_NA);
657 offset += 1;
659 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_start_legacy_sampling_frequency, tvb, offset, 4, ENC_LITTLE_ENDIAN);
660 offset += 4;
662 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_start_legacy_bits_per_sample, tvb, offset, 1, ENC_NA);
663 offset += 1;
665 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_start_legacy_channel_mode, tvb, offset, 1, ENC_NA);
666 offset += 1;
668 uint32_t encoded_audio_bitrate = tvb_get_uint32(tvb, offset, ENC_LITTLE_ENDIAN);
669 if (encoded_audio_bitrate == 0x00000000) {
670 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_start_legacy_encoded_audio_bitrate_unspecified, tvb, offset, 4, ENC_LITTLE_ENDIAN);
671 } else if (encoded_audio_bitrate >= 0x01000000) {
672 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_start_legacy_encoded_audio_bitrate_reserved, tvb, offset, 4, ENC_LITTLE_ENDIAN);
673 } else {
674 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_start_legacy_encoded_audio_bitrate, tvb, offset, 4, ENC_LITTLE_ENDIAN);
676 offset += 4;
678 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_start_legacy_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
679 offset += 2;
681 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_start_legacy_l2cap_cid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
682 offset += 2;
684 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_start_legacy_l2cap_mtu_size, tvb, offset, 2, ENC_LITTLE_ENDIAN);
685 offset += 2;
687 codec_information_item = proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_start_legacy_codec_information, tvb, offset, 32, ENC_NA);
688 codec_information_tree = proto_item_add_subtree(codec_information_item, ett_android_a2dp_hardware_offload_start_legacy_codec_information);
690 switch (codec_id) {
691 case 0x00000001: /* SBC */
692 proto_tree_add_item(codec_information_tree, hf_android_a2dp_hardware_offload_start_legacy_codec_information_sbc_block_length, tvb, offset, 1, ENC_NA);
693 proto_tree_add_item(codec_information_tree, hf_android_a2dp_hardware_offload_start_legacy_codec_information_sbc_subbands, tvb, offset, 1, ENC_NA);
694 proto_tree_add_item(codec_information_tree, hf_android_a2dp_hardware_offload_start_legacy_codec_information_sbc_allocation_method, tvb, offset, 1, ENC_NA);
695 offset += 1;
697 proto_tree_add_item(codec_information_tree, hf_android_a2dp_hardware_offload_start_legacy_codec_information_sbc_min_bitpool, tvb, offset, 1, ENC_NA);
698 offset += 1;
700 proto_tree_add_item(codec_information_tree, hf_android_a2dp_hardware_offload_start_legacy_codec_information_sbc_max_bitpool, tvb, offset, 1, ENC_NA);
701 offset += 1;
703 proto_tree_add_item(codec_information_tree, hf_android_a2dp_hardware_offload_start_legacy_codec_information_sbc_sampling_frequency, tvb, offset, 1, ENC_NA);
704 proto_tree_add_item(codec_information_tree, hf_android_a2dp_hardware_offload_start_legacy_codec_information_sbc_channel_mode, tvb, offset, 1, ENC_NA);
705 offset += 1;
707 proto_tree_add_item(codec_information_tree, hf_android_a2dp_hardware_offload_start_legacy_codec_information_sbc_reserved, tvb, offset, 28, ENC_NA);
708 offset += 28;
709 break;
710 case 0x00000002: /* AAC */
711 proto_tree_add_item(codec_information_tree, hf_android_a2dp_hardware_offload_start_legacy_codec_information_aac_object_type, tvb, offset, 1, ENC_NA);
712 offset += 1;
714 proto_tree_add_item(codec_information_tree, hf_android_a2dp_hardware_offload_start_legacy_codec_information_aac_vbr, tvb, offset, 1, ENC_NA);
715 offset += 1;
717 proto_tree_add_item(codec_information_tree, hf_android_a2dp_hardware_offload_start_legacy_codec_information_aac_reserved, tvb, offset, 30, ENC_NA);
718 offset += 30;
719 break;
720 case 0x00000010: /* LDAC */
721 proto_tree_add_item(codec_information_tree, hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_vendor_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
722 offset += 4;
724 proto_tree_add_item(codec_information_tree, hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_codec_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
725 offset += 2;
727 uint8_t bitrate_index = tvb_get_uint8(tvb, offset);
728 if (bitrate_index >= 0x03 && bitrate_index != 0x7F) {
729 proto_tree_add_item(codec_information_tree, hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_bitrate_index_reserved, tvb, offset, 1, ENC_NA);
730 } else {
731 proto_tree_add_item(codec_information_tree, hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_bitrate_index, tvb, offset, 1, ENC_NA);
733 offset += 1;
735 proto_tree_add_bitmask(main_tree, tvb, offset, hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_channel_mode_mask,
736 ett_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_channel_mode_mask, hfx_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_channel_mode, ENC_NA);
737 offset += 1;
739 proto_tree_add_item(codec_information_tree, hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_reserved, tvb, offset, 24, ENC_NA);
740 offset += 24;
741 break;
742 default: /* All other codecs */
743 proto_tree_add_item(codec_information_tree, hf_android_a2dp_hardware_offload_start_legacy_codec_information_reserved, tvb, offset, 32, ENC_NA);
744 offset += 32;
745 break;
748 break;
750 case 0x02: { /* Stop A2DP offload (legacy) */
751 if (tvb_captured_length_remaining(tvb, offset) > 0) {
752 sub_item = proto_tree_add_item(main_tree, hf_android_data, tvb, offset, length, ENC_NA);
753 expert_add_info(pinfo, sub_item, &ei_android_unexpected_parameter);
755 break;
757 case 0x03: { /* Start A2DP offload */
758 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_start_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
759 offset += 2;
761 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_start_l2cap_cid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
762 offset += 2;
764 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_start_data_path_direction, tvb, offset, 1, ENC_NA);
765 offset += 1;
767 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_start_peer_mtu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
768 offset += 2;
770 bool cp_enable_scmst = tvb_get_uint8(tvb, offset) == 0x01;
771 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_start_cp_enable_scmst, tvb, offset, 1, ENC_NA);
772 offset += 1;
774 if (cp_enable_scmst) {
775 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_start_cp_header_scmst, tvb, offset, 1, ENC_NA);
776 } else {
777 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_start_cp_header_scmst_reserved, tvb, offset, 1, ENC_NA);
779 offset += 1;
781 uint8_t vendor_specific_parameters_length = tvb_get_uint8(tvb, offset);
782 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_start_vendor_specific_parameters_length, tvb, offset, 1, ENC_NA);
783 offset += 1;
785 if (vendor_specific_parameters_length > 0 && vendor_specific_parameters_length <= 128) {
786 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_start_vendor_specific_parameters, tvb, offset, vendor_specific_parameters_length, ENC_NA);
787 offset += vendor_specific_parameters_length;
789 break;
791 case 0x04: { /* Stop A2DP offload */
792 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_stop_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
793 offset += 2;
795 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_stop_l2cap_cid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
796 offset += 2;
798 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_stop_data_path_direction, tvb, offset, 1, ENC_NA);
799 offset += 1;
801 break;
803 default:
804 if (tvb_captured_length_remaining(tvb, offset) > 0) {
805 sub_item = proto_tree_add_item(main_tree, hf_android_data, tvb, offset, length, ENC_NA);
806 expert_add_info(pinfo, sub_item, &ei_android_unexpected_parameter);
808 break;
811 break;
812 default:
813 if (length > 0) {
814 sub_item = proto_tree_add_item(main_tree, hf_android_data, tvb, offset, length, ENC_NA);
815 expert_add_info(pinfo, sub_item, &ei_android_undecoded);
816 offset += length;
820 break;
821 case P2P_DIR_RECV:
822 col_set_str(pinfo->cinfo, COL_PROTOCOL, "HCI_EVT_ANDROID");
823 col_set_str(pinfo->cinfo, COL_INFO, "Rcvd Android ");
825 event_code = tvb_get_uint8(tvb, offset);
826 description = val_to_str_ext(event_code, &bthci_evt_evt_code_vals_ext, "Unknown 0x%08x");
827 col_append_str(pinfo->cinfo, COL_INFO, description);
828 proto_tree_add_item(main_tree, hf_android_event_code, tvb, offset, 1, ENC_NA);
829 offset += 1;
831 if (have_tap_listener(bluetooth_hci_summary_tap)) {
832 bluetooth_hci_summary_tap_t *tap_hci_summary;
834 tap_hci_summary = wmem_new(pinfo->pool, bluetooth_hci_summary_tap_t);
835 tap_hci_summary->interface_id = interface_id;
836 tap_hci_summary->adapter_id = adapter_id;
838 tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_VENDOR_EVENT;
839 tap_hci_summary->event = event_code;
840 if (try_val_to_str_ext(event_code, &bthci_evt_evt_code_vals_ext))
841 tap_hci_summary->name = description;
842 else
843 tap_hci_summary->name = NULL;
844 tap_queue_packet(bluetooth_hci_summary_tap, pinfo, tap_hci_summary);
847 proto_tree_add_item(main_tree, hf_android_parameter_length, tvb, offset, 1, ENC_NA);
848 length = tvb_get_uint8(tvb, offset);
849 offset += 1;
851 switch (event_code) {
852 case 0x0e: /* Command Complete */
853 proto_tree_add_item(main_tree, hf_android_number_of_allowed_command_packets, tvb, offset, 1, ENC_NA);
854 offset += 1;
856 opcode_item = proto_tree_add_item(main_tree, hf_android_opcode, tvb, offset, 2, ENC_LITTLE_ENDIAN);
857 opcode_tree = proto_item_add_subtree(opcode_item, ett_android_opcode);
858 opcode = tvb_get_letohs(tvb, offset);
859 proto_tree_add_item(opcode_tree, hf_android_opcode_ogf, tvb, offset, 2, ENC_LITTLE_ENDIAN);
861 proto_tree_add_item(opcode_tree, hf_android_opcode_ocf, tvb, offset, 2, ENC_LITTLE_ENDIAN);
862 ocf = opcode & 0x03ff;
863 offset += 2;
865 description = val_to_str_const(ocf, android_opcode_ocf_vals, "unknown");
866 if (g_strcmp0(description, "unknown") != 0)
867 col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", description);
868 else
869 col_append_fstr(pinfo->cinfo, COL_INFO, " (Unknown Command 0x%04X [opcode 0x%04X])", ocf, opcode);
871 if (have_tap_listener(bluetooth_hci_summary_tap)) {
872 bluetooth_hci_summary_tap_t *tap_hci_summary;
874 tap_hci_summary = wmem_new(pinfo->pool, bluetooth_hci_summary_tap_t);
875 tap_hci_summary->interface_id = interface_id;
876 tap_hci_summary->adapter_id = adapter_id;
878 tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_VENDOR_EVENT_OPCODE;
879 tap_hci_summary->ogf = opcode >> 10;
880 tap_hci_summary->ocf = ocf;
881 if (try_val_to_str(ocf, android_opcode_ocf_vals))
882 tap_hci_summary->name = description;
883 else
884 tap_hci_summary->name = NULL;
885 tap_queue_packet(bluetooth_hci_summary_tap, pinfo, tap_hci_summary);
888 proto_tree_add_item(main_tree, hf_android_status, tvb, offset, 1, ENC_NA);
889 status = tvb_get_uint8(tvb, offset);
890 offset += 1;
892 switch (ocf) {
893 case 0x0153: /* LE Get Vendor Capabilities */
894 if (status != STATUS_SUCCESS)
895 break;
897 uint16_t google_feature_spec_version = tvb_get_uint16(tvb, offset + 8, ENC_LITTLE_ENDIAN);
898 if (google_feature_spec_version < 0x0098) {
899 proto_tree_add_item(main_tree, hf_android_max_advertising_instance, tvb, offset, 1, ENC_NA);
900 } else {
901 proto_tree_add_item(main_tree, hf_android_max_advertising_instance_reserved, tvb, offset, 1, ENC_NA);
903 offset += 1;
905 if (google_feature_spec_version < 0x0098) {
906 proto_tree_add_item(main_tree, hf_android_resolvable_private_address_offloading, tvb, offset, 1, ENC_NA);
907 } else {
908 proto_tree_add_item(main_tree, hf_android_resolvable_private_address_offloading_reserved, tvb, offset, 1, ENC_NA);
910 offset += 1;
912 proto_tree_add_item(main_tree, hf_android_total_scan_results, tvb, offset, 2, ENC_LITTLE_ENDIAN);
913 offset += 2;
915 proto_tree_add_item(main_tree, hf_android_max_irk_list, tvb, offset, 1, ENC_NA);
916 offset += 1;
918 proto_tree_add_item(main_tree, hf_android_filter_support, tvb, offset, 1, ENC_NA);
919 offset += 1;
921 proto_tree_add_item(main_tree, hf_android_max_filter, tvb, offset, 1, ENC_NA);
922 offset += 1;
924 proto_tree_add_item(main_tree, hf_android_energy_support, tvb, offset, 1, ENC_NA);
925 offset += 1;
927 proto_tree_add_item(main_tree, hf_android_version_support, tvb, offset, 2, ENC_LITTLE_ENDIAN);
928 offset += 2;
930 proto_tree_add_item(main_tree, hf_android_total_num_of_advt_tracked, tvb, offset, 2, ENC_LITTLE_ENDIAN);
931 offset += 2;
933 proto_tree_add_item(main_tree, hf_android_extended_scan_support, tvb, offset, 1, ENC_NA);
934 offset += 1;
936 proto_tree_add_item(main_tree, hf_android_debug_logging_support, tvb, offset, 1, ENC_NA);
937 offset += 1;
939 if (google_feature_spec_version < 0x0098) {
940 proto_tree_add_item(main_tree, hf_android_le_address_generation_offloading_support, tvb, offset, 1, ENC_NA);
941 } else {
942 proto_tree_add_item(main_tree, hf_android_le_address_generation_offloading_support_reserved, tvb, offset, 1, ENC_NA);
944 offset += 1;
946 proto_tree_add_bitmask(main_tree, tvb, offset, hf_android_a2dp_source_offload_capability_mask, ett_android_a2dp_source_offload_capability_mask, hfx_android_a2dp_source_offload_capability, ENC_LITTLE_ENDIAN);
947 offset += 4;
949 proto_tree_add_item(main_tree, hf_android_bluetooth_quality_report_support, tvb, offset, 1, ENC_NA);
950 offset += 1;
952 proto_tree_add_bitmask(main_tree, tvb, offset, hf_android_dynamic_audio_buffer_support_mask, ett_android_dynamic_audio_buffer_support_mask, hfx_android_dynamic_audio_buffer_support, ENC_LITTLE_ENDIAN);
953 offset += 4;
955 if (tvb_captured_length_remaining(tvb, offset) > 0) {
956 proto_tree_add_item(main_tree, hf_android_a2dp_offload_v2_support, tvb, offset, 1, ENC_NA);
957 offset += 1;
960 break;
961 case 0x0154: /* LE Multi Advertising */
962 proto_tree_add_item(main_tree, hf_android_le_multi_advertising_subcode, tvb, offset, 1, ENC_NA);
963 offset += 1;
965 break;
966 case 0x0156: /* LE Batch Scan */
967 proto_tree_add_item(main_tree, hf_android_le_batch_scan_subcode, tvb, offset, 1, ENC_NA);
968 subcode = tvb_get_uint8(tvb, offset);
969 offset += 1;
971 if (subcode == 0x04 && status == STATUS_SUCCESS) { /* Read Results*/
972 proto_tree_add_item(main_tree, hf_android_le_batch_scan_report_format, tvb, offset, 1, ENC_NA);
973 offset += 1;
975 proto_tree_add_item(main_tree, hf_android_le_batch_scan_number_of_records, tvb, offset, 1, ENC_NA);
976 offset += 1;
980 break;
981 case 0x0157: /* LE Advertising Filter */
982 proto_tree_add_item(main_tree, hf_android_le_advertising_filter_subcode, tvb, offset, 1, ENC_NA);
983 offset += 1;
985 if (status == STATUS_SUCCESS) {
986 proto_tree_add_item(main_tree, hf_android_le_scan_condition, tvb, offset, 1, ENC_NA);
987 offset += 1;
989 proto_tree_add_item(main_tree, hf_android_le_number_of_available_filters, tvb, offset, 1, ENC_NA);
990 offset += 1;
993 break;
994 case 0x0159: /* LE Energy Info */
995 if (status == STATUS_SUCCESS) {
996 proto_tree_add_item(main_tree, hf_android_le_energy_total_rx_time, tvb, offset, 1, ENC_NA);
997 offset += 1;
999 proto_tree_add_item(main_tree, hf_android_le_energy_total_tx_time, tvb, offset, 1, ENC_NA);
1000 offset += 1;
1002 proto_tree_add_item(main_tree, hf_android_le_energy_total_idle_time, tvb, offset, 1, ENC_NA);
1003 offset += 1;
1005 proto_tree_add_item(main_tree, hf_android_le_energy_total_energy_used, tvb, offset, 1, ENC_NA);
1006 offset += 1;
1009 break;
1010 case 0x015D: /* A2DP Hardware Offload */
1011 proto_tree_add_item(main_tree, hf_android_a2dp_hardware_offload_subcode, tvb, offset, 1, ENC_NA);
1012 offset += 1;
1014 break;
1015 default:
1016 if (length > 0) {
1017 sub_item = proto_tree_add_item(main_tree, hf_android_data, tvb, offset, length, ENC_NA);
1018 expert_add_info(pinfo, sub_item, &ei_android_undecoded);
1019 offset += length;
1023 break;
1024 default:
1025 if (length > 0) {
1026 sub_item = proto_tree_add_item(main_tree, hf_android_data, tvb, offset, length, ENC_NA);
1027 expert_add_info(pinfo, sub_item, &ei_android_undecoded);
1028 offset += length;
1033 break;
1035 case P2P_DIR_UNKNOWN:
1036 default:
1037 col_set_str(pinfo->cinfo, COL_PROTOCOL, "HCI_ANDROID");
1038 col_set_str(pinfo->cinfo, COL_INFO, "UnknownDirection Android ");
1040 if (tvb_captured_length_remaining(tvb, offset) > 0) {
1041 proto_tree_add_item(main_tree, hf_android_data, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
1042 offset += tvb_captured_length_remaining(tvb, offset);
1044 break;
1047 if (tvb_captured_length_remaining(tvb, offset) > 0) {
1048 sub_item = proto_tree_add_item(main_tree, hf_android_data, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
1049 expert_add_info(pinfo, sub_item, &ei_android_unexpected_data);
1050 offset += tvb_captured_length_remaining(tvb, offset);
1053 return offset;
1056 void
1057 proto_register_bthci_vendor_android(void)
1059 expert_module_t *expert_module;
1061 static hf_register_info hf[] = {
1062 { &hf_android_opcode,
1063 { "Command Opcode", "bthci_vendor.android.opcode",
1064 FT_UINT16, BASE_HEX, VALS(android_opcode_vals), 0x0,
1065 "HCI Command Opcode", HFILL }
1067 { &hf_android_opcode_ogf,
1068 { "Opcode Group Field", "bthci_vendor.android.opcode.ogf",
1069 FT_UINT16, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_ogf_vals_ext, 0xfc00,
1070 NULL, HFILL }
1072 { &hf_android_opcode_ocf,
1073 { "Opcode Command Field", "bthci_vendor.android.opcode.ocf",
1074 FT_UINT16, BASE_HEX, VALS(android_opcode_ocf_vals), 0x03ff,
1075 NULL, HFILL }
1077 { &hf_android_parameter_length,
1078 { "Parameter Total Length", "bthci_vendor.android.parameter_length",
1079 FT_UINT8, BASE_DEC, NULL, 0x0,
1080 NULL, HFILL }
1082 { &hf_android_event_code,
1083 { "Event Code", "bthci_vendor.android.event_code",
1084 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_evt_evt_code_vals_ext, 0x0,
1085 NULL, HFILL }
1087 { &hf_android_number_of_allowed_command_packets,
1088 { "Number of Allowed Command Packets", "bthci_vendor.android.number_of_allowed_command_packets",
1089 FT_UINT8, BASE_DEC, NULL, 0x0,
1090 NULL, HFILL }
1092 { &hf_android_le_advertising_filter_subcode,
1093 { "Subcode", "bthci_vendor.android.le.advertising_filter.subcode",
1094 FT_UINT8, BASE_HEX, VALS(android_le_subcode_advertising_filter_vals), 0x0,
1095 NULL, HFILL }
1097 { &hf_android_le_scan_condition,
1098 { "Scan Condition", "bthci_vendor.android.le.scan_condition",
1099 FT_UINT8, BASE_HEX, VALS(android_le_scan_condition_vals), 0x0,
1100 NULL, HFILL }
1102 { &hf_android_le_filter_index,
1103 { "Filter Index", "bthci_vendor.android.le.filter_index",
1104 FT_UINT8, BASE_DEC, NULL, 0x0,
1105 NULL, HFILL }
1107 { &hf_android_le_number_of_available_filters,
1108 { "Number of Available Filters", "bthci_vendor.android.le.number_of_available_filters",
1109 FT_UINT8, BASE_DEC, NULL, 0x0,
1110 NULL, HFILL }
1112 { &hf_android_bd_addr,
1113 { "BD_ADDR", "bthci_vendor.android.bd_addr",
1114 FT_ETHER, BASE_NONE, NULL, 0x0,
1115 "Bluetooth Device Address", HFILL}
1117 { &hf_android_max_advertising_instance,
1118 { "Max Advertising Instance", "bthci_vendor.android.max_advertising_instance",
1119 FT_UINT8, BASE_DEC, NULL, 0x0,
1120 NULL, HFILL }
1122 { &hf_android_max_advertising_instance_reserved,
1123 { "Reserved", "bthci_vendor.android.max_advertising_instance_reserved",
1124 FT_UINT8, BASE_HEX, NULL, 0x0,
1125 NULL, HFILL }
1127 { &hf_android_resolvable_private_address_offloading,
1128 { "Resolvable Private Address Offloading", "bthci_vendor.android.resolvable_private_address_offloading",
1129 FT_UINT8, BASE_DEC, NULL, 0x0,
1130 NULL, HFILL }
1132 { &hf_android_resolvable_private_address_offloading_reserved,
1133 { "Reserved", "bthci_vendor.android.resolvable_private_address_offloading_reserved",
1134 FT_UINT8, BASE_HEX, NULL, 0x0,
1135 NULL, HFILL }
1137 { &hf_android_total_scan_results,
1138 { "Total Scan Results", "bthci_vendor.android.total_scan_results",
1139 FT_UINT16, BASE_DEC, NULL, 0x0,
1140 NULL, HFILL }
1142 { &hf_android_max_irk_list,
1143 { "Max IRK List", "bthci_vendor.android.max_irk_list",
1144 FT_UINT8, BASE_DEC, NULL, 0x0,
1145 NULL, HFILL }
1147 { &hf_android_filter_support,
1148 { "Filter Support", "bthci_vendor.android.filter_support",
1149 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1150 NULL, HFILL }
1152 { &hf_android_max_filter,
1153 { "Max Filter", "bthci_vendor.android.max_filter",
1154 FT_UINT8, BASE_DEC, NULL, 0x0,
1155 NULL, HFILL }
1157 { &hf_android_energy_support,
1158 { "Energy Support", "bthci_vendor.android.energy_support",
1159 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1160 NULL, HFILL }
1162 { &hf_android_version_support,
1163 { "Version Support", "bthci_vendor.android.version_support",
1164 FT_UINT16, BASE_HEX, NULL, 0x0,
1165 NULL, HFILL }
1167 { &hf_android_total_num_of_advt_tracked,
1168 { "Total Number of Advertisers Tracked", "bthci_vendor.android.total_num_of_advt_tracked",
1169 FT_UINT16, BASE_DEC, NULL, 0x0,
1170 NULL, HFILL }
1172 { &hf_android_extended_scan_support,
1173 { "Extended Scan Support", "bthci_vendor.android.extended_scan_support",
1174 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1175 NULL, HFILL }
1177 { &hf_android_debug_logging_support,
1178 { "Debug Logging Support", "bthci_vendor.android.debug_logging_support",
1179 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1180 NULL, HFILL }
1182 { &hf_android_le_address_generation_offloading_support,
1183 { "LE Address Generation Offloading Support", "bthci_vendor.android.le_address_generation_offloading_support",
1184 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1185 NULL, HFILL }
1187 { &hf_android_le_address_generation_offloading_support_reserved,
1188 { "Reserved", "bthci_vendor.android.le_address_generation_offloading_support_reserved",
1189 FT_UINT8, BASE_HEX, NULL, 0x0,
1190 NULL, HFILL }
1192 { &hf_android_a2dp_source_offload_capability_mask,
1193 { "A2DP Source Offload Capability", "bthci_vendor.android.a2dp_source_offload_capability_mask",
1194 FT_UINT32, BASE_HEX, NULL, 0x0,
1195 NULL, HFILL }
1197 { &hf_android_a2dp_source_offload_capability_mask_sbc,
1198 { "SBC", "bthci_vendor.android.a2dp_source_offload_capability_mask.sbc",
1199 FT_BOOLEAN, 32, NULL, 0x00000001,
1200 NULL, HFILL }
1202 { &hf_android_a2dp_source_offload_capability_mask_aac,
1203 { "AAC", "bthci_vendor.android.a2dp_source_offload_capability_mask.aac",
1204 FT_BOOLEAN, 32, NULL, 0x00000002,
1205 NULL, HFILL }
1207 { &hf_android_a2dp_source_offload_capability_mask_aptx,
1208 { "APTX", "bthci_vendor.android.a2dp_source_offload_capability_mask.aptx",
1209 FT_BOOLEAN, 32, NULL, 0x00000004,
1210 NULL, HFILL }
1212 { &hf_android_a2dp_source_offload_capability_mask_aptx_hd,
1213 { "APTX HD", "bthci_vendor.android.a2dp_source_offload_capability_mask.aptx_hd",
1214 FT_BOOLEAN, 32, NULL, 0x00000008,
1215 NULL, HFILL }
1217 { &hf_android_a2dp_source_offload_capability_mask_ldac,
1218 { "LDAC", "bthci_vendor.android.a2dp_source_offload_capability_mask.ldac",
1219 FT_BOOLEAN, 32, NULL, 0x00000010,
1220 NULL, HFILL }
1222 { &hf_android_a2dp_source_offload_capability_mask_reserved,
1223 { "Reserved", "bthci_vendor.android.a2dp_source_offload_capability_mask.reserved",
1224 FT_UINT32, BASE_HEX, NULL, UINT32_C(0xFFFFFFE0),
1225 NULL, HFILL }
1227 { &hf_android_bluetooth_quality_report_support,
1228 { "Bluetooth Quality Report Support", "bthci_vendor.android.bluetooth_quality_report_support",
1229 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1230 NULL, HFILL }
1232 { &hf_android_dynamic_audio_buffer_support_mask,
1233 { "Dynamic Audio Buffer Support", "bthci_vendor.android.dynamic_audio_buffer_support_mask",
1234 FT_UINT32, BASE_HEX, NULL, 0x0,
1235 NULL, HFILL }
1237 { &hf_android_dynamic_audio_buffer_support_mask_sbc,
1238 { "SBC", "bthci_vendor.android.dynamic_audio_buffer_support_mask.sbc",
1239 FT_BOOLEAN, 32, NULL, 0x00000001,
1240 NULL, HFILL }
1242 { &hf_android_dynamic_audio_buffer_support_mask_aac,
1243 { "AAC", "bthci_vendor.android.dynamic_audio_buffer_support_mask.aac",
1244 FT_BOOLEAN, 32, NULL, 0x00000002,
1245 NULL, HFILL }
1247 { &hf_android_dynamic_audio_buffer_support_mask_aptx,
1248 { "APTX", "bthci_vendor.android.dynamic_audio_buffer_support_mask.aptx",
1249 FT_BOOLEAN, 32, NULL, 0x00000004,
1250 NULL, HFILL }
1252 { &hf_android_dynamic_audio_buffer_support_mask_aptx_hd,
1253 { "APTX HD", "bthci_vendor.android.dynamic_audio_buffer_support_mask.aptx_hd",
1254 FT_BOOLEAN, 32, NULL, 0x00000008,
1255 NULL, HFILL }
1257 { &hf_android_dynamic_audio_buffer_support_mask_ldac,
1258 { "LDAC", "bthci_vendor.android.dynamic_audio_buffer_support_mask.ldac",
1259 FT_BOOLEAN, 32, NULL, 0x00000010,
1260 NULL, HFILL }
1262 { &hf_android_dynamic_audio_buffer_support_mask_reserved,
1263 { "Reserved", "bthci_vendor.android.dynamic_audio_buffer_support_mask.reserved",
1264 FT_UINT32, BASE_HEX, NULL, UINT32_C(0xFFFFFFE0),
1265 NULL, HFILL }
1267 { &hf_android_a2dp_offload_v2_support,
1268 { "A2DP Offload V2 Support", "bthci_vendor.android.a2dp_offload_v2_support",
1269 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1270 NULL, HFILL }
1272 { &hf_android_status,
1273 { "Status", "bthci_vendor.android.status",
1274 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_status_vals_ext, 0x0,
1275 NULL, HFILL }
1277 { &hf_android_le_energy_total_rx_time,
1278 { "Total RX Time", "bthci_vendor.android.le.total_rx_time",
1279 FT_UINT32, BASE_DEC, NULL, 0x0,
1280 NULL, HFILL }
1282 { &hf_android_le_energy_total_tx_time,
1283 { "Total TX Time", "bthci_vendor.android.le.total_tx_time",
1284 FT_UINT32, BASE_DEC, NULL, 0x0,
1285 NULL, HFILL }
1287 { &hf_android_le_energy_total_idle_time,
1288 { "Total Idle Time", "bthci_vendor.android.le.total_idle_time",
1289 FT_UINT32, BASE_DEC, NULL, 0x0,
1290 NULL, HFILL }
1292 { &hf_android_le_energy_total_energy_used,
1293 { "Total Energy Used Time", "bthci_vendor.android.le.total_energy_used",
1294 FT_UINT32, BASE_DEC, NULL, 0x0,
1295 NULL, HFILL }
1297 { &hf_android_le_batch_scan_subcode,
1298 { "Subcode", "bthci_vendor.android.le.batch_scan.subcode",
1299 FT_UINT8, BASE_HEX, VALS(android_le_subcode_batch_scan_vals), 0x0,
1300 NULL, HFILL }
1302 { &hf_android_le_batch_scan_report_format,
1303 { "Report Format", "bthci_vendor.android.le.batch_scan.report_format",
1304 FT_UINT8, BASE_DEC, NULL, 0x0,
1305 NULL, HFILL }
1307 { &hf_android_le_batch_scan_number_of_records,
1308 { "Number of Records", "bthci_vendor.android.le.batch_scan.number_of_records",
1309 FT_UINT8, BASE_DEC, NULL, 0x0,
1310 NULL, HFILL }
1312 { &hf_android_le_batch_scan_mode,
1313 { "Mode", "bthci_vendor.android.le.batch_scan.mode",
1314 FT_UINT8, BASE_HEX, VALS(android_batch_scan_mode_vals), 0x0,
1315 NULL, HFILL }
1317 { &hf_android_le_batch_scan_enable,
1318 { "Enable", "bthci_vendor.android.le.batch_scan.enable",
1319 FT_UINT8, BASE_HEX, VALS(android_disable_enable_vals), 0x0,
1320 NULL, HFILL }
1322 { &hf_android_le_batch_scan_full_max,
1323 { "Full Max", "bthci_vendor.android.le.batch_scan.full_max",
1324 FT_UINT8, BASE_DEC, NULL, 0x0,
1325 NULL, HFILL }
1327 { &hf_android_le_batch_scan_truncate_max,
1328 { "Truncate Max", "bthci_vendor.android.le.batch_scan.truncate_max",
1329 FT_UINT8, BASE_DEC, NULL, 0x0,
1330 NULL, HFILL }
1332 { &hf_android_le_batch_scan_notify_threshold,
1333 { "notify_threshold", "bthci_vendor.android.le.batch_scan.notify_threshold",
1334 FT_UINT8, BASE_DEC, NULL, 0x0,
1335 NULL, HFILL }
1337 { &hf_android_le_batch_scan_window,
1338 { "Window", "bthci_vendor.android.le.batch_scan.window",
1339 FT_UINT32, BASE_DEC, NULL, 0x0,
1340 NULL, HFILL }
1342 { &hf_android_le_batch_scan_interval,
1343 { "Interval", "bthci_vendor.android.le.batch_scan.interval",
1344 FT_UINT32, BASE_DEC, NULL, 0x0,
1345 NULL, HFILL }
1347 { &hf_android_le_batch_scan_address_type,
1348 { "Address Type", "bthci_vendor.android.le.batch_scan.address_type",
1349 FT_UINT8, BASE_HEX, VALS(bluetooth_address_type_vals), 0x0,
1350 NULL, HFILL }
1352 { &hf_android_le_batch_scan_discard_rule,
1353 { "Discard Rule", "bthci_vendor.android.le.batch_scan.discard_rule",
1354 FT_UINT8, BASE_HEX, VALS(android_batch_scan_discard_rule_vals), 0x0,
1355 NULL, HFILL }
1357 { &hf_android_le_multi_advertising_subcode,
1358 { "Subcode", "bthci_vendor.android.le.multi_advertising.subcode",
1359 FT_UINT8, BASE_HEX, VALS(android_le_subcode_multi_advertising_vals), 0x0,
1360 NULL, HFILL }
1362 { &hf_android_le_multi_advertising_enable,
1363 { "Enable", "bthci_vendor.android.le.multi_advertising.enable",
1364 FT_UINT8, BASE_HEX, VALS(android_disable_enable_vals), 0x0,
1365 NULL, HFILL }
1367 { &hf_android_le_multi_advertising_instance_id,
1368 { "Instance Id", "bthci_vendor.android.le.multi_advertising.instance_id",
1369 FT_UINT8, BASE_DEC, NULL, 0x0,
1370 NULL, HFILL }
1372 { &hf_android_le_multi_advertising_min_interval,
1373 { "Min Interval", "bthci_vendor.android.le.multi_advertising.min_interval",
1374 FT_UINT16, BASE_DEC, NULL, 0x0,
1375 NULL, HFILL }
1377 { &hf_android_le_multi_advertising_max_interval,
1378 { "Max Interval", "bthci_vendor.android.le.multi_advertising.max_interval",
1379 FT_UINT16, BASE_DEC, NULL, 0x0,
1380 NULL, HFILL }
1382 { &hf_android_le_multi_advertising_address_type,
1383 { "Address Type", "bthci_vendor.android.le.multi_advertising.address_type",
1384 FT_UINT8, BASE_HEX, VALS(bluetooth_address_type_vals), 0x0,
1385 NULL, HFILL }
1387 { &hf_android_le_multi_advertising_type,
1388 { "Type", "bthci_vendor.android.le.multi_advertising.type",
1389 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_eir_data_type_vals_ext, 0x0,
1390 NULL, HFILL }
1392 { &hf_android_le_multi_advertising_channel_map,
1393 { "Channel Map", "bthci_vendor.android.le.multi_advertising.channel_map",
1394 FT_UINT8, BASE_HEX, NULL, 0x0,
1395 NULL, HFILL }
1397 { &hf_android_le_multi_advertising_channel_map_reserved,
1398 { "Reserved", "bthci_vendor.android.le.multi_advertising.channel_map.reserved",
1399 FT_UINT8, BASE_HEX, NULL, 0xF8,
1400 NULL, HFILL }
1402 { &hf_android_le_multi_advertising_channel_map_39,
1403 { "Channel 39", "bthci_vendor.android.le.multi_advertising.channel_map.39",
1404 FT_UINT8, BASE_HEX, NULL, 0x04,
1405 NULL, HFILL }
1407 { &hf_android_le_multi_advertising_channel_map_38,
1408 { "Channel 38", "bthci_vendor.android.le.multi_advertising.channel_map.38",
1409 FT_UINT8, BASE_HEX, NULL, 0x02,
1410 NULL, HFILL }
1412 { &hf_android_le_multi_advertising_channel_map_37,
1413 { "Channel 37", "bthci_vendor.android.le.multi_advertising.channel_map.37",
1414 FT_UINT8, BASE_HEX, NULL, 0x01,
1415 NULL, HFILL }
1417 { &hf_android_le_multi_advertising_filter_policy,
1418 { "Filter Policy", "bthci_vendor.android.le.multi_advertising.filter_policy",
1419 FT_UINT8, BASE_HEX, VALS(android_le_filter_policy_vals), 0x0,
1420 NULL, HFILL }
1422 { &hf_android_le_multi_advertising_tx_power,
1423 { "Tx power", "bthci_vendor.android.le.multi_advertising.tx_power",
1424 FT_UINT8, BASE_HEX, NULL, 0x0,
1425 NULL, HFILL }
1427 { &hf_android_data,
1428 { "Data", "bthci_vendor.android.data",
1429 FT_NONE, BASE_NONE, NULL, 0x0,
1430 NULL, HFILL }
1432 { &hf_android_a2dp_hardware_offload_subcode,
1433 { "Subcode", "bthci_vendor.android.a2dp_hardware_offload.subcode",
1434 FT_UINT8, BASE_HEX, VALS(android_a2dp_hardware_offload_vals), 0x0,
1435 NULL, HFILL }
1437 { &hf_android_a2dp_hardware_offload_start_legacy_codec,
1438 { "Codec", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.codec",
1439 FT_UINT32, BASE_HEX, VALS(android_a2dp_hardware_offload_start_legacy_codec_vals), 0x0,
1440 NULL, HFILL }
1442 { &hf_android_a2dp_hardware_offload_start_legacy_max_latency,
1443 { "Max Latency", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.max_latency",
1444 FT_UINT16, BASE_DEC, NULL, 0x0,
1445 NULL, HFILL }
1447 { &hf_android_a2dp_hardware_offload_start_legacy_scms_t_enable_flag,
1448 { "SCMS-T Enable", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.scms_t_enable_flag",
1449 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1450 NULL, HFILL }
1452 { &hf_android_a2dp_hardware_offload_start_legacy_scms_t_enable_value,
1453 { "SCMS-T Value", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.scms_t_enable_value",
1454 FT_UINT8, BASE_DEC, NULL, 0x0,
1455 NULL, HFILL }
1457 { &hf_android_a2dp_hardware_offload_start_legacy_scms_t_enable_value_reserved,
1458 { "Reserved", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.scms_t_enable_value_reserved",
1459 FT_UINT8, BASE_HEX, NULL, 0x0,
1460 NULL, HFILL }
1462 { &hf_android_a2dp_hardware_offload_start_legacy_sampling_frequency,
1463 { "Sampling Frequency", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.sampling_frequency",
1464 FT_UINT32, BASE_HEX, VALS(android_a2dp_hardware_offload_start_legacy_sampling_frequency_vals), 0x0,
1465 NULL, HFILL }
1467 { &hf_android_a2dp_hardware_offload_start_legacy_bits_per_sample,
1468 { "Bits Per Sample", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.bits_per_sample",
1469 FT_UINT8, BASE_HEX, VALS(android_a2dp_hardware_offload_start_legacy_bits_per_sample_vals), 0x0,
1470 NULL, HFILL }
1472 { &hf_android_a2dp_hardware_offload_start_legacy_channel_mode,
1473 { "Channel Mode", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.channel_mode",
1474 FT_UINT8, BASE_HEX, VALS(android_a2dp_hardware_offload_start_legacy_channel_mode_vals), 0x0,
1475 NULL, HFILL }
1477 { &hf_android_a2dp_hardware_offload_start_legacy_encoded_audio_bitrate,
1478 { "Encoded Audio Bitrate", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.encoded_audio_bitrate",
1479 FT_UINT32, BASE_DEC, NULL, 0x0,
1480 NULL, HFILL }
1482 { &hf_android_a2dp_hardware_offload_start_legacy_encoded_audio_bitrate_unspecified,
1483 { "Encoded Audio Bitrate Unspecified/Unused", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.encoded_audio_bitrate_unspecified",
1484 FT_UINT32, BASE_DEC, NULL, 0x0,
1485 NULL, HFILL }
1487 { &hf_android_a2dp_hardware_offload_start_legacy_encoded_audio_bitrate_reserved,
1488 { "Reserved", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.encoded_audio_bitrate_reserved",
1489 FT_UINT32, BASE_HEX, NULL, 0x0,
1490 NULL, HFILL }
1492 { &hf_android_a2dp_hardware_offload_start_legacy_connection_handle,
1493 { "Connection Handle", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.connection_handle",
1494 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
1495 NULL, HFILL }
1497 { &hf_android_a2dp_hardware_offload_start_legacy_l2cap_cid,
1498 { "L2CAP CID", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.l2cap_cid",
1499 FT_UINT16, BASE_HEX, NULL, 0x0,
1500 NULL, HFILL }
1502 { &hf_android_a2dp_hardware_offload_start_legacy_l2cap_mtu_size,
1503 { "L2CAP MTU Size", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.l2cap_mtu_size",
1504 FT_UINT16, BASE_DEC, NULL, 0x0,
1505 NULL, HFILL }
1507 { &hf_android_a2dp_hardware_offload_start_legacy_codec_information,
1508 { "Codec Information", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.codec_information",
1509 FT_BYTES, BASE_NONE, NULL, 0x0,
1510 NULL, HFILL }
1512 { &hf_android_a2dp_hardware_offload_start_legacy_codec_information_sbc_block_length,
1513 { "Block Length", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.codec_information.sbc.block_length",
1514 FT_UINT8, BASE_HEX, VALS(android_a2dp_hardware_offload_start_legacy_codec_information_sbc_block_length_vals), 0xf0,
1515 NULL, HFILL }
1517 { &hf_android_a2dp_hardware_offload_start_legacy_codec_information_sbc_subbands,
1518 { "Subbands", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.codec_information.sbc.subbands",
1519 FT_UINT8, BASE_HEX, VALS(android_a2dp_hardware_offload_start_legacy_codec_information_sbc_subbands_vals), 0x0c,
1520 NULL, HFILL }
1522 { &hf_android_a2dp_hardware_offload_start_legacy_codec_information_sbc_allocation_method,
1523 { "Allocation Method", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.codec_information.sbc.allocation_method",
1524 FT_UINT8, BASE_HEX, VALS(android_a2dp_hardware_offload_start_legacy_codec_information_sbc_allocation_method_vals), 0x03,
1525 NULL, HFILL }
1527 { &hf_android_a2dp_hardware_offload_start_legacy_codec_information_sbc_min_bitpool,
1528 { "Min Bitpool", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.codec_information.sbc.min_bitpool",
1529 FT_UINT8, BASE_DEC, NULL, 0x0,
1530 NULL, HFILL }
1532 { &hf_android_a2dp_hardware_offload_start_legacy_codec_information_sbc_max_bitpool,
1533 { "Max Bitpool", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.codec_information.sbc.max_bitpool",
1534 FT_UINT8, BASE_DEC, NULL, 0x0,
1535 NULL, HFILL }
1537 { &hf_android_a2dp_hardware_offload_start_legacy_codec_information_sbc_sampling_frequency,
1538 { "Sampling Frequency", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.codec_information.sbc.sampling_frequency",
1539 FT_UINT8, BASE_HEX, VALS(android_a2dp_hardware_offload_start_legacy_sbc_sampling_frequency_vals), 0xf0,
1540 NULL, HFILL }
1542 { &hf_android_a2dp_hardware_offload_start_legacy_codec_information_sbc_channel_mode,
1543 { "Channel Mode", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.codec_information.sbc.channel_mode",
1544 FT_UINT8, BASE_HEX, VALS(android_a2dp_hardware_offload_start_legacy_sbc_channel_mode_vals), 0x0f,
1545 NULL, HFILL }
1547 { &hf_android_a2dp_hardware_offload_start_legacy_codec_information_sbc_reserved,
1548 { "Reserved", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.codec_information.sbc.reserved",
1549 FT_BYTES, BASE_NONE, NULL, 0x0,
1550 NULL, HFILL }
1552 { &hf_android_a2dp_hardware_offload_start_legacy_codec_information_aac_object_type,
1553 { "Object Type", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.codec_information.aac.object_type",
1554 FT_UINT8, BASE_HEX, VALS(android_a2dp_hardware_offload_start_legacy_aac_object_type_vals), 0x0,
1555 NULL, HFILL }
1557 { &hf_android_a2dp_hardware_offload_start_legacy_codec_information_aac_vbr,
1558 { "VBR", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.codec_information.aac.vbr",
1559 FT_BOOLEAN, 8, NULL, 0x80,
1560 NULL, HFILL }
1562 { &hf_android_a2dp_hardware_offload_start_legacy_codec_information_aac_reserved,
1563 { "Reserved", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.codec_information.aac.reserved",
1564 FT_BYTES, BASE_NONE, NULL, 0x0,
1565 NULL, HFILL }
1567 { &hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_vendor_id,
1568 { "Vendor ID", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.codec_information.ldac.vendor_id",
1569 FT_UINT32, BASE_HEX, NULL, 0x0,
1570 NULL, HFILL }
1572 { &hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_codec_id,
1573 { "Codec ID", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.codec_information.ldac.codec_id",
1574 FT_UINT16, BASE_HEX, NULL, 0x0,
1575 NULL, HFILL }
1577 { &hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_bitrate_index,
1578 { "Bitrate Index", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.codec_information.ldac.bitrate_index",
1579 FT_UINT8, BASE_HEX, VALS(android_a2dp_hardware_offload_start_legacy_codec_information_ldac_bitrate_index_vals), 0x0,
1580 NULL, HFILL }
1582 { &hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_bitrate_index_reserved,
1583 { "Reserved", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.codec_information.ldac.bitrate_index.reserved",
1584 FT_UINT8, BASE_HEX, NULL, 0x0,
1585 NULL, HFILL }
1587 { &hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_channel_mode_mask,
1588 { "Channel Mode", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.codec_information.ldac.channel_mode_mask",
1589 FT_UINT8, BASE_HEX, NULL, 0x0,
1590 NULL, HFILL }
1592 { &hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_channel_mode_mask_stereo,
1593 { "Stereo", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.codec_information.ldac.channel_mode_mask.stereo",
1594 FT_BOOLEAN, 8, NULL, 0x01,
1595 NULL, HFILL }
1597 { &hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_channel_mode_mask_dual,
1598 { "Dual", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.codec_information.ldac.channel_mode_mask.dual",
1599 FT_BOOLEAN, 8, NULL, 0x02,
1600 NULL, HFILL }
1602 { &hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_channel_mode_mask_mono,
1603 { "Mono", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.codec_information.ldac.channel_mode_mask.mono",
1604 FT_BOOLEAN, 8, NULL, 0x04,
1605 NULL, HFILL }
1607 { &hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_channel_mode_mask_reserved,
1608 { "Reserved", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.codec_information.ldac.channel_mode_mask.reserved",
1609 FT_UINT8, BASE_HEX, NULL, UINT32_C(0xF8),
1610 NULL, HFILL }
1612 { &hf_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_reserved,
1613 { "Reserved", "bthci_vendor.android.a2dp_hardware_offload.start_legacy.codec_information.ldac.reserved",
1614 FT_BYTES, BASE_NONE, NULL, 0x0,
1615 NULL, HFILL }
1617 { &hf_android_a2dp_hardware_offload_start_connection_handle,
1618 { "Connection Handle", "bthci_vendor.android.a2dp_hardware_offload.start.connection_handle",
1619 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
1620 NULL, HFILL }
1622 { &hf_android_a2dp_hardware_offload_start_l2cap_cid,
1623 { "L2CAP CID", "bthci_vendor.android.a2dp_hardware_offload.start.l2cap_cid",
1624 FT_UINT16, BASE_HEX, NULL, 0x0,
1625 NULL, HFILL }
1627 { &hf_android_a2dp_hardware_offload_start_data_path_direction,
1628 { "Data Path Direction", "bthci_vendor.android.a2dp_hardware_offload.start.data_path_direction",
1629 FT_UINT8, BASE_HEX, VALS(android_a2dp_hardware_offload_data_path_direction_vals), 0x0,
1630 NULL, HFILL }
1632 { &hf_android_a2dp_hardware_offload_start_peer_mtu,
1633 { "Peer MTU", "bthci_vendor.android.a2dp_hardware_offload.start.peer_mtu",
1634 FT_UINT16, BASE_DEC, NULL, 0x0,
1635 NULL, HFILL }
1637 { &hf_android_a2dp_hardware_offload_start_cp_enable_scmst,
1638 { "CP Enable SCMS-T", "bthci_vendor.android.a2dp_hardware_offload.start.cp_enable_scmst",
1639 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1640 NULL, HFILL }
1642 { &hf_android_a2dp_hardware_offload_start_cp_header_scmst,
1643 { "CP Header SCMS-T", "bthci_vendor.android.a2dp_hardware_offload.start.cp_header_scmst",
1644 FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
1645 NULL, HFILL }
1647 { &hf_android_a2dp_hardware_offload_start_cp_header_scmst_reserved,
1648 { "Reserved", "bthci_vendor.android.a2dp_hardware_offload.start.cp_header_scmst_reserved",
1649 FT_UINT16, BASE_HEX, NULL, 0x0,
1650 NULL, HFILL }
1652 { &hf_android_a2dp_hardware_offload_start_vendor_specific_parameters_length,
1653 { "Vendor Specific Parameters Length", "bthci_vendor.android.a2dp_hardware_offload.start.vendor_specific_parameters_length",
1654 FT_UINT8, BASE_DEC, NULL, 0x0,
1655 NULL, HFILL }
1657 { &hf_android_a2dp_hardware_offload_start_vendor_specific_parameters,
1658 { "Vendor Specific Parameters", "bthci_vendor.android.a2dp_hardware_offload.start.vendor_specific_parameters",
1659 FT_BYTES, BASE_NONE, NULL, 0x0,
1660 NULL, HFILL }
1662 { &hf_android_a2dp_hardware_offload_stop_connection_handle,
1663 { "Connection Handle", "bthci_vendor.android.a2dp_hardware_offload.stop.connection_handle",
1664 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
1665 NULL, HFILL }
1667 { &hf_android_a2dp_hardware_offload_stop_l2cap_cid,
1668 { "L2CAP CID", "bthci_vendor.android.a2dp_hardware_offload.stop.l2cap_cid",
1669 FT_UINT16, BASE_HEX, NULL, 0x0,
1670 NULL, HFILL }
1672 { &hf_android_a2dp_hardware_offload_stop_data_path_direction,
1673 { "Data Path Direction", "bthci_vendor.android.a2dp_hardware_offload.stop.data_path_direction",
1674 FT_UINT8, BASE_HEX, VALS(android_a2dp_hardware_offload_data_path_direction_vals), 0x0,
1675 NULL, HFILL }
1679 static int *ett[] = {
1680 &ett_android,
1681 &ett_android_opcode,
1682 &ett_android_channel_map,
1683 &ett_android_a2dp_source_offload_capability_mask,
1684 &ett_android_dynamic_audio_buffer_support_mask,
1685 &ett_android_a2dp_hardware_offload_start_legacy_codec_information,
1686 &ett_android_a2dp_hardware_offload_start_legacy_codec_information_ldac_channel_mode_mask,
1689 static ei_register_info ei[] = {
1690 { &ei_android_undecoded, { "bthci_vendor.android.undecoded", PI_UNDECODED, PI_NOTE, "Undecoded", EXPFILL }},
1691 { &ei_android_unexpected_parameter, { "bthci_vendor.android.unexpected_parameter", PI_PROTOCOL, PI_WARN, "Unexpected parameter", EXPFILL }},
1692 { &ei_android_unexpected_data, { "bthci_vendor.android.unexpected_data", PI_PROTOCOL, PI_WARN, "Unexpected data", EXPFILL }},
1695 proto_bthci_vendor_android = proto_register_protocol("Bluetooth Android HCI",
1696 "HCI ANDROID", "bthci_vendor.android");
1698 bthci_vendor_android_handle = register_dissector("bthci_vendor.android", dissect_bthci_vendor_android, proto_bthci_vendor_android);
1700 proto_register_field_array(proto_bthci_vendor_android, hf, array_length(hf));
1701 proto_register_subtree_array(ett, array_length(ett));
1703 expert_module = expert_register_protocol(proto_bthci_vendor_android);
1704 expert_register_field_array(expert_module, ei, array_length(ei));
1707 void
1708 proto_reg_handoff_bthci_vendor_android(void)
1710 btcommon_ad_android_handle = find_dissector_add_dependency("btcommon.eir_ad.ad", proto_bthci_vendor_android);
1712 dissector_add_for_decode_as("bthci_cmd.vendor", bthci_vendor_android_handle);
1714 dissector_add_uint("bluetooth.vendor", bthci_vendor_manufacturer_android, bthci_vendor_android_handle);
1718 * Editor modelines - https://www.wireshark.org/tools/modelines.html
1720 * Local variables:
1721 * c-basic-offset: 4
1722 * tab-width: 8
1723 * indent-tabs-mode: nil
1724 * End:
1726 * vi: set shiftwidth=4 tabstop=8 expandtab:
1727 * :indentSize=4:tabSize=8:noTabs=true: