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

Concurrent central and observer with s130.

I use nrf51822xxac, sdk 9.0.0, sd130. When I connect to some beacon as a central I no longer receive BLE_GAP_EVT_ADV_REPORT and I am not able to receive advertising packets. When mobile phone connects to my device and I am peripheral I still receive BLE_GAP_EVT_ADV_REPORT events. I never stop scanning. What might be the cause of that? I guess s130 can still scan during connection as central.

Parents
  • I'm not sure what example you are using, but in for example ble_app_hrs_c the scanning will be stopped when a desired advertisment is recevied, see the handling of the BLE_GAP_EVT_ADV_REPORT event in on_ble_evt(). There you have sd_ble_gap_scan_stop(), and then sd_ble_gap_connect() is called to try to connect. This will start a scan just like with sd_ble_gap_scan_start() only that it will send a connection request if a desired advertisment is received again.

    When the connection is established, and the DM_EVT_CONNECTION event is received in device_manager_event_handler() the scan will be restarted, see scan_start().

Reply
  • I'm not sure what example you are using, but in for example ble_app_hrs_c the scanning will be stopped when a desired advertisment is recevied, see the handling of the BLE_GAP_EVT_ADV_REPORT event in on_ble_evt(). There you have sd_ble_gap_scan_stop(), and then sd_ble_gap_connect() is called to try to connect. This will start a scan just like with sd_ble_gap_scan_start() only that it will send a connection request if a desired advertisment is received again.

    When the connection is established, and the DM_EVT_CONNECTION event is received in device_manager_event_handler() the scan will be restarted, see scan_start().

Children
No Data
Related