Skip to content

Commit

Permalink
fix(example): ignore discovery event when direct connection
Browse files Browse the repository at this point in the history
  • Loading branch information
stoprocent committed Dec 29, 2024
1 parent 9b4580f commit 7e67413
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/peripheral-explorer-async.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ async function main () {
}

noble.on('discover', async (peripheral) => {
if (directConnect === '1') {
return;
}
if ([peripheral.id, peripheral.address].includes(peripheralIdOrAddress)) {
await noble.stopScanningAsync();

Expand Down

0 comments on commit 7e67413

Please sign in to comment.