summaryrefslogtreecommitdiff
path: root/monitor/control.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2016-09-01 18:14:33 +0200
committerMarcel Holtmann <marcel@holtmann.org>2016-09-01 18:14:33 +0200
commit5599bf01f4af52c13c60795931b7405b9e61ba18 (patch)
treeecbe59d2bacac24294c6183e6fe82dcdc2ec8cc4 /monitor/control.c
parent4a80373beb3cc6826c9d39b8f60ac1ea62375cf5 (diff)
downloadbluez-5599bf01f4af52c13c60795931b7405b9e61ba18.tar.gz
monitor: Disable decoding of control channel and not close it
Diffstat (limited to 'monitor/control.c')
-rw-r--r--monitor/control.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/monitor/control.c b/monitor/control.c
index f6b2291de..9bbdc37dc 100644
--- a/monitor/control.c
+++ b/monitor/control.c
@@ -57,7 +57,7 @@
static struct btsnoop *btsnoop_file = NULL;
static bool hcidump_fallback = false;
-static int mgmt_control_fd = -1;
+static bool decode_control = true;
struct control_data {
uint16_t channel;
@@ -798,6 +798,9 @@ static void mgmt_advertising_removed(uint16_t len, const void *buf)
void control_message(uint16_t opcode, const void *data, uint16_t size)
{
+ if (!decode_control)
+ return;
+
switch (opcode) {
case MGMT_EV_INDEX_ADDED:
mgmt_index_added(size, data);
@@ -1044,7 +1047,7 @@ static int open_channel(uint16_t channel)
mainloop_add_fd(data->fd, EPOLLIN, data_callback, data, free_data);
- return data->fd;
+ return 0;
}
static void client_callback(int fd, uint32_t events, void *user_data)
@@ -1447,16 +1450,12 @@ int control_tracing(void)
return 0;
}
- mgmt_control_fd = open_channel(HCI_CHANNEL_CONTROL);
+ open_channel(HCI_CHANNEL_CONTROL);
return 0;
}
-void control_disable_legacy(void)
+void control_disable_decoding(void)
{
- if (mgmt_control_fd < 0)
- return;
-
- close(mgmt_control_fd);
- mgmt_control_fd = -1;
+ decode_control = false;
}