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

how to confing non-connectable advertise

In s110 sdk 8, peripheral can connect one master and advertise in a non-connectable state simultaneously by here but I did not find out how to confing non-connectable advertise , any one can help ? Thanks!

Parents
  • Simply call sd_ble_gap_adv_start(). You must advertise in non-connectable mode when in connection. And note that when advertise in non-connectable mode you would need to have advertising interval of minimum 100ms. Something like this:

    // Initialize advertising parameters (used when starting advertising).
    memset(&m_adv_params, 0, sizeof(m_adv_params));
    
    m_adv_params.type        = BLE_GAP_ADV_TYPE_ADV_NONCONN_IND;
    m_adv_params.p_peer_addr = NULL;                             
    m_adv_params.fp          = BLE_GAP_ADV_FP_ANY;
    m_adv_params.interval    = NON_CONNECTABLE_ADV_INTERVAL; // >100 ms
    m_adv_params.timeout     = APP_CFG_NON_CONN_ADV_TIMEOUT;
    
    uint32_t err_code;
    
    err_code = sd_ble_gap_adv_start(&m_adv_params);
    APP_ERROR_CHECK(err_code);
    
  • Thank you, I configure as you said,now I can advertise in non-connectable mode when connect one master, HoweVer scan request report can not work in non-connectable mode on the event "BLE_GAP_EVT_SCAN_REQ_REPORT", How to fix it ? thanks

Reply Children
No Data
Related