I would like to perform observer role scanning i.e. passive scanning. I am using nRF52832, S132, SDK 15.2.0. I am trying as follows.
NRF_BLE_SCAN_DEF(m_scan);
static ble_gap_scan_params_t m_scan_param = /**< Scan parameters requested for scanning and connection. */
{
.active = 0,
.interval = 160
.window = 120
.filter_policy = BLE_GAP_SCAN_FP_ACCEPT_ALL,
.timeout = 0,
.scan_phys = BLE_GAP_PHY_AUTO,
.extended = false,
};
uint32_t BLE_Scan_Init(void)
{
ret_code_t err_code;
nrf_ble_scan_init_t init_scan;
memset(&init_scan, 0, sizeof(init_scan));
init_scan.p_scan_param = &m_scan_param;
//init_scan.connect_if_match = false;
//init_scan.conn_cfg_tag = APP_BLE_CONN_CFG_TAG;
err_code = nrf_ble_scan_init(&m_scan, &init_scan, BLE_Scan_Evt_Handler);
APP_ERROR_CHECK(err_code);
return err_code;
}
The scanning is only happening (getting advertising report) when I set active = 1 in the m_scan_param.
What I am doing wrong here?
What is the way to achieve passive scanning?