You are here

Writing BLE Service Data to Scan Response Packet | Cypress Semiconductor

Writing BLE Service Data to Scan Response Packet

Summary: 1 Reply, Latest post by roit on 04 Sep 2015 04:40 AM PDT
Verified Answers: 1
Last post
Log in to post new comments.
user_460593777's picture
19 posts

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?

roit's picture
Cypress Employee
221 posts

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.

Log in to post new comments.