Skip to content

Commit

Permalink
Merge pull request I-Connect#58 from zanna-37/docs-close-stale-connec…
Browse files Browse the repository at this point in the history
…tions

docs: encourage the use of updateConnectionState()
  • Loading branch information
Bascy authored Jun 3, 2024
2 parents 26e27f7 + f03ccc7 commit c32a0fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ Logging can be enabled by setting the following defines (these are also availabl
void loop() {
scanner.update();
delay(10);
// Terminate stale Bluetooth connections
updateConnectionState();
}

## Nuki opener
Expand Down
6 changes: 4 additions & 2 deletions src/NukiBle.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ class NukiBle : public BLEClientCallbacks, public BleScanner::Subscriber {
* @brief checks the time past after last connect/communication sent, if the time past > timeout
* it will disconnect the BLE connection with the lock so that lock will start sending advertisements.
*
* This method is optional as the lock will also disconnect automaticlally after ~20 sec.
* If used this method should be run in loop or a task.
* This method is optional since the lock will automatically disconnect after approximately 20
* seconds. However, the lock might be unresponsive during this time if the connection is stale.
* For this reason, using this method is advised.
* If used, this method should be run in loop or a task.
*
*/
void updateConnectionState();
Expand Down

0 comments on commit c32a0fd

Please sign in to comment.