This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How can I know that it's scanning or not?

Hi. I'm using nRF51822AC, SDK12.2.0 as Central.

Q1. Is there any function to know regarding it is scanning or not?

Q2. As your example "ble_app_multilink_central", Does "Scan" stop automatically after "sd_ble_gap_connect"?

Q3. Why do you use "(void) sd_ble_gap_scan_stop();" in "scan_start" function?

I hope your reply.

Parents
    1. No. I don't think this exists. Use an application timer with the same duration as the scan.
    2. Yes. According to the other examples. Scan stops automatically when you connect succesfully
    3. Stop scan is sometimes called in start_scan function so that you can call start_scan and not get an error if its already scanning
  • Why are you casting the return value from sd_ble_gap_scan_stop() to void

    Also, I'd check that sd_ble_gap_scan() stop returns a valid response before continuing

    Error code 0x08 is

    #define 	NRF_ERROR_INVALID_STATE   (NRF_ERROR_BASE_NUM + 8)
     	Invalid state, operation disallowed in this state.
    
Reply
  • Why are you casting the return value from sd_ble_gap_scan_stop() to void

    Also, I'd check that sd_ble_gap_scan() stop returns a valid response before continuing

    Error code 0x08 is

    #define 	NRF_ERROR_INVALID_STATE   (NRF_ERROR_BASE_NUM + 8)
     	Invalid state, operation disallowed in this state.
    
Children
No Data
Related