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

@@ -70,6 +70,7 @@ namespace Pinetime {
};
uint16_t connHandle();
void NotifyBatteryLevel(uint8_t level);
private:
static constexpr const char* deviceName = "InfiniTime";
@@ -92,7 +93,7 @@ namespace Pinetime {
HeartRateService heartRateService;
uint8_t addrType; // 1 = Random, 0 = PUBLIC
uint16_t connectionHandle = 0;
uint16_t connectionHandle = BLE_HS_CONN_HANDLE_NONE;
ble_uuid128_t dfuServiceUuid {
.u {.type = BLE_UUID_TYPE_128},