cancel
Showing results for 
Search instead for 
Did you mean: 

BlueNRG : how to set the device name in the advertising

Mich1
Associate III

I tried the Cube BLE exemple to tried to set the device name for the advertising message but I can only see the advertising address. How could I do to set the name?

  /* Update device name */
  ret = aci_gatt_update_char_value(service_handle, dev_name_char_handle, 0, sizeof(device_name), device_name);
  if(ret != BLE_STATUS_SUCCESS) {
    PRINTF("aci_gatt_update_char_value() failed: 0x%02x\r\n", ret);
    return ret;
  }

1 ACCEPTED SOLUTION

Accepted Solutions
KnarfB
Principal III

It works for me. I set the name in aci_gap_set_discoverable(...) and change it later on by aci_gatt_update_char_value(...)

A BLE scanner app shows the first name. But, when connected, the Generic access service shows the second name as Device Name.

(CubeMX 5.3.0 + X-CUBE-BLE1 4.4.0 generated code skeleton)

View solution in original post

4 REPLIES 4
KnarfB
Principal III

Hi Mich,

use strlen(device_name) for the length of the name string.

Mich1
Associate III

Thanks a lot for the correction of this cube issue.

The problem is still here: no name in the advertising.

KnarfB
Principal III

It works for me. I set the name in aci_gap_set_discoverable(...) and change it later on by aci_gatt_update_char_value(...)

A BLE scanner app shows the first name. But, when connected, the Generic access service shows the second name as Device Name.

(CubeMX 5.3.0 + X-CUBE-BLE1 4.4.0 generated code skeleton)

PSzab.1
Associate II

What does 0x42 return value mean?

I got this when I wanted to change the name:

aci_gatt_update_char_value_ext() failed: 0x42
RC_DeviceInit() failed: 0x42