File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments