1 Reply Latest reply on Sep 4, 2015 4:40 AM by rohitk_

    Writing BLE Service Data to Scan Response Packet

      I'm trying to advertise a 4 byte value over BLE, which contains RGBW color values that I can use to customize the appearance of the device in the found devices table.


      I can add the 4 bytes to the advertisement or scan response packet under 'Service Data', and read it in iOS without any problem. Really nice.


      But now I'd like to change the Service Data inside the advertisement or scan response packet.


      1. How can this be done programmatically? Where can I find an API listing and more documentation on how to set any of those values programmatically?


      2. How can I set those values if my setup include a Bootloader and Bootloadable program, where the BLE CSD is in the Bootloader?


      3. Should I use the advertisement or scan response packet to store writable data? I read somewhere that the Scan Response packet should not be changed. However, I cannot put the device name (that I can change as well) and the service data in the same packet, it would be too big. That's why I left the device name in the advertisement packet and put the Service Data (including the Service UUID) inside the Scan Response packet. Good practice?

        • 1. Re: Writing BLE Service Data to Scan Response Packet

          1. Check out the BLE component datasheet (on TopDesign, right click on BLE component -> Open Datasheet..) to see all the APIs that component supports. Search for advertisement update. For updating the content in ADV or Scan response packet, use the API CyBle_GapUpdateAdvData() with updated parameters.




          2. Are the bootloader and bootloadable sharing the same stack memory? If yes, then you can resuse the same API as said above?




          3. I am not sure why anyone would want to stop you fro updating the Scan response packet on the fly. I think what you are trying to do is amenable and no issue should come by using it.