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-advertising-packets"
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.
- Madhu Sudhan
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