Skip to content

Commit 3d2c056

Browse files
authored
fixes BLE HID Battery Level Indicator (#6864)
* fixes BLE HID Battery Level Indicator * Fixing identation
1 parent 3877145 commit 3d2c056

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libraries/BLE/src/BLEHIDDevice.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ BLEHIDDevice::BLEHIDDevice(BLEServer* server) {
4242

4343
m_batteryLevelCharacteristic = m_batteryService->createCharacteristic((uint16_t) 0x2a19, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_NOTIFY);
4444
m_batteryLevelCharacteristic->addDescriptor(batteryLevelDescriptor);
45-
m_batteryLevelCharacteristic->addDescriptor(new BLE2902());
45+
BLE2902 *batLevelIndicator = new BLE2902();
46+
// Battery Level Notification is ON by default, making it work always on BLE Pairing and Bonding
47+
batLevelIndicator->setNotifications(true);
48+
m_batteryLevelCharacteristic->addDescriptor(batLevelIndicator);
4649

4750
/*
4851
* This value is setup here because its default value in most usage cases, its very rare to use boot mode

0 commit comments

Comments
 (0)