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

cross mob
DaGa_4352226
Level 2
Level 2
10 questions asked 5 replies posted 5 questions asked

Hello Community.

I am trying to get the Bluetooth address of a peer address and before I used the method CyBle_GapGetPeerBdAddr(). Now with the new version of BLE the compiler show an error "implicit declaration".  I have found the API Bluetooth v4.1 which it has this method.https://www.cypress.com/file/157996/download

Where can I find the API documentation of the BLE v5.0? or can someone tell me which method I should use to get the peer address of a mobile?

Regards,

David

0 Likes
1 Solution
Yugandhar
Moderator
Moderator
Moderator
1000 replies posted 5 likes given First comment on blog

Hello David,

Please use the API Cy_BLE_GAP_GetPeerBdAddr(), this function reads the peer Bluetooth device address identified by 'bdHandle'.

PSoC6 BLE supports Bluetooth v5.0. For PSoC4 BLE and PSoC6 BLE devices macros, structures, APIs will differ. Please refer to PSoC6 BLE API documentation in BLE component PDL Documentation. In PSoC Creator, Right click on the BLE Component ->click on "Open PDL Documentation".

Thanks,

P Yugandhar.

View solution in original post

0 Likes
3 Replies
Yugandhar
Moderator
Moderator
Moderator
1000 replies posted 5 likes given First comment on blog

Hello David,

Please use the API Cy_BLE_GAP_GetPeerBdAddr(), this function reads the peer Bluetooth device address identified by 'bdHandle'.

PSoC6 BLE supports Bluetooth v5.0. For PSoC4 BLE and PSoC6 BLE devices macros, structures, APIs will differ. Please refer to PSoC6 BLE API documentation in BLE component PDL Documentation. In PSoC Creator, Right click on the BLE Component ->click on "Open PDL Documentation".

Thanks,

P Yugandhar.

0 Likes
DaGa_4352226
Level 2
Level 2
10 questions asked 5 replies posted 5 questions asked

Hello P. Yugandhar.

Thanks for your reply. Now I am calling this method when the BD got the "CY_BLE_EVT_GAP_DEVICE_CONNECTED" event but the api_result throwns me an error : "Cy_BLE_GAP_GetPeerBdAddr Error 0x160001" This error can be either CY_BLE_ERROR_NO_DEVICE_ENTITY or CY_BLE_ERROR_INVALID_PARAMETER

Can you help me?

Thanks a lot

David Caraveo

0 Likes

Hello David,

Please add the below code in Stack event handler callback function and declare "cy_stc_ble_conn_handle_t  appConnHandle;" externally. Please refer Cy_BLE_GAP_GetPeerBdAddr() API declaration in the "CE212742_BLE_4.2_DataLength_Security_Privacy" code example in PSoC Creator.

cy_stc_ble_gap_peer_addr_info_t addr =

            {

                .bdHandle = appConnHandle.bdHandle

            };

Thanks,

P Yugandhar.

0 Likes