please tell me how to set random device address

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

cross mob
Anonymous
Not applicable

I use PSoC Creator3.3.

   

Please tell me how to set  (Advertiser Address Type=random )  on broadcaster role?

   

Best Regards,yoshizu

0 Likes
1 Solution
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi Yoshizu,

   

You can set the address type as random as below:
cyBle_discoveryModeInfo.advParam->ownAddrType = CYBLE_GAP_ADDR_TYPE_RANDOM; in the
CYBLE_EVT_STACK_ON event before starting advertisment.

   

This is only for setting the address type. For setting the advertising address as a random address, you can generate a random address and set using CyBle_SetDeviceAddress() API. They call the above code line of setting address type. Then start adv.

   

Thanks,
Anjana

View solution in original post

0 Likes
3 Replies
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi Yoshizu,

   

You can set the address type as random as below:
cyBle_discoveryModeInfo.advParam->ownAddrType = CYBLE_GAP_ADDR_TYPE_RANDOM; in the
CYBLE_EVT_STACK_ON event before starting advertisment.

   

This is only for setting the address type. For setting the advertising address as a random address, you can generate a random address and set using CyBle_SetDeviceAddress() API. They call the above code line of setting address type. Then start adv.

   

Thanks,
Anjana

0 Likes
Anonymous
Not applicable

Hi Anjana,

   

When I change BD address by CyBle_SetDeviceAddress() set, then BD address is changed.

   

But  when add  "cyBle_discoveryModeInfo.advParam->ownAddrType = CYBLE_GAP_ADDR_TYPE_RANDOM"   to source,

   

then BD address is not changed.

   

why?

   

Best regards,yoshizu

0 Likes
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi yoshizu,

   

Could you please make sure you have followed the below sequence:

   

- Make sure device is not advertising mode

   

- set the device address

   

- cyBle_discoveryModeInfo.advParam->ownAddrType = CYBLE_GAP_ADDR_TYPE_RANDOM;

   

- call enter discovery API

   

If still you are facing any issue, please share the project, I will help you to find what could be the issue.

   

Thanks,
Anjana

0 Likes