Project fall with repeatedly call nrf_ble_scan_start(&m_scan);

Hi!
SDK17.1 S132 nRF52832

I use hrs_c example and it works. But I added adertising code and wanna use both central and periperial at same time. Works, but until the moment when I make connect to my central and disconnect. After disconnect I start 

nrf_ble_scan_start(&m_scan);

again and got 

NRF_BREAKPOINT_COND;

project fall inside 

ret_code_t nrf_ble_scan_start(nrf_ble_scan_t const * const p_scan_ctx)

function.

I can't understand the reason.

There is no any warnings regarding memory in RTT debagger.

So, how to use both central and peripherial at same time? I used it before on SDK15.

Parents Reply Children
  • devcolorama said:
    Or is this disallowed in both cases?

    Yes, you cannot update the whitelist while scanning or advertising.

    devcolorama said:
    But when I updated scanning, without advertising, I made stop scanning first? Therefore, if advertising would work I'll got an error?

    I did not understand that. Can you elaborate?

    Note that as you are not updating the whitelist when you start advertising, you can start scanning (and update the whitelist in the process ad discussed earlier in this thread), and then start advertising without causing problems if you want to advertise and scan concurrently.

Related