BLE: Change advertised name during runtime?

Mike1997
Posts: 14
Joined: Fri May 10, 2019 6:57 am

BLE: Change advertised name during runtime?

Postby Mike1997 » Thu Jan 16, 2020 8:59 am

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 :-)

chegewara
Posts: 1211
Joined: Wed Jun 14, 2017 9:00 pm

Re: BLE: Change advertised name during runtime?

Postby chegewara » Fri Jan 17, 2020 3:25 am

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.

Mike1997
Posts: 14
Joined: Fri May 10, 2019 6:57 am

Re: BLE: Change advertised name during runtime?

Postby Mike1997 » Thu Feb 06, 2020 6:39 pm

Works - thank you very much :-)

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 37 guests