Please refer the Day009_Dynamic_Broadcaster example project in the GitHub. In this example, manufacturer specific data is continuously updated in the firmware to demonstrate dynamic advertisement payload update feature.
I extracted this part of code:
extern CYBLE_GAPP_DISC_MODE_INFO_T cyBle_discoveryModeInfo;
#define advPayload (cyBle_discoveryModeInfo.advData->advData)
#define MANUFACTURER_SPECIFIC_DYNAMIC_DATA_INDEX (28u) /* index of the dynamic data in the ADV packet */
#define LOOP_DELAY (1u) /* How often would you like to update the ADV payload */
#define MIN_PAYLOAD_VALUE (0u)
#define MAX_PAYLOAD_VALUE (200u)
if(CyBle_GetBleSsState() == CYBLE_BLESS_STATE_EVENT_CLOSE)
count++; /* Loop counter */
/* Once the system enters Sleep/Deepsleep mode during advertisement, the source of wake-up is the next
* advertisement interval which has a wakeup interval of 1 advertisement (ADV) interval (100ms).
* LOOP_DELAY * ADV interval is the interval after which ADV data is updated in this firmware.*/
if(count >= LOOP_DELAY)
/* Dynamic payload will be continuously updated */
advPayload[MANUFACTURER_SPECIFIC_DYNAMIC_DATA_INDEX] = dynamicPayload++;
if(dynamicPayload == MAX_PAYLOAD_VALUE)
dynamicPayload = MIN_PAYLOAD_VALUE;
count = 0;
Can you please explain, how to update more than just 1 byte in the manufacturer data?
Am I right, that the defined "MANUFACTURER_SPECIFIC_DYNAMIC_DATA_INDEX (28u)" refers to the marked index number in the picture?
So I just have to extend the Data size in my BLE module and define some more number like this:
#define MANUFACTURER_SPECIFIC_DYNAMIC_DATA_INDEX_1 (29u)
#define MANUFACTURER_SPECIFIC_DYNAMIC_DATA_INDEX_2 (30u)
advPayload[MANUFACTURER_SPECIFIC_DYNAMIC_DATA_INDEX_1] = dynamicPayload++;
advPayload[MANUFACTURER_SPECIFIC_DYNAMIC_DATA_INDEX_2] = dynamicPayload++;
My main aim is to broadcast the manufacturer device address to get a never changing and unique device identifier.
Is this aim covered by doing so?
1. Can you please explain, how to update more than just 1 byte in the manufacturer data?
Ans:- We have to increase the data size in the BLE component as shown in attached image. Please make sure that the maximum length of the advertisement packet that we can send is limited to 31 bytes.
2. Am I right, that the defined "MANUFACTURER_SPECIFIC_DYNAMIC_DATA_INDEX (28u)" refers to the marked index number in the picture?
MSD.PNG 46.3 K