diff options
author | Jean-François Milants <jf@codingfield.com> | 2021-07-13 20:31:44 +0200 |
---|---|---|
committer | Jean-François Milants <jf@codingfield.com> | 2021-07-13 20:31:44 +0200 |
commit | af10747c94080123a5847d5258c2cfeb7ec317cb (patch) | |
tree | 7385ab23e93eb7746cf459c64679ddcdaff4fc41 /src/components/ble/NimbleController.cpp | |
parent | 4f378e8726fdcff72598aa6ed12eeaa6b3e61355 (diff) | |
parent | 3e705548442f1f208c2092ffc865ae824ee0955a (diff) |
Merge branch 'notify-battery-level' into develop
Diffstat (limited to 'src/components/ble/NimbleController.cpp')
-rw-r--r-- | src/components/ble/NimbleController.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/components/ble/NimbleController.cpp b/src/components/ble/NimbleController.cpp index 2c1d0f99..5eb227bf 100644 --- a/src/components/ble/NimbleController.cpp +++ b/src/components/ble/NimbleController.cpp @@ -235,3 +235,9 @@ void NimbleController::StartDiscovery() { uint16_t NimbleController::connHandle() { return connectionHandle; } + +void NimbleController::NotifyBatteryLevel(uint8_t level) { + if(connectionHandle != BLE_HS_CONN_HANDLE_NONE) { + batteryInformationService.NotifyBatteryLevel(connectionHandle, level); + } +} |