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

RiverS_16
Posts: 7
Joined: Mon Sep 25, 2023 3:54 am

Re: BLE: Change advertised name during runtime?

Postby RiverS_16 » Tue Nov 28, 2023 12:14 pm

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,

Who is online

Users browsing this forum: Bing [Bot] and 188 guests