Skip to content

Commit

Permalink
only use this when wifi is not enabled. (poking around)
Browse files Browse the repository at this point in the history
  • Loading branch information
caveman99 committed Dec 1, 2023
1 parent a75e71a commit 11e6626
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/nimble/NimbleBluetooth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,10 @@ void NimbleBluetooth::startAdvertising()
/// Given a level between 0-100, update the BLE attribute
void updateBatteryLevel(uint8_t level)
{
BatteryCharacteristic->setValue(&level, 1);
BatteryCharacteristic->notify();
if ((config.bluetooth.enabled == true) && bleServer && nimbleBluetooth->isConnected()) {
BatteryCharacteristic->setValue(&level, 1);
BatteryCharacteristic->notify();
}
}

void NimbleBluetooth::clearBonds()
Expand Down

0 comments on commit 11e6626

Please sign in to comment.