Page 1 of 1

BLE: Change advertised name during runtime?

Posted: Thu Jan 16, 2020 8:59 am
by Mike1997
Hi,

as one can see in many examples (like e.g. the one from https://sourceforge.net/p/iot-leaf/code ... eDHT22.ino ), the advertised name of a BLE-server typically is set up once during initialisation via a call BLEDevice::init().

Now for my application I want to change it from time to time during runtime. Is there a possibility to do that easily via a specific function call? Or does one really need to reinitialise the complete BLEDevice and all connected servers in order to change that name?

Thanks :-)

Re: BLE: Change advertised name during runtime?

Posted: Fri Jan 17, 2020 3:25 am
by chegewara
Looks like there is no option in library, but you can call esp_ble_gap_set_device_name anytime to set new name, then restart advertising.

Re: BLE: Change advertised name during runtime?

Posted: Thu Feb 06, 2020 6:39 pm
by Mike1997
Works - thank you very much :-)

Re: BLE: Change advertised name during runtime?

Posted: Tue Nov 28, 2023 12:14 pm
by RiverS_16
Hello,


I am using ESP 32 S3 and need to change BLE advertise name in runtime.
Can i please have sample code for "BLE: Change advertised name during runtime"?



Thanks,