You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/NimBLEScan.cpp
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ NimBLEScan::NimBLEScan() {
34
34
m_scan_params.itvl = 0; // This is defined as the time interval from when the Controller started its last LE scan until it begins the subsequent LE scan. (units=0.625 msec)
35
35
m_scan_params.window = 0; // The duration of the LE scan. LE_Scan_Window shall be less than or equal to LE_Scan_Interval (units=0.625 msec)
36
36
m_scan_params.limited = 0; // If set, only discover devices in limited discoverable mode.
37
-
m_scan_params.filter_duplicates = 0; // If set, the controller ignores all but the first advertisement from each device.
37
+
m_scan_params.filter_duplicates = 1; // If set, the controller ignores all but the first advertisement from each device.
38
38
m_pAdvertisedDeviceCallbacks = nullptr;
39
39
m_ignoreResults = false;
40
40
m_pTaskData = nullptr;
@@ -134,6 +134,10 @@ NimBLEScan::~NimBLEScan() {
134
134
event_type == BLE_HCI_ADV_RPT_EVTYPE_SCAN_RSP));
135
135
136
136
if (pScan->m_pAdvertisedDeviceCallbacks) {
137
+
if (pScan->m_scan_params.filter_duplicates && advertisedDevice->m_callbackSent) {
138
+
return0;
139
+
}
140
+
137
141
// If not active scanning or scan response is not available
138
142
// or extended advertisement scanning, report the result to the callback now.
0 commit comments