summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-08-24 05:52:28 +0200
committerSven Gothel <[email protected]>2020-08-24 05:52:28 +0200
commit0fa1061c4f7f312491693e95fa67309e016cc6c2 (patch)
tree0d6a3215b45e71d07889e59932aa8d9003480978 /src
parentf9f54887a7d1db59e2ead858274bdaa89c82956c (diff)
HCIHAndler: Prepare filtering for HCIOpcode using condensed uint64_t HCIOpcodeBit field
It is desired to filter out command replies for unrelated or unsupported commands. Since HCIOpcode values can't be used directly due their wide value range, we use the condensed HCIOpcodeBit for a uint64_t field, limeted to 64 commands.
Diffstat (limited to 'src')
-rw-r--r--src/direct_bt/HCIHandler.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/direct_bt/HCIHandler.cpp b/src/direct_bt/HCIHandler.cpp
index 400828c5..48b7d08c 100644
--- a/src/direct_bt/HCIHandler.cpp
+++ b/src/direct_bt/HCIHandler.cpp
@@ -481,6 +481,19 @@ HCIHandler::HCIHandler(const BTMode btMode, const uint16_t dev_id,
filter_set_metaev(HCIMetaEventType::LE_ADVERTISING_REPORT, mask);
filter_put_metaevs(mask);
}
+ // Mandatory own HCIOpcodeBit/HCIOpcode filter
+ {
+ uint64_t mask = 0;
+ // filter_all_opcbit(mask);
+ filter_set_opcbit(HCIOpcodeBit::CREATE_CONN, mask);
+ filter_set_opcbit(HCIOpcodeBit::DISCONNECT, mask);
+ filter_set_opcbit(HCIOpcodeBit::RESET, mask);
+ filter_set_opcbit(HCIOpcodeBit::READ_LOCAL_VERSION, mask);
+ filter_set_opcbit(HCIOpcodeBit::LE_SET_SCAN_PARAM, mask);
+ filter_set_opcbit(HCIOpcodeBit::LE_SET_SCAN_ENABLE, mask);
+ filter_set_opcbit(HCIOpcodeBit::LE_CREATE_CONN, mask);
+ filter_put_opcbit(mask);
+ }
{
HCICommand req0(HCIOpcode::READ_LOCAL_VERSION, 0);
const hci_rp_read_local_version * ev_lv;