Hello, Dialog expets.
I have dialog wearable kit and I have few questions.
I want to advertise sensors data in advertisement packet. But as I know advertisement packet can be up to 31 bytes.
In current firmware of wearable kit advertise it's name and supported services. If I will change for example each 100 ms advertisement adv_data by disableing services and add some new data - will it work still with adnfroid and iOs app? I mean next
Now we have:
static const uint8_t adv_data[] = {
0x0C, GAP_DATA_TYPE_LOCAL_NAME, 'D', 'i', 'a', 'l', 'o', 'g', ' ', 'W', 'R', 'B', 'L',
0x01
#if DWS_BLE_SERVICE
+ 0x02
#endif /* DWS_BLE_SERVICE */
#if HCS_BLE_SERVICE
+ 0x02
#endif /* HCS_BLE_SERVICE */
#if BAS_BLE_SERVICE
+ 0x02
#endif /* BAS_BLE_SERVICE */
#if HRS_BLE_SERVICE
+ 0x02
#endif /* HRS_BLE_SERVICE */
#if SUOTA_BLE_SERVICE
+ 0x02
#endif /* SUOTA_BLE_SERVICE */
,
GAP_DATA_TYPE_UUID16_LIST_INC,
#if DWS_BLE_SERVICE
0xA7, 0x2E, // = 0x2EA7 (DWS UUID)
#endif /* DWS_BLE_SERVICE */
#if BAS_BLE_SERVICE
0x0F, 0x18, // = 0x180F (BAS UUID)
#endif /* BAS_BLE_SERVICE */
#if HCS_BLE_SERVICE
0xC5, 0xC8, // = 0xC8C5 (HCS UUID)
#endif /* HCS_BLE_SERVICE */
#if HRS_BLE_SERVICE
0x0D, 0x18, // = 0x180D (HRS UUID)
#endif /* HRS_BLE_SERVICE */
#if SUOTA_BLE_SERVICE
0xF5, 0xFE, // = 0xFEF5 (DIALOG SUOTA UUID)
#endif /* SUOTA_BLE_SERVICE */
};
after 100 ms I want to change it to:
static const uint8_t adv_data[] = {
0x0C, GAP_DATA_TYPE_LOCAL_NAME, 'D', 'i', 'a', 'l', 'o', 'g', ' ', 'W', 'R', 'B', 'L',
0x08, GAP_DATA_TYPE_MANUFACTURER_SPEC, 0xD2, 0x00, ID_SENSOR_1, Data1, Data2, Data3, Data4,
};
after 100 ms I want to change it to:
static const uint8_t adv_data[] = {
0x0C, GAP_DATA_TYPE_LOCAL_NAME, 'D', 'i', 'a', 'l', 'o', 'g', ' ', 'W', 'R', 'B', 'L',
0x08, GAP_DATA_TYPE_MANUFACTURER_SPEC, 0xD2, 0x00, ID_SENSOR_2, Data1, Data2, Data3, Data4,
};
and so on when will advertise all sensors values and after again in loop.
Will it work in such way?

Hi Sparta,
The advertising PDU contains 31 bytes but user can append up to 28bytes into the advertising string. According to Bluetooth LE specifications, the maximum Advertising Data length is 28 bytes (31 minus 3 that are reserved to set the Advertising Data type flags - which shall not be set in Advertising Data using this function). If the manufacturer specific data cannot fit into the advertising packet, you can use the scan response data. The active scanner (through scan request) may request up to 31 bytes of additional information from the advertiser. To do so, you can upend the sensor data into the scan_rsp_data[] array. The API should be used in order to modify the Advertising Data and Scan Response Data is the ble_gap_adv_data_set() which is called into wrbl_task. In your case, you could append the sensor data into the Scan Response data, or upon 100ms (I assume upon a timer expiration ) stop advertising and update the Advertising Data.
也请阅读Advertising Concept Tutorialfrom our support website.
Thanks, PM_Dialog
Thanks a lot for quick responce. Will try.
Hi Sparta,
Please let me know if you need further clarifications on that or if you have any other follow up questions.
Thanks, PM_Dialog
So I have trouble as I have passive scanner that don't send scan request. So my question is still up to date