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

Calling scan_start() will not trigger a scan

I have a question. The sample code I modified is nRF52832\examples\ble_central\ble_app_uart_c.
Scanning will be triggered when scan_start() is called. The device has been found in BLE_GAP_EVT_ADV_REPORT in nrf_ble_scan_on_ble_evt.

Now, I prepare a NUS peripheral connected to the center. However, when I call scan_start() in this connection state, I will not receive nrf_ble_scan_on_ble_evt unless I disconnect from the NUS peripheral.

Does anyone know where the problem is or what am I missing?

Parents
  • Hello,

    Now, I prepare a NUS peripheral connected to the center. However, when I call scan_start() in this connection state, I will not receive nrf_ble_scan_on_ble_evt unless I disconnect from the NUS peripheral.

    Have you confirmed that your calls to start scanning is successful, and/or does your device reset unexpectedly at any time?
    It would be great to see some more of the code, particularly the changes you have made to start scanning while already in the connection.
    It could be helpful for you to take a look at the BLE Multi-link central example. The example is based on the BLE Blinky central example, and demonstrates how this example can be changed to accommodate multiple peripheral devices.

    Are you familiar with the nRF Sniffer tool? It is a powerful tool to wield when developing for BLE, and it would be very helpful to see a sniffer trace of the communication when this behavior happens, to take a closer look at what is happening on the air.
    We can proceed with the sniffer trace if there is nothing immediately showing up in the code.

    Best regards,
    Karl

Reply
  • Hello,

    Now, I prepare a NUS peripheral connected to the center. However, when I call scan_start() in this connection state, I will not receive nrf_ble_scan_on_ble_evt unless I disconnect from the NUS peripheral.

    Have you confirmed that your calls to start scanning is successful, and/or does your device reset unexpectedly at any time?
    It would be great to see some more of the code, particularly the changes you have made to start scanning while already in the connection.
    It could be helpful for you to take a look at the BLE Multi-link central example. The example is based on the BLE Blinky central example, and demonstrates how this example can be changed to accommodate multiple peripheral devices.

    Are you familiar with the nRF Sniffer tool? It is a powerful tool to wield when developing for BLE, and it would be very helpful to see a sniffer trace of the communication when this behavior happens, to take a closer look at what is happening on the air.
    We can proceed with the sniffer trace if there is nothing immediately showing up in the code.

    Best regards,
    Karl

Children
Related