Address of Connected Bluetooth peer devices is incorrect

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

cross mob
MuNa_4652896
Level 4
Level 4
First like received First like given

Hello

I am using PSoC 63 BLE and this function to get the bdAddress of the connected peer devices.

//Print the Connected Device BT Address

            cy_stc_ble_conn_handle_t connectionIndParameter = *(cy_stc_ble_conn_handle_t*) evenParam;

            cy_stc_ble_gap_peer_addr_info_t peerBdAdd;

            peerBdAdd.bdHandle = connectionIndParameter.bdHandle;

                  

            uint8_t retbdAddr = Cy_BLE_GAP_GetPeerBdAddr(&peerBdAdd);

           

            retbdAddr = Cy_BLE_GAP_GetPeerBdAddr(&peerBdAdd);

            //uint8_t bdAddress[6];

            printf("\r\n Error: %x",retbdAddr);

            printf( "\r\n   - > Device bdAddress:");

            for(uint i=CY_BLE_BD_ADDR_SIZE ; i>0 ; i--)

            {

                printf( "%2.2x ", (uint8_t) peerBdAdd.bdAddr.bdAddr[i-1]);

                //bdAddress = peerBdAdd.bdAddr.bdAddr[i-1];

            }

            printf("\r\n");

It prints a 6 bytes address, however this is not the connected device address. Usually after a long session of connections and disconnections trying things out, this address changes as well.

Any ideas?

0 Likes
1 Solution
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello,

At my end, I'm able to printing the correct central device address in CY_BLE_EVT_GATT_CONNECT_IND event. Could you please check the connected device address type ?

Most of the smart phones use RPA(Random Private Address) as their Bluetooth device address, where this Resolvable Private Addresses (RPA) will be changed at regular intervals of time. So, if the central device uses the RPA address then it can changes over a period of time.

Thanks,
P Yugandhar.

View solution in original post

1 Reply
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello,

At my end, I'm able to printing the correct central device address in CY_BLE_EVT_GATT_CONNECT_IND event. Could you please check the connected device address type ?

Most of the smart phones use RPA(Random Private Address) as their Bluetooth device address, where this Resolvable Private Addresses (RPA) will be changed at regular intervals of time. So, if the central device uses the RPA address then it can changes over a period of time.

Thanks,
P Yugandhar.