PSOC Creator BLE Scanning for BLE Friendly Name

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
dusj_3409981
Level 1
Level 1

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.

0 Likes
1 Solution
GyanC_36
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

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

View solution in original post

0 Likes
2 Replies
GyanC_36
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

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

0 Likes

Thanks Gyan! This is exactly what I was looking for!

0 Likes