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

sd_ble_gap_adv_set_configure gives error 0x00003201

Hello,

I'm using S112 V6.1.1 with the Nrf52810. I get a error using sd_ble_gap_adv_set_configure() after a connection. On BLE_GAP_EVT_DISCONNECTED i try to change the advertising parameter and i get a error. The value of the error is 0x00003201.

/================================================================================================//
// L O C A L   F U N C T I O N S
//------------------------------------------------------------------------------------------------//
static void connectable_adv_init(void)
{
    uint32_t    error_code;
    advertising_data_init(FALSE);
    
    // Initialize advertising parameters (used when starting advertising).
    memset(&m_adv_params, 0, sizeof(m_adv_params));

    m_adv_params.properties.type = BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED;
    m_adv_params.p_peer_addr     = NULL;
    m_adv_params.filter_policy   = BLE_GAP_ADV_FP_ANY;
    m_adv_params.interval        = APP_ADV_INTERVAL;                     
    //m_adv_params.duration        = adv_duration_in_public; //xx * 10ms
    m_adv_params.duration        = APP_ADV_DURATION; //xx * 10ms
    m_adv_params.primary_phy     = BLE_GAP_PHY_1MBPS;
    
    error_code = sd_ble_gap_adv_set_configure(&m_adv_handle, &m_adv_data, &m_adv_params);
    APP_ERROR_CHECK(error_code);
}
//------------------------------------------------------------------------------------------------//
static void connectable_adv_with_whitelist_init(void)
{
    uint32_t    error_code;
    
    advertising_data_init(TRUE);
  
    // Initialize advertising parameters (used when starting advertising).
    memset(&m_adv_params, 0, sizeof(m_adv_params));

    m_adv_params.properties.type = BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED;
    m_adv_params.p_peer_addr     = NULL;
    m_adv_params.filter_policy   = BLE_GAP_ADV_FP_FILTER_CONNREQ; /**< Filter connect requests with whitelist. */
    m_adv_params.interval        = APP_ADV_INTERVAL;                     
    m_adv_params.duration        = APP_ADV_DURATION;
    m_adv_params.primary_phy     = BLE_GAP_PHY_1MBPS;
    
    error_code = sd_ble_gap_adv_set_configure(&m_adv_handle, &m_adv_data, &m_adv_params);
    APP_ERROR_CHECK(error_code);
}

Thx!

  • The error message  0x3201 indicates that you got the error BLE_ERROR_GAP_DISCOVERABLE_WITH_WHITELIST.

    Since BLE_ERROR_GAP_DISCOVERABLE_WITH_WHITELIST =  (NRF_GAP_ERR_BASE + 0x001) = (NRF_ERROR_STK_BASE_NUM+0x200+ 0x001) = (0x3000+0x200+ 0x001).

    If you look at the explanatory text beside the error in ble_gap.h, it says the following:

    "Use of Whitelist not permitted with discoverable advertising."

    You either have to remove the whitelist or change the advertising type.

    Best regards,

Related