applications: gesture_recognition: refactor ble_hid to use HID Service from sdk-nrf#75
Open
applications: gesture_recognition: refactor ble_hid to use HID Service from sdk-nrf#75
Conversation
|
You can find the documentation preview for this PR here. |
mbarchie
approved these changes
Mar 31, 2026
Comment on lines
267
to
273
Contributor
There was a problem hiding this comment.
Should we start advertising if init fails?
Collaborator
Author
There was a problem hiding this comment.
We can, the consequence will be that the connected device won't see the whole HID service in our attribute table. Perhaps we can advertise without the HID UUID in the advertising data? Or should the application assert in that case?
Szynkaa
reviewed
Mar 31, 2026
zycz
reviewed
Mar 31, 2026
0fe9e02 to
0789b11
Compare
Szynkaa
approved these changes
Apr 1, 2026
mbarchie
approved these changes
Apr 1, 2026
0789b11 to
9dd090f
Compare
zycz
approved these changes
Apr 1, 2026
Remove dependency to the bt_hids module (using its log level value). Signed-off-by: Michał Grochala <michal.grochala@nordicsemi.no> --to HID log level
Improve interoperability by adding the GAP Appearance value in the advertising data as recommended by the HOGP specification. Signed-off-by: Michał Grochala <michal.grochala@nordicsemi.no>
The application had a simple GATT HID Service implementation, It was refactored to use the bt_hids module from sdk-nrf to simplify the code and rely on the proper service implementation. Details of updates: - ble_hid.h API is unchanged - ble_hid.c uses hids.c from sdk-nrf - reduced the attribute value length for the consumer control report to 1 byte to comply the report map char. (previously 2 bytes were transmitted) Consequence: - migrate from static (build-time) attribute definition through BT_GATT_SERVICE_DEFINE() macro to dynamic definition using bt_gatt_service_register() function as implied by BT_GATT_POOL used by BT_HIDS - increase of ROM (~7KB) and RAM (~1.5KB) footprint Ref. NCSDK-37242 Signed-off-by: Michał Grochala <michal.grochala@nordicsemi.no>
Gesture Recognition now uses The Bluetooth HID Service subsystem in the HID interface configuration so it needs to be mentioned in the Dependencies section. Signed-off-by: Michał Grochala <michal.grochala@nordicsemi.no>
9dd090f to
cf6a57a
Compare
mbarchie
approved these changes
Apr 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It's been agreed offline, that the application would benefit from using the ready Bluetooth HID Service module from the sdk-nrf repo, which will hide Zephyr Bluetooth API changes (migration will be handled on sdk-nrf level) and ensure quality of the service implementation. At the same time the HID Service API is quite stable, so it shouldn't generate too much maintenance in the add-on.
Not addressed in this PR: