nRF52832 extended advertising

  • I downloaded the latest SDK(15.1), and how to advertising more infomation,more than 31 byte.

         init.config.ble_adv_extended_enabled = true;

        0> <error> app: ERROR 7 [NRF_ERROR_INVALID_PARAM] at ..\..\..\main.c:699
        0> PC at: 0x00029363
        0> <error> app: End of error report

        uint32_t err_code = ble_advertising_start(&m_advertising, BLE_ADV_MODE_FAST);
        APP_ERROR_CHECK(err_code);        // ERROR 7 [NRF_ERROR_INVALID_PARAM] 

Parents Reply Children
  • I would take a look at the running speed & cadence example from sdk 15.1 to see how advertising extensions are setup there. Specifically this function:
     
    /**@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.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.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);
    }
Related