Writing BLE Service Data to Scan Response Packet | Cypress Semiconductor
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?