not the BD address
for example I named my Peripheral to Emitto
I want to get that "Emitto" string in my Central.
How do I print it. (UART, printf)
On Sat, Jan 13, 2018 at 12:05 AM, e.pratt_1639216 <
how shall I extract the characters from the data:
should i use this?
scan_report = (CYBLE_GAPC_ADV_REPORT_T) eventParam;
scan_report->data up to scan_report->data ?
based from here:
On Sat, Jan 13, 2018 at 11:47 AM, Cyrus Nikko Pante <email@example.com>
Yes, when you receive the GAPC_SCAN_PROGRESS_RESULT, you can parse the resulting data to get the data associated with the advertisement data. You will need to make sure that the advertising device is including it's name (which you have done in the image above).
The data format is: <Length of "advertisement component"><0x09 to signify local name><"Your Local Name">, so you can either only check data through data for checking if the exact same advertisement data bytes match in the exact same spot, or you can iterate through the whole data array checking for where the length of the advertisement service/component is length 0x07, the service/component type is 0x09 (local name), and the local name itself has the matching bytes to the name "Emitto"
But your approach overall is spot on for the way I would implement it.
(sorry for the slow reply )
Thanks a lot.
Do you have a different approach? Would that be complex?
No, the approach you are using is what I would use. Unless you have need to support future versions where the location of the name may change in the advertisement, or other BLE devices may have the same name in the same location, then there is no other thought you need to put into this