Update Device name ID during advertising

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

cross mob
Anonymous
Not applicable

Hello,

   

How can I update dynamically the "device name ID" during the advertising ? And how to update the "manufacturer data" dynamically ? I use the CyBle_GapSetLocalName() and the CyBle_GapUpdateAdvData() methode, but the update is not correct. What is the correct BLE event I can wait before use these methodes ?

   

Thank you.

   

cordially

   

Charles

0 Likes
2 Replies
Anonymous
Not applicable

Hi,

   

You should use the CyBle_GapSetLocalName local name API before the device starts advertising. However, the CyBle_GapUpdateAdvData API can be used for dynamically changing the packets when advertising. To know how this API is being used, please refer to the example project in "http://www.cypress.com/blog/100-projects-100-days/project-009-dynamic-broadcaster-changing-advertisi..."

   

Most importantly make sure that duplicate filtering is disabled in your Central Device, so Central will be able to sense the change in advertisement packet of the same device.

   

Regards,

   

- Madhu Sudhan

0 Likes
Anonymous
Not applicable

Hi Charles,

   

 

   

Adding more info to MADY response.

   

 

   

CyBle_GapUpdateAdvData () should be called when the BLESS state is in CYBLE_BLESS_STATE_EVENT_CLOSE.

   

To know the bless state, 

   

1)You should use low mode code mentioned in AN92584 in your project.

   

2)Check the BLESS state using CyBle_GetBlessState() and when it returns  CYBLE_BLESS_STATE_EVENT_CLOSE then only update the adv data using CyBle_GapUpdateAdvData ().

   

 

   

The project was based on old BLE component. If you are using the latest component then you should call this CyBle_GapUpdateAdvData () during CYBLE_BLESS_STATE_EVENT_CLOSE . In the project CyBle_GapUpdateAdvData () was called when bless state is active. We have change the functionality of the CyBle_GapUpdateAdvData () API so that's why you need to this change in the project that was pointed in previous post

   

 

   

Regards,

   

Vikas

0 Likes