This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Device Name Issue

Hi,
I am following the below link for creating custom services/characteristics.
https://github.com/bjornspockeli/nRF52-Bluetooth-Course 
 I have set the device name as follows but BLE is advertising only with the first 4 chars.

#define DEVICE_NAME "Nordic_Template" /**< Name of device. Will be included in the advertising data. */

The BLE advertising name is showing "Nord".

The device shows only the first 4 letters.

Does any suggestion please?

Thanks!
Parents
  • Hi

    I think the advdata.name_type is set to BLE_ADVDATA_SHORT_NAME in your advertising_init() function, as this will only take up 4 bytes of the advertisement and use the first 4 characters of the device name. You can try changing this to BLE_ADVDATA_FULL_NAME to add the full device name in your advertisement. Keep in mind that using a name as long as Nordic_Template will take up 15/31 of the bytes that are available for an advertisement package, so you won't be able to fit much else into that advertising packet.

    Best regards,

    Simon

Reply
  • Hi

    I think the advdata.name_type is set to BLE_ADVDATA_SHORT_NAME in your advertising_init() function, as this will only take up 4 bytes of the advertisement and use the first 4 characters of the device name. You can try changing this to BLE_ADVDATA_FULL_NAME to add the full device name in your advertisement. Keep in mind that using a name as long as Nordic_Template will take up 15/31 of the bytes that are available for an advertisement package, so you won't be able to fit much else into that advertising packet.

    Best regards,

    Simon

Children
  • Hi

    I have checked in  advertising_init() . Here is the function.
    Its already  BLE_ADVDATA_FULL_NAME

    static void advertising_init(void)
    {
    ret_code_t err_code;
    ble_advertising_init_t init;

    memset(&init, 0, sizeof(init));

    init.advdata.name_type = BLE_ADVDATA_FULL_NAME;
    init.advdata.include_appearance = true;
    init.advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
    init.advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    init.advdata.uuids_complete.p_uuids = m_adv_uuids;

    init.config.ble_adv_fast_enabled = true;
    init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
    init.config.ble_adv_fast_timeout = APP_ADV_DURATION;

    init.evt_handler = on_adv_evt;

    err_code = ble_advertising_init(&m_advertising, &init);
    APP_ERROR_CHECK(err_code);

    ble_advertising_conn_cfg_tag_set(&m_advertising, APP_BLE_CONN_CFG_TAG);
    }

Related