when to call wiced_bt_set_local_bdaddr API

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

cross mob
YaTr_3516311
Level 5
Level 5
25 sign-ins First solution authored 100 replies posted

Hi,

I want to add function to chage mac address and I know there are many ways. I want to use wiced_bt_set_local_bdaddr API to set address. My question is that is this API can call any time, even though FW run a while then to set?

I use CYBT343026-01 EVAL board. I test two ways.

1. CALL API before wiced_bt_dev_read_local_addr(bda)

result: address is changed

2. CALL API after wiced_bt_dev_read_local_addr(bda)(receive uart cmd then do call the API),then reset device

result: address no change

0 Likes
1 Solution

I did not understand your query properly.

- Call wiced_bt_set_local_bdaddr() after stack initialization.

- Make

.rpa_refresh_timeout            = 0,

in your code.

- Make sure that you are not calling API wiced_bt_ble_enable_privacy().

Even after reset, you should be able to see the BD address set by you using API wiced_bt_set_local_bdaddr().

View solution in original post

0 Likes
5 Replies
SheetalJ
Moderator
Moderator
Moderator
First comment on KBA 750 replies posted 500 likes received

Hi YaTr_3516311​,

wiced_bt_dev_read_local_addr() is to read the BD address. You have to call wiced_bt_set_local_bdaddr() before the read address API so that you can see the changed BD address using wiced_bt_dev_read_local_addr() API.

0 Likes

H,i,

I use CYBT343026-01 EVAL board. I test two ways.

1. CALL API(wiced_bt_set_local_bdaddr) before wiced_bt_dev_read_local_addr(bda)

result: address is changed

2. CALL API(wiced_bt_set_local_bdaddr) after wiced_bt_dev_read_local_addr(bda)(receive uart cmd then do call the API),then reset device

result: address no change.

So  call wiced_bt_set_local_bdaddr should be before wiced_bt_dev_read_local_addr,right?  If call wiced_bt_set_local_bdaddr after wiced_bt_dev_read_local_addr then reset EVAL, this command cannot be stored?

0 Likes

Hi Treacy,

We couldn't able to understand your query properly.

When you say address is changed or address no change, how you are verifying it? Is it by wiced_bt_dev_read_local_addr API or by seeing it in some app?

Generally call the set address API wiced_bt_set_local_bdaddr before start advertisement API .

Thanks,
Anjana

0 Likes

Hi,

1. I confirmed with wiced_bt_dev_read_local_addr API.

2. CALL API(wiced_bt_set_local_bdaddr) after wiced_bt_dev_read_local_addr(bda)(receive uart cmd then do call the API),then reset device

This step is after start advertisement API. After that I reset device. As your said, wiced_bt_set_local_bdaddr is not saved in flash? If it saved in flash, I call wiced_bt_set_local_bdaddr once, then reset deivce, it should be use new address

0 Likes

I did not understand your query properly.

- Call wiced_bt_set_local_bdaddr() after stack initialization.

- Make

.rpa_refresh_timeout            = 0,

in your code.

- Make sure that you are not calling API wiced_bt_ble_enable_privacy().

Even after reset, you should be able to see the BD address set by you using API wiced_bt_set_local_bdaddr().

0 Likes