diff --git a/monitor/control.c b/monitor/control.c
index 6dfefd0..2730758 100644
--- a/monitor/control.c
+++ b/monitor/control.c
return 0;
}
- open_channel(HCI_CHANNEL_CONTROL);
+ if (packet_has_filter(PACKET_FILTER_SHOW_MGMT_SOCKET))
+ open_channel(HCI_CHANNEL_CONTROL);
return 0;
}
diff --git a/monitor/main.c b/monitor/main.c
index 479df85..24ec3c5 100644
--- a/monitor/main.c
+++ b/monitor/main.c
"\t-d, --tty <tty> Read data from TTY\n"
"\t-B, --tty-speed <rate> Set TTY speed (default 115200)\n"
"\t-V, --vendor <compid> Set default company identifier\n"
+ "\t-M, --mgmt Open channel for mgmt events\n"
"\t-t, --time Show time instead of time offset\n"
"\t-T, --date Show time and date information\n"
"\t-S, --sco Dump SCO traffic\n"
{ "tty", required_argument, NULL, 'd' },
{ "tty-speed", required_argument, NULL, 'B' },
{ "vendor", required_argument, NULL, 'V' },
+ { "mgmt", no_argument, NULL, 'M' },
{ "time", no_argument, NULL, 't' },
{ "date", no_argument, NULL, 'T' },
{ "sco", no_argument, NULL, 'S' },
int opt;
struct sockaddr_un addr;
- opt = getopt_long(argc, argv, "r:w:a:s:p:i:d:B:V:tTSAE:PJ:R:vh",
+ opt = getopt_long(argc, argv, "r:w:a:s:p:i:d:B:V:MtTSAE:PJ:R:vh",
main_options, NULL);
if (opt < 0)
break;
str = optarg;
packet_set_fallback_manufacturer(atoi(str));
break;
+ case 'M':
+ filter_mask |= PACKET_FILTER_SHOW_MGMT_SOCKET;
+ break;
case 't':
filter_mask &= ~PACKET_FILTER_SHOW_TIME_OFFSET;
filter_mask |= PACKET_FILTER_SHOW_TIME;
diff --git a/monitor/packet.h b/monitor/packet.h
index 19ea04c..3a139ec 100644
--- a/monitor/packet.h
+++ b/monitor/packet.h
#define PACKET_FILTER_SHOW_ACL_DATA (1 << 4)
#define PACKET_FILTER_SHOW_SCO_DATA (1 << 5)
#define PACKET_FILTER_SHOW_A2DP_STREAM (1 << 6)
+#define PACKET_FILTER_SHOW_MGMT_SOCKET (1 << 7)
bool packet_has_filter(unsigned long filter);
void packet_set_filter(unsigned long filter);