Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLE - Disconnect after a timeout #842

Merged
merged 1 commit into from
Jan 30, 2021
Merged

Conversation

1technophile
Copy link
Owner

So as to save the devices battery

@1technophile 1technophile added this to the v0.9.6 milestone Jan 2, 2021
@1technophile 1technophile changed the title Disconnect after a timeout BLE - Disconnect after a timeout Jan 2, 2021
@1technophile 1technophile linked an issue Jan 2, 2021 that may be closed by this pull request
So as to save the devices battery
@1technophile 1technophile force-pushed the ble-connect-disconnect branch from 891e8e8 to 6bc618e Compare January 30, 2021 21:02
@1technophile 1technophile merged commit 717bdb1 into development Jan 30, 2021
@1technophile 1technophile deleted the ble-connect-disconnect branch January 30, 2021 21:32
@@ -569,6 +569,8 @@ void BLEconnect() {
if (pRemoteCharacteristic->canNotify()) {
Log.trace(F("Registering notification" CR));
pRemoteCharacteristic->subscribe(true, notifyCB);
delay(BLE_CNCT_TIMEOUT);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of a delay here we could use a task notification wait with BLE_CNCT_TIMEOUT as the max wait time. The notification callback could release the task before the timeout and this would save time and battery power for both devices if applicable. Thoughts?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes good point!

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.

BLE connection will not be closed
2 participants