summaryrefslogtreecommitdiff
path: root/src/components/ble/NimbleController.cpp
diff options
context:
space:
mode:
authorJean-François Milants <jf@codingfield.com>2021-07-13 20:31:44 +0200
committerJean-François Milants <jf@codingfield.com>2021-07-13 20:31:44 +0200
commitaf10747c94080123a5847d5258c2cfeb7ec317cb (patch)
tree7385ab23e93eb7746cf459c64679ddcdaff4fc41 /src/components/ble/NimbleController.cpp
parent4f378e8726fdcff72598aa6ed12eeaa6b3e61355 (diff)
parent3e705548442f1f208c2092ffc865ae824ee0955a (diff)
Merge branch 'notify-battery-level' into develop
Diffstat (limited to 'src/components/ble/NimbleController.cpp')
-rw-r--r--src/components/ble/NimbleController.cpp6
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);
+ }
+}