android - AltBeacon Library - reduce bluetooth scan period -
i using altbeacon library , trying detect beacons. want reduce time between scan cycles.
mbeaconmanager.setbackgroundscanperiod(30000l);
as per documentation above line should set background scan period 3 seconds. but, still see scan period 5 mins (300000 ms). missing anything?
there 2 method calls:
mbeaconmanager.setbackgroundscanperiod(1100l); mbeaconmanager.setbackgroundbetweenscanperiod(30000l);
the first call sets how long bluetooth scan last, , second call sets how long there between bluetooth scans. commands above 1.1 second scan every 31.1 seconds.
you should set backgroundscanperiod 1100 ms or more, because beacons advertise once per second have slight chance of being missed if transmission on boundary of when start , stop scanning.
Comments
Post a Comment