2 Replies Latest reply on Mar 3, 2016 10:21 AM by vikasv_56

    Update Device name ID during advertising



      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.





        • 1. Re: Update Device name ID during advertising



          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

          • 2. Re: Update Device name ID during advertising

            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