Diff between cbbb0c2ead89ed19280ecd94e8a2fb0d22216bb6 and 5b294a56664a8c7088d1eea2bc089d812a515794

Changed Files

File Additions Deletions Status
monitor/control.c +2 -1 modified
monitor/main.c +6 -1 modified
monitor/packet.h +1 -0 modified

Full Patch

diff --git a/monitor/control.c b/monitor/control.c
index 6dfefd0..2730758 100644
--- a/monitor/control.c
+++ b/monitor/control.c
@@ -1554,7 +1554,8 @@ int control_tracing(void)
 		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
@@ -69,6 +69,7 @@ static void usage(void)
 		"\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"
@@ -92,6 +93,7 @@ static const struct option main_options[] = {
 	{ "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' },
@@ -130,7 +132,7 @@ int main(int argc, char *argv[])
 		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;
@@ -180,6 +182,9 @@ int main(int argc, char *argv[])
 			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
@@ -34,6 +34,7 @@
 #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);