Skip to content

Commit

Permalink
[WIP] Fix inconsistent stop scan - to be revisioned
Browse files Browse the repository at this point in the history
  • Loading branch information
polldo committed Aug 27, 2020
1 parent f985ea6 commit 7119889
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/utility/GAP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ void GAPClass::stopAdvertise()

int GAPClass::scan(bool withDuplicates)
{
HCI.leSetScanEnable(false, true);
//HCI.leSetScanEnable(false, true);
stopScan();

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

void GAPClass::stopScan()
{
HCI.leSetScanEnable(false, false);
//HCI.leSetScanEnable(false, false);
HCI.leSetScanEnable(false, true);

_scanning = false;

Expand Down

0 comments on commit 7119889

Please sign in to comment.