advertise and scan both return rc=0, but do not appear to work .

following on from  https://devzone.nordicsemi.com/support/348883 

I have code that executes and functions that return error_code = 0

but for peripheral mode the NRF conect app does not see the device advertised

the device has a couple

```

err_code = sd_ble_gap_adv_start(m_adv_handle, APP_BLE_CONN_CFG_TAG);
if (err_code != NRF_SUCCESS)
{
QLOGE("Failed to start advertising: %ld", err_code);
return false;
}
QLOGD("BLE advertising started");
return true;
```

for central mode, the scan callback does not trigger. 

```

// Initialize central mode
//QLOGD("Initializing BLE in central mode");
// Initialize scanner
nrf_ble_scan_init_t scan_init_params;
memset(&scan_init_params, 0, sizeof(scan_init_params));
// Set scan parameters
scan_init_params.p_scan_param = &(ble_gap_scan_params_t){
.active = 1,
.interval = SCAN_INTERVAL,
.window = SCAN_WINDOW,
.timeout = SCAN_TIMEOUT,
.scan_phys = BLE_GAP_PHY_1MBPS,
.filter_policy = BLE_GAP_SCAN_FP_ACCEPT_ALL,
};
err_code = nrf_ble_scan_init(&m_scan, &scan_init_params, NULL);
if (err_code != NRF_SUCCESS)
{
QLOGE("Failed to initialize scanner: %ld", err_code);
return false;
}
// Initialize database discovery
err_code = ble_db_discovery_init(NULL);
if (err_code != NRF_SUCCESS)
{
QLOGE("Failed to initialize database discovery: %ld", err_code);
return false;
}
m_scan_handler = scan_handler;
err_code = nrf_ble_scan_start(&m_scan);
if (err_code != NRF_SUCCESS)
{
QLOGE("Failed to start scanning: %ld", err_code);
return false;
}
QLOGD("BLE scanning started");
return true;
```
debugging with Ozone. on Murata Type2AB with 52840 
the original code did not have Softdevice, and this was added.. 
Parents Reply Children
No Data
Related