diff options
author | JF <JF002@users.noreply.github.com> | 2021-10-02 18:00:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-02 18:00:21 +0200 |
commit | 1159403aee31d6d58a3eaab6620908cd6c1718cb (patch) | |
tree | 9488865f0cab2d82fdb48e6be0dd7e942dbad2f4 /src/components/ble | |
parent | e9bb0b3cdd0e1b95b7bfdcfb94db5a6a0966eed7 (diff) | |
parent | dafdf330627d6291acd56f16e8da8c914d19bb29 (diff) |
Merge pull request #711 from geekbozu/BatteryReadFix
Remove static declaration on batteryValue preventing read attribute from updating.
Diffstat (limited to 'src/components/ble')
-rw-r--r-- | src/components/ble/BatteryInformationService.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/components/ble/BatteryInformationService.cpp b/src/components/ble/BatteryInformationService.cpp index 7f176904..4ef02358 100644 --- a/src/components/ble/BatteryInformationService.cpp +++ b/src/components/ble/BatteryInformationService.cpp @@ -43,7 +43,7 @@ int BatteryInformationService::OnBatteryServiceRequested(uint16_t connectionHand ble_gatt_access_ctxt* context) { if (attributeHandle == batteryLevelHandle) { NRF_LOG_INFO("BATTERY : handle = %d", batteryLevelHandle); - static uint8_t batteryValue = batteryController.PercentRemaining(); + uint8_t batteryValue = batteryController.PercentRemaining(); int res = os_mbuf_append(context->om, &batteryValue, 1); return (res == 0) ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES; } |