How can I add scan response data to the SDK example ble_app_beacon?
How can I add scan response data to the SDK example ble_app_beacon?
Hi!
The approach might vary depending on what version of the SDK you are working with.
Maybe you could provide a little more information?
SDK version, what device, softdevice version etc. is useful information to add in your questions.
However, you can take a look at our advertising tutorial, and the chapter about the Scan response data.
The tutorial is from one of the older SDK but the approach will be similiar.
Also, the ble_app_uart example adds data to the scan reponse packet, so you can get an idea of how it's done.
Let me know if you have any further questions.
Best regards,
Joakim.
I use SDK 15.0.0, softdevice S132, board nRF6827 Rev. 1.2.1 (nRF52 Development kit), PCA 10040, Segger embedded studio for ARM Release 3.34a
I have looked into the ble_app_uart example, but I cannot find the line(s) where the scan response data is set.
I receive
Advertisement data: 02:01:05:0C:09:4E:6F:72:64:69:63:5F:55:41:52:54 (here at the end is Nordic_UART)
Scan response data: 11:07:9E:CA:DC:24:0E:E5:A9:E0:93:F3:A3:B5:01:00:40:6E
But where is the scan response data in the code?
Thanks for your help!
Hi.
If you take a look at line 613-614 of the main.c file.
The ble_app_uart adds the 128-bit UUID to the scan response packet.
If you didn't already, I would suggest that you take a look at the tutorial I referred to in my previous answer.
Best regards,
Joakim.
But in that way, I can only change the bytes "01:00" at the end of the scan response data.
For example:
static ble_uuid_t m_adv_uuids[] = /**< Universally unique service identifier. */
{
//original: {BLE_UUID_NUS_SERVICE, NUS_SERVICE_UUID_TYPE}
{0x5678, NUS_SERVICE_UUID_TYPE} //Now 78:56 in the scan response data
};
Where can I change the first 14 bytes? Is that a 128 bit UUID? Where is it set?
(I looked at your tutorial, but the API's of the older SDKs are different from version 15. And the older SDKs have no support for Segger Embedded Studio)
Thanks for your help!