diff --git a/tools/hcidump.1 b/tools/hcidump.1
index bf344c6..a17dd23 100644
--- a/tools/hcidump.1
+++ b/tools/hcidump.1
.BR -R ", " "\-\^\-raw"
Raw mode: do not display packet type, only data.
.TP
+.BR -B ", " "\-\^\-bpa"
+BPA mode: only display vendor specific data packets.
+.TP
.BR -C ", " "\-\^\-cmtp"
Sets the PSM value for the CAPI Message Transport Protocol
.TP
diff --git a/tools/hcidump.c b/tools/hcidump.c
index f60d26e..f9d96fb 100644
--- a/tools/hcidump.c
+++ b/tools/hcidump.c
return f;
}
-static int open_socket(int dev)
+static int open_socket(int dev, unsigned long flags)
{
struct sockaddr_hci addr;
struct hci_filter flt;
/* Setup filter */
hci_filter_clear(&flt);
- hci_filter_all_ptypes(&flt);
- hci_filter_all_events(&flt);
+ if (flags & DUMP_BPA) {
+ hci_filter_set_ptype(HCI_VENDOR_PKT, &flt);
+ hci_filter_set_event(EVT_VENDOR, &flt);
+ } else {
+ hci_filter_all_ptypes(&flt);
+ hci_filter_all_events(&flt);
+ hci_filter_clear_ptype(HCI_VENDOR_PKT, &flt);
+ }
if (setsockopt(sk, SOL_HCI, HCI_FILTER, &flt, sizeof(flt)) < 0) {
perror("Can't set HCI filter");
exit(1);
" -x, --hex Dump data in hex\n"
" -X, --ext Dump data in hex and ascii\n"
" -R, --raw Raw mode\n"
+ " -B, --bpa BPA mode\n"
" -C, --cmtp=psm PSM for CMTP\n"
" -H, --hcrp=psm PSM for HCRP\n"
" -O, --obex=channel Channel for OBEX\n"
{ "hex", 0, 0, 'x' },
{ "ext", 0, 0, 'X' },
{ "raw", 0, 0, 'R' },
+ { "bpa", 0, 0, 'B' },
{ "cmtp", 1, 0, 'C' },
{ "hcrp", 1, 0, 'H' },
{ "obex", 1, 0, 'O' },
printf("HCIDump - HCI packet analyzer ver %s\n", VERSION);
- while ((opt=getopt_long(argc, argv, "i:l:p:m:w:r:s:n:taxXRC:H:O:h", main_options, NULL)) != -1) {
+ while ((opt=getopt_long(argc, argv, "i:l:p:m:w:r:s:n:taxXRBC:H:O:h", main_options, NULL)) != -1) {
switch(opt) {
case 'i':
device = atoi(optarg + 3);
flags |= DUMP_RAW;
break;
+ case 'B':
+ flags |= DUMP_BPA;
+ break;
+
case 'C':
set_proto(0, atoi(optarg), 0, SDP_UUID_CMTP);
break;
switch (mode) {
case PARSE:
init_parser(flags, filter, defpsm, defcompid);
- process_frames(device, open_socket(device), -1);
+ process_frames(device, open_socket(device, flags), -1);
break;
case READ:
break;
case WRITE:
- process_frames(device, open_socket(device), open_file(dump_file, mode));
+ process_frames(device, open_socket(device, flags), open_file(dump_file, mode));
break;
case RECEIVE:
break;
case SEND:
- process_frames(device, open_socket(device), open_connection(dump_addr, dump_port));
+ process_frames(device, open_socket(device, flags), open_connection(dump_addr, dump_port));
break;
}
diff --git a/tools/parser/hci.c b/tools/parser/hci.c
index 9d001e3..260c23f 100644
--- a/tools/parser/hci.c
+++ b/tools/parser/hci.c
}
}
+static inline void vendor_dump(int level, struct frame *frm)
+{
+ p_indent(level, frm);
+ printf("Vendor data: len %d\n", frm->len);
+ raw_dump(level, frm);
+}
+
void hci_dump(int level, struct frame *frm)
{
uint8_t type = *(uint8_t *)frm->ptr;
sco_dump(level, frm);
break;
+ case HCI_VENDOR_PKT:
+ vendor_dump(level, frm);
+ break;
+
default:
if (p_filter(FILT_HCI))
break;
diff --git a/tools/parser/parser.h b/tools/parser/parser.h
index d2e864d..bc44e0c 100644
--- a/tools/parser/parser.h
+++ b/tools/parser/parser.h
#define DUMP_HEX 0x02
#define DUMP_EXT 0x04
#define DUMP_RAW 0x08
-#define DUMP_TSTAMP 0x10
+#define DUMP_BPA 0x10
+#define DUMP_TSTAMP 0x80
#define DUMP_TYPE_MASK (DUMP_ASCII | DUMP_HEX | DUMP_EXT)
/* Parser filter */