Notify battery level every 10 minutes when connected to a BLE host.

Refactor battery percent : only use uint8_t to store the battery % remaining.
This commit is contained in:
Jean-François Milants
2021-07-11 16:55:06 +02:00
parent 6a91b83b12
commit e21f6a7f41
17 changed files with 71 additions and 68 deletions

View File

@@ -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);
}
}