Skip to content

fixes BLE HID Battery Level Indicator #6864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 16, 2022

Conversation

SuGlider
Copy link
Collaborator

@SuGlider SuGlider commented Jun 14, 2022

Description of Change

BLE HID uses GATT Service to send Battery Level Indication.
It works fine on first time pairing and bonding, but on reconnect it doesn't update the Battery Level characteristic anymore.
It is fixed by setting the Notification to be ON, by default at the Service Creation.

Tests scenarios

Tested with ESP32 using Bluedroid and NimBLE.

Related links

Fixes #6708

@SuGlider SuGlider added the Area: BT&Wifi BT & Wifi related issues label Jun 14, 2022
@SuGlider SuGlider added this to the 2.0.4 milestone Jun 14, 2022
@SuGlider SuGlider self-assigned this Jun 14, 2022
@SuGlider SuGlider requested a review from me-no-dev June 14, 2022 00:06
@@ -42,7 +42,10 @@ BLEHIDDevice::BLEHIDDevice(BLEServer* server) {

m_batteryLevelCharacteristic = m_batteryService->createCharacteristic((uint16_t) 0x2a19, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_NOTIFY);
m_batteryLevelCharacteristic->addDescriptor(batteryLevelDescriptor);
m_batteryLevelCharacteristic->addDescriptor(new BLE2902());
BLE2902 *batLevelIndicator = new BLE2902();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation seems wrong here :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@me-no-dev me-no-dev merged commit 3d2c056 into espressif:master Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: BT&Wifi BT & Wifi related issues
Projects
Development

Successfully merging this pull request may close these issues.

function setBatteryLevel() in BLEHIDDevice.cpp is invalid
2 participants