- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How do you search for a specific BLE Friendly Name when scanning for another BLE device. At the moment, I can only find a BLE device based on Mac Address when scanning results are completed. Is there a way to find a device to connect with based on its BLE friendly name using PSOC creators library? I have looked through the 100 days project and was unable to find an example of this.
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Struct CYBLE_GAPC_ADV_REPORT_T has advertising or scan response data field which can be extracted while scanning for the peripheral device name based on the index value ( for the device name ) in advertising packet in CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT event.
Pseudo code --
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
case CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT:
advReport = (CYBLE_GAPC_ADV_REPORT_T *) eventParam;
/* check if report has device name corresponding to the intended matching peer */
if((advReport->data[1] == 0xff) && (advReport->data[2] == 0x31) \
&& (advReport->data[3] == 0x01) && (advReport->data[4] == 0x3b) \
&& (advReport->data[5] == 0x04))
{}
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Note: The device name value will be in hex format.
-Gyan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Struct CYBLE_GAPC_ADV_REPORT_T has advertising or scan response data field which can be extracted while scanning for the peripheral device name based on the index value ( for the device name ) in advertising packet in CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT event.
Pseudo code --
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
case CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT:
advReport = (CYBLE_GAPC_ADV_REPORT_T *) eventParam;
/* check if report has device name corresponding to the intended matching peer */
if((advReport->data[1] == 0xff) && (advReport->data[2] == 0x31) \
&& (advReport->data[3] == 0x01) && (advReport->data[4] == 0x3b) \
&& (advReport->data[5] == 0x04))
{}
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Note: The device name value will be in hex format.
-Gyan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Gyan! This is exactly what I was looking for!