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

Can't get receive BLE_GAP_ROLE_CENTRAL.

Hi,

I try to run a dual mode(peripheral/central) with S130. I'm using SPI serialization and sending command form an external MCU. I try to follow the example ble_app_hrs_rscs_relay in SDK 9.0.

I pass the below scan setting to sd_ble_gap_scan_start();

m_scan_param.active = 1; // Active scanning set.

m_scan_param.selective = 0; // Selective scanning not set.

m_scan_param.interval = SCAN_INTERVAL;// Scan interval(0x00A0).

m_scan_param.window = SCAN_WINDOW; // Scan window(0x0050).

m_scan_param.p_whitelist = NULL; // No whitelist provided.

m_scan_param.timeout = 0x0000; // No timeout

By using a JTAG I can see that the data correctly transfer to Nordic MCU and the correct param setting the call down to the soft device.

sd_ble_gap_scan_start() return a successful status.

To test my code, I set up a client with a heart rate service adverting and I was able to detect it with an ble app on my android phone. But I I did not get any gap event with BLE_GAP_ROLE_CENTRAL coming from the nordic. I verify that I can get BLE_GAP_ROLE_PERIPH event when I connect to a host.

I also receive a lot of BLE_GAP_EVT_ADV_REPORT events, but none of them have gap_evt.params.connected.role set to BLE_GAP_ROLE_CENTRAL.

Somehow, the peripheral mode is working but the central mode is not working for me.

After a scan start, if there is an client sending out advertising data, should I receive gap event with BLE_GAP_ROLE_CENTRAL role?

Do I need to setup anything before I can call sd_ble_gap_scan_start()?

Thanks, Kevin.

Related