cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Studio Bluetooth

New Contributor

i need to change device name on runtime and store in flash. actually i use api hci_control_handle_set_local_name

but here device name lost when i am restart the device.

so i need to change and store the name without losing when i am restart the device

0 Likes
Reply
6 Replies
Moderator
Moderator

Hi HaGo_4718696​,

Can you please check wiced_bt_dev_set_local_name()? Also, you can configure the BT_LOCAL_NAME in the wiced_bt_cfg.c file.

New Contributor

thanks for your responce sir,

actually i tryed wiced_bt_dev_set_local_name() but when turn off and turn on the device then i lost the  device name so i need  to store in flash. can you explain the process of storing the device name in flash

0 Likes
Reply
Moderator
Moderator

Does the device advertise after OFF-ON process? With which name does it advertise? Did you try setting the device name in wiced_bt_cfg.c file?

0 Likes
Reply
New Contributor

hi sir,

   initially  bluetooth advertising with "cybt-module"(BT_LOCAL_NAME[] ={"cybt-module"}).

and runtime i am change to "my bt module" by using hci_control_handle_set_local_name API and also i am storing in BT_LOCAL_NAME buffer.

    but when device turn off and on it advertising with "cybt-module" name.

0 Likes
Reply
Moderator
Moderator

Hi HaGo_4718696​,

Are you using device in HCI mode? hci_control_handle_set_local_name is not the correct APi to set the local name. As I suggested earlier, please use wiced_bt_dev_set_local_name().

Your description is little unclear, BT_LOCAL_NAME is in wiced_bt_cfg.c? Then the device will show that name only after reset.

By turn OFF-ON, you mean reset or 'powering off' the device directly?

New Contributor

below function  i am using for set the device name:

void hci_control_handle_set_local_name(uint8_t* p_data, uint32_t data_len)

{

    /* the local name is only from the second byte

     * The first bytes provides the length.

     */

    uint8_t name[250];

    memset(name, 0, sizeof(name));

    memcpy(name, &p_data[1], p_data[0] - 1);

    wiced_bt_dev_set_local_name((char*)name);

    app_write_eir();

}

By turn OFF-ON, you mean reset or 'powering off' the device directly?

A: 'powering off' the device directly

0 Likes
Reply