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

change advertisement index in advertise packet

advertise.pnghello there

in advertising packet i want something like first name of device and then service data and then manufacture data ??

how can i do that??

from screenshot , i want AD Data 3 first then AD Data 2 in advertisement packet means i want complete local name before complete list of 16 bit service uuids

Parents
  • i can't understand how to use adv_data_encode(....)

    like in this function

    static void advertising_init(void)
    {
        uint32_t      err_code;
        ble_advdata_t advdata;
    
        // Build and set advertising data
        memset(&advdata, 0, sizeof(advdata));
    
        advdata.name_type               = BLE_ADVDATA_FULL_NAME;
        advdata.include_appearance      = true;
        advdata.flags                   = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
       advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
        advdata.uuids_complete.p_uuids  = m_adv_uuids;
    
        ble_adv_modes_config_t options = {0};
        options.ble_adv_fast_enabled  = BLE_ADV_FAST_ENABLED;
        options.ble_adv_fast_interval = APP_ADV_INTERVAL;
        options.ble_adv_fast_timeout  = APP_ADV_TIMEOUT_IN_SECONDS;
    
        err_code = ble_advertising_init(&advdata, NULL, &options, on_adv_evt, NULL);
        APP_ERROR_CHECK(err_code);
    }
    

    how to use adv_data_encode(..)??

Reply
  • i can't understand how to use adv_data_encode(....)

    like in this function

    static void advertising_init(void)
    {
        uint32_t      err_code;
        ble_advdata_t advdata;
    
        // Build and set advertising data
        memset(&advdata, 0, sizeof(advdata));
    
        advdata.name_type               = BLE_ADVDATA_FULL_NAME;
        advdata.include_appearance      = true;
        advdata.flags                   = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
       advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
        advdata.uuids_complete.p_uuids  = m_adv_uuids;
    
        ble_adv_modes_config_t options = {0};
        options.ble_adv_fast_enabled  = BLE_ADV_FAST_ENABLED;
        options.ble_adv_fast_interval = APP_ADV_INTERVAL;
        options.ble_adv_fast_timeout  = APP_ADV_TIMEOUT_IN_SECONDS;
    
        err_code = ble_advertising_init(&advdata, NULL, &options, on_adv_evt, NULL);
        APP_ERROR_CHECK(err_code);
    }
    

    how to use adv_data_encode(..)??

Children
No Data
Related