Random advertising data

Hi,

     We are developing trainer sensor device and looks very smooth so far. But our questions is some apps change our device name to Bryton Trainer xx in the searching stage. 

xx has a different number for each unit. Like below picture.

If I use nRF_connect to search our device. I only see "bryton trainer". This is what we want.

Why?

Parents Reply Children
  • Hi,

           Below is my code about adverting data

    #define DEVICE_NAME                     "Bryton Trainer"                               /**< Name of device. Will be included in the advertising data. */
    
    static void advertising_init(void)
    {
        int32_t   err_code;
        ble_advertising_init_t init;
    
    
        ble_uuid_t m_adv_uuids[] = {{BLE_UUID_CYCLING_POWER,  BLE_UUID_TYPE_BLE},
                                   {BLE_UUID_FITNESS_MACHINE, BLE_UUID_TYPE_BLE}};
    
        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_TIMEOUT_IN_SECONDS;
    
        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);
    }

    So, nrf_connect will show the SHORT_LOCAL_NAME, is it right?

    Thank you.

    John.

  • It dosent seem you are actually setting the name of your device to `DEVICE_NAME`.

    Also, the max data allowed in an advertisement packet is 31, but you are attempting to add at least 34.

  • Hi,

          Also, the max data allowed in an advertisement packet is 31, but you are attempting to add at least 34. ->I don't know what it means. Should I need to change some thing for my code?

    I try to change name type from FULL to SHORT and set SHORT length is 3. But this app is showing "Bry 22". this number still exist.

    Thank you.

    John.

  • Is it possible that the device you are using to scan for these devices is adding the number to the end of the name?

  • Hi,

      Because this app was not developed by us. So I don’t know. I just want to find out where the numbers captured by the app are?

    Thank you.

    john.

Related