Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

AIROC™ Bluetooth Forum Discussions

seanb
Level 2
Level 2
5 replies posted 5 questions asked First solution authored

Hi Community,

I'm using PSoC 62 with LBEE5KL1DX (with CY4343W). The advertisement name comes from the Bluetooth Configurator's GAP settings. But because we will be having multiple devices with the same firmware, I'd like to change the advertisement name based on the MAC address or something unique dynamically during run-time. 

I can get the MAC id of the device using wiced_bt_dev_read_local_addr(). The advertisement name seems to be coming from wiced_bt_cfg_settings.device_name. When I call the wiced_bt_dev_read_local_addr() before I do the wiced_bt_stack_init(), the wiced_bt_dev_read_local_addr() function hangs; but when I call it after the stack init function, its OK, but it looks like it is too late to set the device name after the stack init is called.

Can someone suggest a proper way to change the advertisement name on startup instead of using the static name that comes from the gap settings page of the bluetooth configurator? 

Appreciate any advice/suggestions you can provide.

0 Likes
2 Replies
AnjanaM_61
Moderator
Moderator
Moderator
First comment on KBA 5 questions asked First question asked

Hello @seanb ,

You can use the BLE APIs only after stack init. 

What you can do is , set the desired name before the start advertisement API .  

Regards,

Anjana

0 Likes

Thank you for the reply. Can you please specify exactly which variable or API should I change before the start advertisement API?? I changed both wiced_bt_cfg_settings.device_name and app_gap_device_name. I'm using CySmart app(iOS), In the BLE devices list, it still shows the name configured through the BLE Configurator, but, interestingly, when I connect to this device, I briefly see "Connecting <updated name>" and connects to it; I would like it to show the updated name in the list of BLE devices in the CYSmart app.  So, looks like there are still remnants of the original name that I can't seem to figure out a way to update it during run-time. Please advise.

0 Likes