fix(ble): Fix default advertising name in NimBLE#12268
fix(ble): Fix default advertising name in NimBLE#12268me-no-dev merged 1 commit intoespressif:masterfrom
Conversation
👋 Hello lucasssvaz, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
Test Results 90 files 90 suites 32m 15s ⏱️ Results for commit c704a6a. |
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description of Change
This pull request improves how the BLE device name is managed and advertised by ensuring consistent storage and retrieval across the BLE stack. The main focus is on reliably setting and using the device name for BLE advertising, addressing issues where the underlying GAP service did not always reflect the intended name.
Device Name Management Improvements:
m_deviceNametoBLEDeviceto store the device name persistently, and provided a staticgetDeviceName()method for access (BLEDevice.cpp,BLEDevice.h). [1] [2] [3] [4]m_deviceNameduringBLEDevice::initinstead of immediately setting it on the GAP service, deferring the actual GAP update until BLE stack synchronization (BLEDevice.cpp).BLEDevice::onSyncto set the device name on the GAP service fromm_deviceNameafter stack synchronization, improving reliability and ensuring the device name is always correctly set (BLEDevice.cpp).Advertising Logic Enhancements:
BLEAdvertising::startto retrieve the device name directly fromBLEDevice::getDeviceName()if not already set, and ensure it is included in the advertising data, working around issues with the GAP service name getter (BLEAdvertising.cpp).Test Scenarios
Tested locally