summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-01-13 19:37:54 -0800
committerMarcel Holtmann <marcel@holtmann.org>2014-01-13 19:37:54 -0800
commit803f7ce17ed6780b49fbcaad46ab26ae1121788f (patch)
tree0e6120c7c5e5d4ba61839789299dcff62a134bff /src
parentd31e9cf074b889a43d718b5ea8fc527563c45e2c (diff)
shared: Introduce flag for detecting HCI stream based sources
Diffstat (limited to 'src')
-rw-r--r--src/shared/hci.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/shared/hci.c b/src/shared/hci.c
index 1e4b58fa2..be636de75 100644
--- a/src/shared/hci.c
+++ b/src/shared/hci.c
@@ -58,6 +58,7 @@ struct hci_filter {
struct bt_hci {
int ref_count;
struct io *io;
+ bool is_stream;
bool writer_active;
uint8_t num_cmds;
unsigned int next_cmd_id;
@@ -266,6 +267,9 @@ static bool io_read_callback(struct io *io, void *user_data)
if (fd < 0)
return false;
+ if (hci->is_stream)
+ return false;
+
len = read(fd, buf, sizeof(buf));
if (len < 0)
return false;
@@ -299,6 +303,7 @@ struct bt_hci *bt_hci_new(int fd)
return NULL;
}
+ hci->is_stream = true;
hci->writer_active = false;
hci->num_cmds = 1;
hci->next_cmd_id = 1;
@@ -378,6 +383,8 @@ struct bt_hci *bt_hci_new_user_channel(uint16_t index)
return NULL;
}
+ hci->is_stream = false;
+
bt_hci_set_close_on_unref(hci, true);
return hci;
@@ -409,6 +416,8 @@ struct bt_hci *bt_hci_new_raw_device(uint16_t index)
return NULL;
}
+ hci->is_stream = false;
+
bt_hci_set_close_on_unref(hci, true);
return hci;