Skip to content

Commit 1159403

Browse files
authored
Merge pull request #711 from geekbozu/BatteryReadFix
Remove static declaration on batteryValue preventing read attribute from updating.
2 parents e9bb0b3 + dafdf33 commit 1159403

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/components/ble/BatteryInformationService.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ int BatteryInformationService::OnBatteryServiceRequested(uint16_t connectionHand
4343
ble_gatt_access_ctxt* context) {
4444
if (attributeHandle == batteryLevelHandle) {
4545
NRF_LOG_INFO("BATTERY : handle = %d", batteryLevelHandle);
46-
static uint8_t batteryValue = batteryController.PercentRemaining();
46+
uint8_t batteryValue = batteryController.PercentRemaining();
4747
int res = os_mbuf_append(context->om, &batteryValue, 1);
4848
return (res == 0) ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES;
4949
}

0 commit comments

Comments
 (0)