CYBT-423028-02 (CYW20719) device name and address

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

cross mob
RSK_2736041
Level 1
Level 1

We are using SPP profile and I am not sure how and where can I add the BT_LOCAL_NAME + WICED_DEVICE_ADDRESS.

I looked at the other post about MAC Address as a device local name but WICED_DEVICE_NAME returns unresolved.

Also would it work with BT_DEVICE_ADDRESS=random option when programming??

0 Likes
1 Solution

Yes, you can use the API void wiced_bt_dev_read_local_addr (wiced_bt_device_address_t bd_addr); to get the local device address. The API is defined in wiced_bt_dev.h

View solution in original post

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

You can configure the BT_LOCAL_NAME in the wiced_bt_cfg.c file.

For the BT_DEVICE_ADDRESS, please refer to the following blog:Configuring the Bluetooth device address in CYW20706

You can also use the module programmer to set the BD_ADDRESS during the programming: WICED Module Programmer User Guide – KBA225060

In the API documentation there is only wiced_bt_set_local_bdaddr in the wiced_bt_dev.h

but if I want to get the Local Device Address being in use and then I would like to assign this to the Local Device Name during run time.

is there an object or a function call for this I could use?

0 Likes

Please refer to apps/snip/ble/gatt_db demo. In the hci_control.c, there is a function to set the device name as follows:

void hci_control_handle_set_local_name(uint8_t* p_data, uint32_t data_len)

{

    if (data_len >= MAX_DEV_NAME_LEN)

    {

        data_len = MAX_DEV_NAME_LEN - 1;

    }

    memcpy(gatt_db_device_name, p_data, data_len);

    gatt_db_device_name[data_len] = 0;

    WICED_BT_TRACE("%s: dev_name = %s\n", __func__, gatt_db_device_name);

#ifdef CYW20706A2

    wiced_bt_dev_set_local_name(gatt_db_device_name);

#endif

    hci_control_send_command_status_evt(HCI_CONTROL_EVENT_COMMAND_STATUS, HCI_CONTROL_STATUS_SUCCESS);

}

0 Likes

Hi there,

I can get the device name and change it that's not the problem.  But I want to know the device address during runtime if I am using BT_DEVICE_ADDRESS=random option during programming, shouldn't there be wiced_bt_get_local_bdaddr() function call?

0 Likes

Yes, you can use the API void wiced_bt_dev_read_local_addr (wiced_bt_device_address_t bd_addr); to get the local device address. The API is defined in wiced_bt_dev.h