- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sometimes, central scan stops working, and there are no more callbacks for peripheral advertisements (blecm_RegleAdvReportCb), and I have to reset central board to get it going again, and I again get a callback for ad of each peripheral.
TO START SCAN, I DO THIS:
blecm_setScanEnable(HCIULP_SCAN_MODE_OFF, blecen_cen_cfg.filter_duplicates);
blecm_startScan(blecen_cen_cfg.scan_type,
blecen_cen_cfg.high_scan_interval, blecen_cen_cfg.high_scan_window,
blecen_cen_cfg.scan_adr_type, blecen_cen_cfg.scan_filter_policy,
blecen_cen_cfg.filter_duplicates);
TO STOP SCAN, I DO THIS:
blecm_setScanEnable(HCIULP_SCAN_MODE_OFF, blecen_cen_cfg.filter_duplicates);
Solved! Go to Solution.
- Labels:
-
Scanning-Advertising
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What are your high and low scan parameters? Take the default parameters for instance:
blecen_cen_cfg.high_scan_interval | = 96; | // slots |
blecen_cen_cfg.high_scan_window | = 48; | // slots |
blecen_cen_cfg.high_scan_duration | = 30; | // seconds |
blecen_cen_cfg.low_scan_interval | = 2048; | // slots |
blecen_cen_cfg.low_scan_window | = 18; | // slots |
blecen_cen_cfg.low_scan_duration | = 300; | // seconds |
For the first 30s, the device is scanning at 50% duty cycle and for the next 5 minutes, it is scanning at under 1% duty cycle. So the probability of finding a device that uses undirected advertisement (even at 20mS interval) is quite low (use directed adv instead and the probability increases dramatically). Try changing these parameters (say increase the high scan duration or reduce the low scan interval or increase low scan window) and you will see that you will continue to get adv reports more often.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the response Doug.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can't tell by the wording of the post. What was the answer to this issue? To manually stop scanning and re-start it after a period of time?
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What are your high and low scan parameters? Take the default parameters for instance:
blecen_cen_cfg.high_scan_interval | = 96; | // slots |
blecen_cen_cfg.high_scan_window | = 48; | // slots |
blecen_cen_cfg.high_scan_duration | = 30; | // seconds |
blecen_cen_cfg.low_scan_interval | = 2048; | // slots |
blecen_cen_cfg.low_scan_window | = 18; | // slots |
blecen_cen_cfg.low_scan_duration | = 300; | // seconds |
For the first 30s, the device is scanning at 50% duty cycle and for the next 5 minutes, it is scanning at under 1% duty cycle. So the probability of finding a device that uses undirected advertisement (even at 20mS interval) is quite low (use directed adv instead and the probability increases dramatically). Try changing these parameters (say increase the high scan duration or reduce the low scan interval or increase low scan window) and you will see that you will continue to get adv reports more often.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi arvinds,
Can you elaborate bit more about this statement 'use directed adv instead and the probability increases dramatically'?
How does direct advertising increase the probability comparing to undirect type without changing the scan interval and window?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Because with directed adv, the advertiser advertises at near 100% bandwidth. So when the central scans for the 18 slots (11.25mS) every 2048 slots (1.28s) it is guaranteed to get the central's attention. With undirected adv, the adv packet and the scan have to line up just right or you lose another 1.28s.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, arvinds. Also checked on specification, it defines more intensive broadcasting in direct advertising mode.