Diff between d815cc4adfde86367b4a93c65f9cc499f6b55647 and 0611470cdd64ab5009ce27997c1a5ac647794ccf

Changed Files

File Additions Deletions Status
monitor/control.c +5 -0 modified
monitor/control.h +1 -0 modified
monitor/main.c +5 -3 modified

Full Patch

diff --git a/monitor/control.c b/monitor/control.c
index 288228e..a5567d0 100644
--- a/monitor/control.c
+++ b/monitor/control.c
@@ -806,6 +806,11 @@ void control_server(const char *path)
 	server_fd = fd;
 }
 
+void control_writer(const char *path)
+{
+	btsnoop_create(path, BTSNOOP_TYPE_EXTENDED_PHY);
+}
+
 void control_reader(const char *path)
 {
 	unsigned char buf[MAX_PACKET_SIZE];
diff --git a/monitor/control.h b/monitor/control.h
index 2d7d625..8781bd0 100644
--- a/monitor/control.h
+++ b/monitor/control.h
@@ -24,6 +24,7 @@
 
 #include <stdint.h>
 
+void control_writer(const char *path);
 void control_reader(const char *path);
 void control_server(const char *path);
 int control_tracing(void);
diff --git a/monitor/main.c b/monitor/main.c
index 85e618d..0a2e8aa 100644
--- a/monitor/main.c
+++ b/monitor/main.c
@@ -35,7 +35,6 @@
 #include "mainloop.h"
 #include "packet.h"
 #include "control.h"
-#include "btsnoop.h"
 
 static void signal_callback(int signum, void *user_data)
 {
@@ -79,7 +78,7 @@ static const struct option main_options[] = {
 int main(int argc, char *argv[])
 {
 	unsigned long filter_mask = 0;
-	const char *str, *reader_path = NULL;
+	const char *str, *reader_path = NULL, *writer_path = NULL;
 	sigset_t mask;
 
 	mainloop_init();
@@ -99,7 +98,7 @@ int main(int argc, char *argv[])
 			reader_path = optarg;
 			break;
 		case 'w':
-			btsnoop_create(optarg, BTSNOOP_TYPE_EXTENDED_HCI);
+			writer_path = optarg;
 			break;
 		case 's':
 			control_server(optarg);
@@ -153,6 +152,9 @@ int main(int argc, char *argv[])
 		return EXIT_SUCCESS;
 	}
 
+	if (writer_path)
+		control_writer(writer_path);
+
 	if (control_tracing() < 0)
 		return EXIT_FAILURE;