CYW20819 Public address and authenticate issue

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

cross mob
ToKo_4602001
Level 4
Level 4
50 sign-ins 25 replies posted 25 sign-ins

To use BD_ADDR (Public address) to BLE advertising, I have used multi_advertisement function.

---------------------------------------------------------------------------------

  wiced_bt_set_local_bdaddr(addr, 0);

  wiced_bt_dev_read_local_addr(adv_params.own_bd_addr);

  adv_params.own_addr_type = BLE_ADDR_PUBLIC;

  wiced_set_multi_advertisement_params(1, &adv_params);

---------------------------------------------------------------------------------

As I expected, I can see the advertising packet with public address and a central device can connect to this device by using the public address.

However if I initiate authentication, this procedure fails with error code:SMP_DHKEY_CHK_FAIL.

I found the following web site and it indicates that the problem may be related to LE privacy functionality.

CY_BLE_EVT_GAP_AUTH_FAILED with reason 0x24

By the way, if I use normal  wiced_bt_start_advertisements() function, private address (RPA) will be used.

Regards,

0 Likes
1 Solution
Owen_Zhang123
Moderator
Moderator
Moderator
5 questions asked 500 solutions authored 250 sign-ins

Please use the API wiced_bt_start_advertisements() to start advertising.

If you need to disable the RPA, please set the rpa_refresh_timeout to WICED_BT_CFG_DEFAULT_RANDOM_ADDRESS_NEVER_CHANGE in the wiced_bt_cfg.c file as follows:

    /* Interval of  random address refreshing */

    .rpa_refresh_timeout                = WICED_BT_CFG_DEFAULT_RANDOM_ADDRESS_NEVER_CHANGE,          /**< Interval of  random address refreshing - secs */

BTW, you can also set the bt address in the make file such as:

BT_DEVICE_ADDRESS?=20819A123456

View solution in original post

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

Please use the API wiced_bt_start_advertisements() to start advertising.

If you need to disable the RPA, please set the rpa_refresh_timeout to WICED_BT_CFG_DEFAULT_RANDOM_ADDRESS_NEVER_CHANGE in the wiced_bt_cfg.c file as follows:

    /* Interval of  random address refreshing */

    .rpa_refresh_timeout                = WICED_BT_CFG_DEFAULT_RANDOM_ADDRESS_NEVER_CHANGE,          /**< Interval of  random address refreshing - secs */

BTW, you can also set the bt address in the make file such as:

BT_DEVICE_ADDRESS?=20819A123456

Thank you for your response.

However even though WICED_BT_CFG_DEFAULT_RANDOM_ADDRESS_NEVER_CHANGE is set, the address used for advertising is a PRIVATE ADDRESS.

I'd like to use a public address by disabling the RPA.

Regards,

0 Likes

When the parameter is set, the address is public per test:

pastedImage_0.png

0 Likes

Thank you for confirmation.

In addition to setting rpa_refresh_timeout, by changing the makefile definition (BT_DEVICE_ADDRESS?=FFFFFFFFFFFF to BT_DEVICE_ADDRESS?=20819A123456), and optionally issuing wiced_bt_set_local_bdadd(), I have been able to see the advertising packets with the public address I set.

It seems that we should not set FFFFFFFFFFFF as default BD_ADDR in makefile.

Thank you very much.

0 Likes