How do I get the BLE address in Embedded Software ?

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

cross mob
shrac_2642471
Level 4
Level 4
5 likes given First like received First like given

Hi Guys,

For my project, I am generating the MAC address as following -->

BLE_Address.JPG
Now as you can see, if the address generated for example is 00:A0:50:AA:BB:CC, I want to know in the software this address. I need to use this address for our communication protocol. How do we read this address? Is there some API provided by Cypress to read this address ?

0 Likes
1 Solution

Hi

I figured it out. So the following API works correctly

CYBLE_API_RESULT_T CyBle_GetDeviceAddress(CYBLE_GAP_BD_ADDR_T* bdAddr);

Only when the BLE stack is TURNED ON. Otherwise it is incorrect.

STEPS

1. Wait for BLE STACK_ON event to occur

2. Then use the above API to get the correct address

View solution in original post

4 Replies
Owen_Zhang123
Moderator
Moderator
Moderator
5 questions asked 500 solutions authored 250 sign-ins

Please refer to the API CYBLE_API_RESULT_T CyBle_GetDeviceAddress (CYBLE_GAP_BD_ADDR_T *bdAddr).

0 Likes

Hi zhxh
Thanks for sharing this information. I will take a look at this and try it out.

Regards

Shrey

0 Likes

Dear zhxh
I used the API you specified. My device address as seen from LightBlue is 00:A0:50:4f:94:12

I used the API you recommended with type = 0x00 and type = 0x01 and both of which didn't result in this address? What address is it printing?

With 0x00

1970-01-01 00:00:00.000000 BLE ADDRESS PRINTING

1970-01-01 00:00:00.000000 80

1970-01-01 00:00:00.000000 95

1970-01-01 00:00:00.000000 19

1970-01-01 00:00:00.000000 29

1970-01-01 00:00:00.000000 49

1970-01-01 00:00:00.000000 80

With 0x01

1970-01-01 00:00:00.000000 BLE ADDRESS PRINTING

1970-01-01 00:00:00.000000 80

1970-01-01 00:00:00.000000 95

1970-01-01 00:00:00.000000 19

1970-01-01 00:00:00.000000 29

1970-01-01 00:00:00.000000 49

1970-01-01 00:00:00.000000 c0

How would I get the following address correctly in there ?

00:A0:50:4f:94:12

0 Likes

Hi

I figured it out. So the following API works correctly

CYBLE_API_RESULT_T CyBle_GetDeviceAddress(CYBLE_GAP_BD_ADDR_T* bdAddr);

Only when the BLE stack is TURNED ON. Otherwise it is incorrect.

STEPS

1. Wait for BLE STACK_ON event to occur

2. Then use the above API to get the correct address