To develop an application to advertise dynamic data with Eddystone Protocol.

I want to develop a beacon application that advertises data with Eddystone protocol. I have a static const variable named value initialized to some number. And in BT_DATA_BYTES API in 6-byte instance data I am passing this variable. So that, I get the variable value in the data that I have advertised. 

Now, I want to advertise data as such so that if I use a while loop to increment that value of variable. That modified data should be advertised, and we should see that data in that device in Nrf connect app. How can we get this updated incremented data every time when we advertise.

static const uint8_t value=25;
static const struct bt_data ad[] = {
	BT_DATA_BYTES(BT_DATA_FLAGS, BT_LE_AD_NO_BREDR),
	BT_DATA_BYTES(BT_DATA_UUID16_ALL, 0xaa, 0xfe),
	//BT_DATA(BT_DATA_MANUFACTURER_DATA, mfg_data, 3),
	BT_DATA_BYTES(BT_DATA_SVC_DATA16,
      0xaa, 0xfe, /* Eddystone UUID */
      0x00, /* Eddystone-UID frame type */
      0x00, /* Calibrated Tx power at 0m */
      value, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* 10-byte Namespace */
      0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f) /* 6-byte Instance */
};

Related