Fix Device Name in ATT Read Request (0x2A00). - #2
Merged
Merged
Conversation
Device Name is exposed in two places: - Advertisement data: this is set properly in startAdvertising. - GATT attribute Device Name (0x2A00). This one is handled internally in NimBLE and comes from ble_svc_gap_device_name_set. This is set initially, but then BLEDevice::createServer calls ble_svc_gap_init which resets the device name. This causes the device to apparently "change name after pairing": < ACL Data TX:... flags 0x00 dlen 7 meshtastic#113 [hci0] 14.241149 ATT: Read Request (0x0a) len 2 Handle: 0x0003 Type: Device Name (0x2a00) > ACL Data RX: Handle 2048 flags 0x02 dlen 11 meshtastic#115 [hci0] 14.269050 ATT: Read Response (0x0b) len 6 Value[6]: 6e696d626c65 # "nimble" Workaround this by setting the device name once again after BLEDevice::createServer.
phaseloop
approved these changes
Feb 23, 2026
Author
Author
Author
|
Did some basic testing with this build(Heltec V4). Upgrading from the last stable release preserved existing BT bonds and everything functioned as expected. Forgetting and re-bonding worked at least as well as before. General interactions tested fine — no regressions noted. |
Author
|
Thank you very much @dblaber I have been running this on my Heltec v3, with Bluetooth connected, for two days. No issues. Reconnects automatically on power cycle. Reconnects automatically on config change. @vidplace7 would you mind looking at this and merging if it looks OK? |
Author
Author
|
Pinged vid on Discord |
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.
Device Name is exposed in two places:
< ACL Data TX:... flags 0x00 dlen 7 meshtastic#113 [hci0] 14.241149
ATT: Read Request (0x0a) len 2
Handle: 0x0003 Type: Device Name (0x2a00)
Workaround this by setting the device name once again after BLEDevice::createServer.