This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

device length about sd_ble_gap_device_name_set

Hi I use SDK 12.3 and sdk 2.0.1 , and set a device name length is 21 like "1234567890ABCDEFGHIJK" by sd_ble_gap_device_name_set; but in the advertise data the name length is only 18 and the name is "1234567890ABCDEFGH" ;

and on Android Phone display name is "1234567890ABCDEFGH", length 18; but on iOS Phone is "1234567890ABCDEFGHIJK" length 21;

so I don`t know which one is right , and why lost 3 octets name?

Parents
  • It seems Android and iPhone have different maximum device name lengths. As this case shows, the max advertising packet length is 31 bytes. If you need to advertise more data, you can use the scan response packet (see link). If your name is too long, you can get a data size limit error. But I would advise you to use a shorter name. That way, it is easier for you identify on different devices and you use up less advertising packet space.

  • I get the data in the air, it is really 18 data name, I can set a shorter name,but I want know why can`t set a longer name, the descripter of sd_ble_gap_device_name_set() said must be smaller or equal than BLE_GAP_DEVNAME_LEN (31), so why the length large than 18 will be shorted?

Reply
  • I get the data in the air, it is really 18 data name, I can set a shorter name,but I want know why can`t set a longer name, the descripter of sd_ble_gap_device_name_set() said must be smaller or equal than BLE_GAP_DEVNAME_LEN (31), so why the length large than 18 will be shorted?

Children
No Data
Related