Repository navigation
Fix BLE Keyboard HID service advertising - #2932
Open
federicopignatiello-png wants to merge 1 commit into
Open
federicopignatiello-png wants to merge 1 commit into
federicopignatiello-png wants to merge 1 commit into
Conversation
Ninja-jr
suggested changes
Sep 29, 2026
Ninja-jr
pushed a commit
to Ninja-jr/Bruce_firmware
that referenced
this pull request
Sep 29, 2026
This branch has not been deployed
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.
Proposed Changes
BLE Keyboard (
Keyboard_a) was not visible in Bluetooth discovery on Mac/iPhone when using an M5Stack Cardputer ADV.In the normal HID advertising path,
addServiceUUID()added HID service UUID0x1812to the advertising object. The subsequentsetAdvertisementData()replaced that payload with a separateNimBLEAdvertisementDatacontaining only flags, name, and appearance, dropping the HID UUID. Scan response is disabled in this path.Add the HID UUID to the
NimBLEAdvertisementDataactually passed tosetAdvertisementData(). This is a one-line move. The random-UUID path, security configuration, and other behavior remain unchanged.Types of Changes
Bugfix.
Verification
On M5Stack Cardputer ADV, open BLE Keyboard, look for its configured name (e.g.
Keyboard_a) on a Mac, pair it, and type harmless test text into an editor. A BLE advertisement inspection should show HID service UUID0x1812in the advertising payload.Testing
ba519c936c87b89c9c667c15b932d7faca5360d5). The device owner reports successful discovery, pairing, and BLE keyboard input on Mac after applying this fix in the diagnostic build.main,a59213f3ec6cd302fa32c2042b2700c9c24d991a:BleKeyboard.cppis identical to the 1.16.1 version and the same bug is present. This PR applies only the minimal fix on that main base.pio run -e m5stack-cardputersucceeded with the exact source tree published in this PR. This is the official Cardputer/ADV environment. Reused the local toolchain/dependency cache, including NimBLE-Arduino 2.5.1 and FastLED 3.10.3 (satisfying the upstream constraint). Existing upstream deprecation/audio warnings remain; no build configuration changes are included.git diff --checkpasses.Linked Issues
No linked issue.
User-Facing Change
Further Comments
Only
lib/Bad_Usb_Lib/BleKeyboard.cppchanges: one addition and one deletion. No diagnostic logging, binary artifacts, Wi-Fi, IR, SD, sniffer changes, or unrelated refactoring.