5 Replies Latest reply on Jul 15, 2019 12:00 PM by StLu_2280906

    Unable to dynamically change advertising packets on PSoC 4 BLE




      I am trying to dynamically update the advertising packets sent by my PSoC 4 device in the "Central and Peripheral" project. I have seen the following thread:


      Recommended method to update manufacturer data when NOT advertising


      and have attempted to do this by changing the cyBle_discoveryModeInfo.advData->advData[] array before starting advertising. I have done this in the StackEventHandler's CYBLE_EVT_STACK_ON function:


      /* Set adv data packet */

      char deviceName[] = "12345678";

      (cyBle_discoveryModeInfo.advData->advData)[3] = 0x09;   //Set length

      for(i=5; i<13; i++)

          (cyBle_discoveryModeInfo.advData->advData)[i] = deviceName[i-5];

      cyBle_discoveryModeInfo.advData->advDataLen = 13;



      /* ------------------------- */


      The issue I am having is that the advertising packet does not change, which I see by using the LightBlue app and looking at the device name. Interestingly, if I change the cyBle_discoveryModeInfo.r->respData array this way, it does change the response packet. However, I need to change the initial advertising packet as well. What am I doing wrong in this case?


      Thank you very much.