- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
how do i get the device name to my central after:
case CYBLE_EVT_GATT_CONNECT_IND:
connHandle = *(CYBLE_CONN_HANDLE_T *)eventparam
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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[5] through data[10] 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 )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
how shall I extract the characters from the data:
should i use this?
CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT:
scan_report = (CYBLE_GAPC_ADV_REPORT_T) eventParam;
scan_report->data[3] up to scan_report->data[10] ?
based from here:
On Sat, Jan 13, 2018 at 11:47 AM, Cyrus Nikko Pante <cnpante@gmail.com>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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[5] through data[10] 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 )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot.
Do you have a different approach? Would that be complex?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ohhh yes, thanks. That's currently my problem though changing a Service Data dynamically.
Changing an advertisement data.
Thanks again!