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

What is a typical size for adv_data?

I have modified the template app to advertise several custom UUIDs and one SIG UUID.  All UUIDs are being sent as a Scan Response.  I have selected expanded data size.  S140 is the Softdevice

When I reach the call to sb_ble_gap_adv_set_configure, I receive an error 7 NRF_ERROR_INVALID_PARAM.

When I inspect the second param is p_advertising->p_adv_data and when I dive into this, p_advertising->p_adv_data.adv_data.len is a HUGE number, 0x51F8, and I need to know if there is any way that is a correct length?  I suspect this might be my issue, but don't have a window into why the Softdevice rejected the parameter, or even if it IS this parameter that is being rejected.

Is there some magic to debugging the Softdevice calls I am missing, or are their actions completely obscured?

Thanks so much!

-Ben Burch

BTR Controls, Inc.

Parents
  • I did look at this.  Thing is;  I do not have anything in the advdata fields (cnt == 0, address == NULL) already.  Is there something additional I need to do to DE-select the use of advdata?

    Thanks!

  • I see. 

    Could you upload your code so I can take a look? If not your entire main.c, the advertising init would be useful. 

    Regards, 
    Joakim

  • **@brief Function for initializing the Advertising functionality.
     */
    
    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.srdata.name_type                = BLE_ADVDATA_FULL_NAME;     
        init.srdata.include_appearance       = true;
        init.srdata.flags                    = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
        init.srdata.uuids_complete.uuid_cnt  = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
        init.srdata.uuids_complete.p_uuids   = m_adv_uuids;
     
    //    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.advdata.uuids_complete.uuid_cnt = 0;
        init.advdata.uuids_complete.p_uuids  = NULL;
    
        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.config.ble_adv_primary_phy      = BLE_GAP_PHY_1MBPS;
        init.config.ble_adv_secondary_phy    = BLE_GAP_PHY_2MBPS;
        init.config.ble_adv_extended_enabled = true;
    
        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);
    }
    

    That's it above.  Thank you!

  • It occurs to me to say what I intend to be doing;  I have several custom service UUIDs.  These are of course too large for the adv packet.  I want to send the data using an expanded response packet during the scan response.  I am told that I have to not send the adv packet if I am going to use expanded data in the scan response, so I have moved all services to the scan response packet and am attempting to suppress the advertising data.

    However, any strategy which will send out all of my service data without running out of space is equally acceptable.

    Thanks!

Reply
  • It occurs to me to say what I intend to be doing;  I have several custom service UUIDs.  These are of course too large for the adv packet.  I want to send the data using an expanded response packet during the scan response.  I am told that I have to not send the adv packet if I am going to use expanded data in the scan response, so I have moved all services to the scan response packet and am attempting to suppress the advertising data.

    However, any strategy which will send out all of my service data without running out of space is equally acceptable.

    Thanks!

Children
Related