Skip to content

Conversation

h2zero
Copy link
Owner

@h2zero h2zero commented Nov 10, 2024

When attempting to connect and the scanner is running NimBLEScan::stop is called to stop it
which then calls the onScanEnded callback. If the app then starts the scan again in this
callback an endless loop will be created.

This change prevents the endless loop by setting a flag in NimBLEDevice that is checked before
starting a scan while a client is trying to connect.

Adds NimBLEDevice::setConnectionInProgress and NimBLEDevice::isConnectionInProgress functions.

When attempting to connect and the scanner is running `NimBLEScan::stop` is called to stop it
which then calls the `onScanEnded` callback. If the app then starts the scan again in this
callback an endless loop will be created.

This change prevents the endless loop by setting a flag in `NimBLEDevice` that is checked before
starting a scan while a client is trying to connect.

* Adds `NimBLEDevice::setConnectionInProgress` and `NimBLEDevice::isConnectionInProgress` functions.
@h2zero h2zero force-pushed the scan-endless-loop-fix branch from 6ae7cc7 to 3632eb7 Compare November 10, 2024 17:28
@h2zero h2zero merged commit 697277f into master Nov 10, 2024
62 checks passed
@h2zero h2zero deleted the scan-endless-loop-fix branch November 10, 2024 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant