Skip to content

Commit

Permalink
Update BluetoothHciSocket.cpp
Browse files Browse the repository at this point in the history
Closes #60
  • Loading branch information
Debenben authored and rzr committed Dec 12, 2024
1 parent 3da8728 commit 2e19ae9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/BluetoothHciSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,13 @@ bool BluetoothHciSocket::isDevUp()

void BluetoothHciSocket::setFilter(char *data, int length)
{
if (setsockopt(this->_socket, SOL_HCI, HCI_FILTER, data, length) < 0)
struct hci_filter {
uint32_t type_mask;
uint32_t event_mask[2];
uint16_t opcode;
} filter;
memcpy(&filter, data, length);
if (setsockopt(this->_socket, SOL_HCI, HCI_FILTER, &filter, sizeof(filter)) < 0)
{
this->emitErrnoError("setsockopt");
}
Expand Down

0 comments on commit 2e19ae9

Please sign in to comment.