You can try the CyBle_GapGetPeerDevSecurityKeyInfo(cyBle_connHandle.bdHandle , &localKeyFlag , &peerKeys );
Please take a look at this post which could be help. You can find a demo code in the post.
Hello engenharia3_3567971 ,
As you might have already know that most of the modern smart phones uses RPA ( Resolvable Private Address ) as a Bluetooth Device Address which can be read by a peripheral device on connection using the API CyBle_GapGetPeerBdAddr().
To read the ID address ( Public or Static ) of the smart phone ,you need to connect and pair the smart phone with Cypress BLE device. On pairing the ID address will be shared along with other security keys and you can use a new API CyBle_GapGetPeerDevSecurityKeyInfo() to read the ID address of smart phone.
Refer the attached project.