1 Reply Latest reply on Aug 23, 2018 2:29 AM by ShipingW_81

    read modify write current advertisement packet?

    alca_3047856

      I have been reading on how to change the advertising packet at runtime.  My goal is to change the "manufacturer data" so that a unique device name will be shown during scanning of the peripheral.

       

      It seems the way to do this is to call the below function. 

       

      Is there a simple way to get the current advertisement packet, so that I can simply modify the "manufacturer data" in the packet?  Or do I have to first see what the advertisement packet is through the ble module configuration through the schematic, hardcode the data that I do not want to update, then call the update function?

      Cy_BLE_GAPP_UpdateAdvScanData()

        • 1. Re: read modify write current advertisement packet?
          ShipingW_81

          You can use Cy_BLE_GAPP_UpdateAdvScanData() during advertising is on. Before calling this function, you need do below steps:

          1)define the data array of new advertising packet by yourself -- advdata. You can get the array in BLE_config.c (-- cy_ble_discoveryData), by setting in BLE customizer accordingly.

          2)pass the array address to target struct to be configured:

          cy_ble_configPtr- >discoveryModeInfo[CY_BLE_PERIPHERAL_CONFIGURATION_0_INDEX].advData = &advdata