In my application, I'm setting a message as manufacturer's data to be sent with the advertising message. To do that is simple, since I have a data type ble_advdata_t
, and I can set a pointer to an object of type ble_advdata_manuf_data_t
.
But when I receive a advertising event, the type I get is ble_gap_evt_adv_report_t
. This type has a field data[31], where the manufacturer's data is included, but also a bunch of other data sent with the advertising.
I'm looking for a way to get just the manufacture's data. Maybe a "parser" to a variable of type ble_advdata_t
.
I have tried to use the function ble_advdata_set
, passing the first argument as NULL and the second as a pointer to a variable of type ble_advdata_t
, like this:
ble_advdata_set(NULL, &advdata)
since in the documentation it says that it is a function for encoding and setting the advertising data and/or scan response data. Setting the first argument to NULL would just scan response data. But this doesn't seem to work.
Do anybody know what can I do?
Thanks in advance.