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) {
42
42
43
43
m_batteryLevelCharacteristic = m_batteryService->createCharacteristic ((uint16_t ) 0x2a19 , BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_NOTIFY);
44
44
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);
46
49
47
50
/*
48
51
* 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