1. When the device B is in central mode store the advertisement data(RSSI Value) of device A in some buffer in device B. After switching the device B to peripheral mode, update the data buffer to structure CYBLE_GAPP_DISC_DATA_T cyBle_discoveryData before starting the advertisement as shown in below code.
2. You can also update the ADV data and SCAN response data of a Device while advertising is ongoing using CyBle_GapUpdateAdvData() API. Please refer to the Day009_Dynamic_Broadcaster project in the GitHub for more information.
How do i update the buffer to the structure?.How is it possible if there were two advertising devices whose data has to to stored in device B?
At the central device, in scan progress result event(CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT), check for the particular advertising device address and then store the RSSI value in a buffer as shown in the below code.
/* Checking for Device 1 */
if(advReport.peerBdAddr==0x05 && advReport.peerBdAddr==0xff && advReport.peerBdAddr==0x31 && advReport.peerBdAddr==0x01&&advReport.data==0x08 &&advReport.data==0x09)
/* Checking for Device 2*/
else if(advReport.peerBdAddr==0x04 && advReport.peerBdAddr==0xaf && advReport.peerBdAddr==0x50 && advReport.peerBdAddr==0x78&&advReport.data==0x0a&&advReport.data==0x00)
Please let me know if this helps.
I have created a buffer and storing the value .I would like to know how can i update that to the structure like you suggested?
1. You can update the buffer data to CYBLE_GAPP_DISC_DATA_T This adv data will be advertised to all the central devices.before starting the advertisement(after scanning was stopped) as shown in below code.