diff --git a/monitor/control.c b/monitor/control.c
index 92dc93a..3447b7a 100644
--- a/monitor/control.c
+++ b/monitor/control.c
#include "display.h"
#include "packet.h"
#include "btsnoop.h"
+#include "hcidump.h"
#include "control.h"
+static bool hcidump_fallback = false;
+
#define MAX_PACKET_SIZE (1486 + 4)
struct control_data {
if (bind(fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
if (errno == EINVAL) {
/* Fallback to hcidump support */
+ hcidump_fallback = true;
close(fd);
return -1;
}
if (server_fd >= 0)
return 0;
- if (open_channel(HCI_CHANNEL_MONITOR) < 0)
- return -1;
+ if (open_channel(HCI_CHANNEL_MONITOR) < 0) {
+ if (!hcidump_fallback)
+ return -1;
+ if (hcidump_tracing() < 0)
+ return -1;
+ return 0;
+ }
open_channel(HCI_CHANNEL_CONTROL);
diff --git a/monitor/main.c b/monitor/main.c
index ac4dc1f..27a5722 100644
--- a/monitor/main.c
+++ b/monitor/main.c
#include "mainloop.h"
#include "packet.h"
#include "control.h"
-#include "hcidump.h"
#include "btsnoop.h"
static void signal_callback(int signum, void *user_data)
return EXIT_SUCCESS;
}
- if (control_tracing() < 0) {
- if (hcidump_tracing() < 0)
- return EXIT_FAILURE;
- }
+ if (control_tracing() < 0)
+ return EXIT_FAILURE;
return mainloop_run();
}