Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f954cb0

Browse files
polldogiulcioffi
authored andcommittedOct 26, 2020
[WIP] Fix inconsistent stop scan - to be revisioned
1 parent 3803e5f commit f954cb0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

Diff for: ‎src/utility/GAP.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ void GAPClass::stopAdvertise()
167167

168168
int GAPClass::scan(bool withDuplicates)
169169
{
170-
HCI.leSetScanEnable(false, true);
170+
//HCI.leSetScanEnable(false, true);
171+
stopScan();
171172

172173
// active scan, 10 ms scan interval (N * 0.625), 10 ms scan window (N * 0.625), public own address type, no filter
173174
if (HCI.leSetScanParameters(0x01, 0x0010, 0x0010, 0x00, 0x00) != 0) {
@@ -212,7 +213,8 @@ int GAPClass::scanForAddress(String address, bool withDuplicates)
212213

213214
void GAPClass::stopScan()
214215
{
215-
HCI.leSetScanEnable(false, false);
216+
//HCI.leSetScanEnable(false, false);
217+
HCI.leSetScanEnable(false, true);
216218

217219
_scanning = false;
218220

0 commit comments

Comments
 (0)
Please sign in to comment.