BLE Device Addresses

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

cross mob
StSc_1311791
Level 3
Level 3
10 replies posted 5 replies posted 5 questions asked

When my central receives a scan from the client, it has the client's address in a CYBLE_GAPC_ADV_REPORT_T data structure.  My central can connect to the client using this address.  But in my client code, I get (I assume) my client's address by calling CyBle_GetDeviceAddress.  THese two addressed don't match, why?

0 Likes
1 Solution

If routine CyBle_GetDeviceAddress() is called while the client is advertising, the address returned matches what is in the advertising packet received by the Central.

View solution in original post

0 Likes
4 Replies
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello,

Could you please let me know how you configured your client device whether it is GAP peripheral or central.

Can you please share your project ?

Thanks,

P Yugandhar.

0 Likes

Thanks for your reply.  I have two CY8CKIT-042-BLE kits.  I also have two projects, one is a client and one as central.

The Client configuration:

     Profile:Custom

     Profile role: Server (GATT Server)

     GAP role: Periferal

The Central configuration:

     Profile:Custom

     Profile role:Client(GATT Client)

     GAP role: Central

My central is able to connect to the client and read/write data from/to the client.  Everything works.  My question is a curiosity question.  When I call  routine CyBle_GetDeviceAddress() on the client, I get a different address than advReport->peerBdAddr my Central receives in the following code snippet in the callback routine when receiving a scan result.

case CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT:

     advReport = (CYBLE_GAPC_ADV_REPORT_T *) eventParam;

The advReport->peerBdAddr address is what my central uses to connect to the client.

Again, everything works but I don't understand why the address obtained by call CyBle_GetDeviceAddress() on the client is not the address obtained by the Central from the scan.

I don't think sharing my projects would add any more useful information.

0 Likes

If routine CyBle_GetDeviceAddress() is called while the client is advertising, the address returned matches what is in the advertising packet received by the Central.

0 Likes

Note: BLE device with GATT role as server and GAP role as Peripheral is a Peripheral device with server configuration.

Thanks,

P Yugandhar.

0 Likes