- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Few question about scan and call back:
1) If I used the follow blecm_startScan to start scan, will it timeout based on the configuration blecen_cen_cfg.low_scan_duration ?
blecm_startScan (
blecen_cen_cfg.scan_type,
blecen_cen_cfg.low_scan_interval,
blecen_cen_cfg.low_scan_window,
blecen_cen_cfg.scan_adr_type,
blecen_cen_cfg.scan_filter_policy,
blecen_cen_cfg.filter_duplicates);
2) if I use blecen_Scan(LOW_SCAN) to start the scan and use blecen_Scan(NO_SCAN) to stop it before timeout, will the call back function (BLEAPP_APP_TIMER_SCAN) be called?
3) if I use blecm_setScanEnable to stop scanning, will the call back function (BLEAPP_APP_TIMER_SCAN) be called?
blecm_setScanEnable(HCIULP_SCAN_MODE_OFF, blecen_cen_cfg.filter_duplicates);
Solved! Go to Solution.
- Labels:
-
Scanning-Advertising
-
SDK 2.X
-
Timers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello.
I'm sorry I haven't replied back earlier. I didn't have time to look at the source code.
Here are answers to your question:
1. Yes, it would be okay to set it like that (not sure why you would want to do that though).
scan_duration is only used for the scan timer, which enables the scan callback. So changing the scan_duration will effect when the scan callback is called. Also notice that scan_window has units of slots where as in scan_duration is in seconds. Don't mix the numbers.
I'm not sure if the scan is stopped when the callback is called...
2. Whenever you start a scan, the timer will call whatever callback defined at variable blecen_usertimerCb. The default is NULL.
3. Yes, you can change the intervals by setting a new value to blece_cen_cfg, but you must restart the scan by calling blecen_Scan function.
Again, I'm sorry if this reply is really late.
But I thought if I put the info, someone else might be able to benefit from it.
Hope this info helps.
Thank you.
James