Skip to content

Commit 5b66f68

Browse files
authored
Update BluetoothHciSocket.cpp
Closes #60
1 parent 3da8728 commit 5b66f68

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/BluetoothHciSocket.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,13 @@ bool BluetoothHciSocket::isDevUp()
351351

352352
void BluetoothHciSocket::setFilter(char *data, int length)
353353
{
354-
if (setsockopt(this->_socket, SOL_HCI, HCI_FILTER, data, length) < 0)
354+
struct hci_filter {
355+
uint32_t type_mask;
356+
uint32_t event_mask[2];
357+
uint16_t opcode;
358+
} filter;
359+
memcpy(&filter, data, length);
360+
if (setsockopt(this->_socket, SOL_HCI, HCI_FILTER, &filter, sizeof(filter)) < 0)
355361
{
356362
this->emitErrnoError("setsockopt");
357363
}

0 commit comments

Comments
 (0)