我在移动时以10Hz(eddystone UID,eddystone TLM和iBeacon)传输信标,当移动停止时,它会继续传输1分钟然后停止。 我的目标是检测信标何时停止移动所以我使用了以下代码,这实际上是altbeacon网页上提供的基本示例,具有自定义时间:
public class BeaconReaderActivity extends Activity implements BeaconConsumer, MonitorNotifier, RangeNotifier {
private BeaconManager beaconManager;
private Region beaconRegion;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_beacon_reader);
beaconManager = BeaconManager.getInstanceForApplication(this);
beaconManager.getBeaconParsers().add(new BeaconParser()
.setBeaconLayout(BeaconParser.EDDYSTONE_UID_LAYOUT));
beaconManager.getBeaconParsers().add(new BeaconParser()
.setBeaconLayout(BeaconParser.EDDYSTONE_TLM_LAYOUT));
beaconManager.setRegionStatePeristenceEnabled(false);
beaconManager.setForegroundScanPeriod(101L);
beaconManager.setForegroundBetweenScanPeriod(0L);
beaconManager.setBackgroundScanPeriod(101L);
beaconManager.setBackgroundBetweenScanPeriod(0L);
beaconRegion = new Region(
"beacon-region",
null,
Identifier.parse(INSTANCE_ID),
null);
beaconManager.bind(this);
}
@Override
public void onBeaconServiceConnect() {
beaconManager.addMonitorNotifier(this);
try {
beaconManager.startMonitoringBeaconsInRegion(beaconRegion);
} catch (RemoteException e) {
e.printStackTrace();
}
}
@Override
public void didEnterRegion(Region region) {
beaconManager.addRangeNotifier(this);
try {
beaconManager.startRangingBeaconsInRegion(beaconRegion);
} catch (RemoteException e) {
e.printStackTrace();
}
}
@Override
public void didExitRegion(Region region) {
try {
beaconManager.stopRangingBeaconsInRegion(beaconRegion);
} catch (RemoteException e) {
e.printStackTrace();
}
}
@Override
public void didDetermineStateForRegion(int i, Region region) {
switch (i) {
case 0:
Log.e("BEACON MANAGER", "Beacon out of region");
break;
case 1:
Log.e("BEACON MANAGER", "Beacon entered in region");
break;
}
}
@Override
public void didRangeBeaconsInRegion(final Collection<Beacon> beacons, Region region) {
Log.e("BEACON MANAGER", "Frame received");
}
}
不幸的是我遇到了两种问题:
通常信标从该区域退出,似乎没有任何理由,尽管从最后一帧收到的差距远低于10秒(退出区域时段仍然默认为1);在logcat下面:
04-24 11:46:04.669 8254-10315/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 11:46:04.838 8254-10316/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 11:46:04.983 8254-10317/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 11:46:05.199 8254-10323/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 11:46:05.375 8254-10324/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 11:46:05.527 8254-10325/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 11:46:05.697 8254-10328/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 11:46:05.884 8254-10332/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 11:46:06.028 8254-10333/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 11:46:06.179 8254-10334/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 11:46:06.380 8254-10340/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 11:46:06.536 8254-10341/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 11:46:06.688 8254-10342/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 11:46:06.862 8254-10348/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 11:46:06.999 8254-10350/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 11:46:07.204 8254-10351/com.applications.r08y.beaconreader E/BEACON MANAGER: Beacon out of region
有人可以向我解释为什么会这样吗?我能做些什么来使软件更健壮吗?
由于
---编辑---
添加setDebug(True)后的logcat
04-24 15:04:12.045 17067-17082/com.applications.r08y.beaconreader I/art: Debugger is active
04-24 15:04:12.187 17067-17067/com.applications.r08y.beaconreader I/System.out: Debugger has connected
04-24 15:04:12.187 17067-17067/com.applications.r08y.beaconreader I/System.out: waiting for debugger to settle...
......等待调试解决
04-24 15:04:14.790 17067-17067/com.applications.r08y.beaconreader I/System.out: waiting for debugger to settle...
04-24 15:04:14.990 17067-17067/com.applications.r08y.beaconreader I/System.out: debugger has settled (1379)
04-24 15:04:15.077 17067-17067/com.applications.r08y.beaconreader I/InstantRun: starting instant run server: is main process
04-24 15:04:15.245 17067-17067/com.applications.r08y.beaconreader I/BeaconService: beaconService version 2.9 is starting up
04-24 15:04:15.247 17067-17067/com.applications.r08y.beaconreader W/BluetoothCrashResolver: Can't read macs from BluetoothCrashResolverState.txt
04-24 15:04:15.253 17067-17067/com.applications.r08y.beaconreader I/CycledLeScanner: This Android 5.0. We are using new scanning APIs
04-24 15:04:15.261 17067-17067/com.applications.r08y.beaconreader W/ModelSpecificDistanceCalculator: App has no android.permission.INTERNET permission. Cannot check for distance model updates
04-24 15:04:15.284 17067-17067/com.applications.r08y.beaconreader W/ModelSpecificDistanceCalculator: Cannot find match for this device. Using default
04-24 15:04:15.284 17067-17067/com.applications.r08y.beaconreader W/ModelSpecificDistanceCalculator: Cannot find match for this device. Using default
04-24 15:04:15.288 17067-17067/com.applications.r08y.beaconreader I/BeaconService: binding
04-24 15:04:15.313 17067-17169/com.applications.r08y.beaconreader I/OpenGLRenderer: Initialized EGL, version 1.4
04-24 15:04:15.333 17067-17067/com.applications.r08y.beaconreader E/BEACON MANAGER: Beacon out of region
04-24 15:04:15.353 17067-17169/com.applications.r08y.beaconreader E/libEGL: cache file failed CRC check
04-24 15:04:15.433 17067-17067/com.applications.r08y.beaconreader I/BeaconService: start monitoring received
04-24 15:04:15.443 17067-17067/com.applications.r08y.beaconreader I/CycledLeScanner: Adjusted scanStopTime to be 101
04-24 15:04:38.403 17067-17087/com.applications.r08y.beaconreader I/art: Background partial concurrent mark sweep GC freed 5309(314KB) AllocSpace objects, 1(20KB) LOS objects, 39% free, 1695KB/2MB, paused 10.900ms total 41.600ms
04-24 15:04:44.222 17067-17067/com.applications.r08y.beaconreader I/BluetoothLeScanner: startRegisteration: mLeScanClients={} ,callback=org.altbeacon.beacon.service.scanner.CycledLeScannerForLollipop$2@3b05192c
04-24 15:04:44.235 17067-17067/com.applications.r08y.beaconreader E/BluetoothLeScanner: application registeration exception
android.os.DeadObjectException
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:504)
at android.bluetooth.IBluetoothGatt$Stub$Proxy.registerClient(IBluetoothGatt.java:851)
at android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper.startRegisteration(BluetoothLeScanner.java:245)
at android.bluetooth.le.BluetoothLeScanner.startScan(BluetoothLeScanner.java:137)
at android.bluetooth.le.BluetoothLeScanner.startScan(BluetoothLeScanner.java:106)
at org.altbeacon.beacon.service.scanner.CycledLeScannerForLollipop.startScan(CycledLeScannerForLollipop.java:187)
at org.altbeacon.beacon.service.scanner.CycledLeScanner.scanLeDevice(CycledLeScanner.java:190)
at org.altbeacon.beacon.service.scanner.CycledLeScanner.finishScanCycle(CycledLeScanner.java:266)
at org.altbeacon.beacon.service.scanner.CycledLeScanner.scheduleScanCycleStop(CycledLeScanner.java:239)
at org.altbeacon.beacon.service.scanner.CycledLeScanner$1.run(CycledLeScanner.java:235)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5546)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:964)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759)
04-24 15:04:44.236 17067-17067/com.applications.r08y.beaconreader E/CycledLeScannerForLollipop: Scan Failed
04-24 15:04:44.236 17067-17067/com.applications.r08y.beaconreader E/CycledLeScannerForLollipop: Scan Failed
04-24 15:04:44.339 17067-17067/com.applications.r08y.beaconreader I/BluetoothLeScanner: startRegisteration: mLeScanClients={} ,callback=org.altbeacon.beacon.service.scanner.CycledLeScannerForLollipop$2@3b05192c
04-24 15:04:44.342 17067-17067/com.applications.r08y.beaconreader E/BluetoothLeScanner: application registeration exception
android.os.DeadObjectException
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:504)
at android.bluetooth.IBluetoothGatt$Stub$Proxy.registerClient(IBluetoothGatt.java:851)
at android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper.startRegisteration(BluetoothLeScanner.java:245)
at android.bluetooth.le.BluetoothLeScanner.startScan(BluetoothLeScanner.java:137)
at android.bluetooth.le.BluetoothLeScanner.startScan(BluetoothLeScanner.java:106)
at org.altbeacon.beacon.service.scanner.CycledLeScannerForLollipop.startScan(CycledLeScannerForLollipop.java:187)
at org.altbeacon.beacon.service.scanner.CycledLeScanner.scanLeDevice(CycledLeScanner.java:190)
at org.altbeacon.beacon.service.scanner.CycledLeScanner.finishScanCycle(CycledLeScanner.java:266)
at org.altbeacon.beacon.service.scanner.CycledLeScanner.scheduleScanCycleStop(CycledLeScanner.java:239)
at org.altbeacon.beacon.service.scanner.CycledLeScanner$1.run(CycledLeScanner.java:235)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5546)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:964)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759)
04-24 15:04:44.343 17067-17067/com.applications.r08y.beaconreader E/CycledLeScannerForLollipop: Scan Failed
04-24 15:04:44.343 17067-17067/com.applications.r08y.beaconreader E/CycledLeScannerForLollipop: Scan Failed
04-24 15:04:44.447 17067-17067/com.applications.r08y.beaconreader I/BluetoothLeScanner: startRegisteration: mLeScanClients={} ,callback=org.altbeacon.beacon.service.scanner.CycledLeScannerForLollipop$2@3b05192c
04-24 15:04:44.457 17067-17067/com.applications.r08y.beaconreader I/BluetoothLeScanner: startRegisteration: mLeScanClients={org.altbeacon.beacon.service.scanner.CycledLeScannerForLollipop$2@3b05192c=android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper@2aa317e2}
...扫描尝试......
04-24 15:05:33.076 17067-17067/com.applications.r08y.beaconreader I/BluetoothLeScanner: startRegisteration: mLeScanClients={org.altbeacon.beacon.service.scanner.CycledLeScannerForLollipop$2@3b05192c=android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper@286a8874} ,callback=org.altbeacon.beacon.service.scanner.CycledLeScannerForLollipop$2@3b05192c
04-24 15:05:33.083 17067-17067/com.applications.r08y.beaconreader I/BluetoothLeScanner: startRegisteration: mLeScanClients={org.altbeacon.beacon.service.scanner.CycledLeScannerForLollipop$2@3b05192c=android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper@28a7a19d}
04-24 15:05:33.152 17067-18004/com.applications.r08y.beaconreader E/BEACON MANAGER: Beacon entered in region
04-24 15:05:33.152 17067-17067/com.applications.r08y.beaconreader I/BeaconService: start ranging received
04-24 15:05:33.189 17067-17067/com.applications.r08y.beaconreader I/BluetoothLeScanner: startRegisteration: mLeScanClients={org.altbeacon.beacon.service.scanner.CycledLeScannerForLollipop$2@3b05192c=android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper@28a7a19d} ,callback=org.altbeacon.beacon.service.scanner.CycledLeScannerForLollipop$2@3b05192c
04-24 15:05:33.195 17067-17067/com.applications.r08y.beaconreader I/BluetoothLeScanner: startRegisteration: mLeScanClients={org.altbeacon.beacon.service.scanner.CycledLeScannerForLollipop$2@3b05192c=android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper@30139a5b}
......大约每100毫秒收到一次
04-24 15:05:43.093 17067-18175/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 15:05:43.207 17067-17067/com.applications.r08y.beaconreader I/BluetoothLeScanner: startRegisteration: mLeScanClients={org.altbeacon.beacon.service.scanner.CycledLeScannerForLollipop$2@3b05192c=android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper@13604c34} ,callback=org.altbeacon.beacon.service.scanner.CycledLeScannerForLollipop$2@3b05192c
04-24 15:05:43.223 17067-17067/com.applications.r08y.beaconreader I/BluetoothLeScanner: startRegisteration: mLeScanClients={org.altbeacon.beacon.service.scanner.CycledLeScannerForLollipop$2@3b05192c=android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper@6cff7a0}
04-24 15:05:43.231 17067-18176/com.applications.r08y.beaconreader E/BEACON MANAGER: Beacon out of region
04-24 15:05:43.232 17067-17067/com.applications.r08y.beaconreader I/BeaconService: stop ranging received
04-24 15:05:43.236 17067-18176/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 15:05:43.328 17067-17067/com.applications.r08y.beaconreader I/BluetoothLeScanner: startRegisteration: mLeScanClients={org.altbeacon.beacon.service.scanner.CycledLeScannerForLollipop$2@3b05192c=android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper@6cff7a0} ,callback=org.altbeacon.beacon.service.scanner.CycledLeScannerForLollipop$2@3b05192c
04-24 15:05:43.340 17067-17067/com.applications.r08y.beaconreader I/BluetoothLeScanner: startRegisteration: mLeScanClients={org.altbeacon.beacon.service.scanner.CycledLeScannerForLollipop$2@3b05192c=android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper@3ccedcc}
...扫描
04-24 15:05:45.558 17067-17067/com.applications.r08y.beaconreader I/BluetoothLeScanner: startRegisteration: mLeScanClients={org.altbeacon.beacon.service.scanner.CycledLeScannerForLollipop$2@3b05192c=android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper@214d61fc} ,callback=org.altbeacon.beacon.service.scanner.CycledLeScannerForLollipop$2@3b05192c
04-24 15:05:45.590 17067-17067/com.applications.r08y.beaconreader I/BluetoothLeScanner: startRegisteration: mLeScanClients={org.altbeacon.beacon.service.scanner.CycledLeScannerForLollipop$2@3b05192c=android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper@6b5b085}
04-24 15:05:45.684 17067-18203/com.applications.r08y.beaconreader E/BEACON MANAGER: Beacon entered in region
04-24 15:05:45.684 17067-17067/com.applications.r08y.beaconreader I/BeaconService: start ranging received
04-24 15:05:45.695 17067-17067/com.applications.r08y.beaconreader I/BluetoothLeScanner: startRegisteration: mLeScanClients={org.altbeacon.beacon.service.scanner.CycledLeScannerForLollipop$2@3b05192c=android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper@6b5b085} ,callback=org.altbeacon.beacon.service.scanner.CycledLeScannerForLollipop$2@3b05192c
04-24 15:05:45.700 17067-17067/com.applications.r08y.beaconreader I/BluetoothLeScanner: startRegisteration: mLeScanClients={org.altbeacon.beacon.service.scanner.CycledLeScannerForLollipop$2@3b05192c=android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper@192100e7}
---编辑2 --- logcat with scantime 501L
04-24 19:25:35.423 19998-21049/com.applications.r08y.beaconreader E/BEACON MANAGER: Beacon entered in region
04-24 19:25:35.679 19998-21055/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:25:36.206 19998-21061/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:25:36.735 19998-21067/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:25:37.257 19998-21073/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:25:37.781 19998-21079/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:25:38.343 19998-21087/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:25:38.931 19998-21095/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:25:39.766 19998-21102/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:25:40.341 19998-21108/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:25:40.940 19998-21114/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:25:41.514 19998-21120/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:25:42.053 19998-21126/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:25:42.648 19998-21137/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:25:43.182 19998-21142/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:25:43.740 19998-21148/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:25:44.309 19998-21158/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:25:44.861 19998-21166/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:25:45.421 19998-21172/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:25:46.032 19998-21178/com.applications.r08y.beaconreader E/BEACON MANAGER: Beacon out of region
04-24 19:25:46.043 19998-21178/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:26:00.424 19998-21314/com.applications.r08y.beaconreader E/BEACON MANAGER: Beacon entered in region
04-24 19:26:00.685 19998-21319/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:26:01.264 19998-21325/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:26:01.836 19998-21331/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:26:02.387 19998-21335/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:26:02.950 19998-21342/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:26:03.513 19998-21347/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:26:04.067 19998-21353/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:26:04.672 19998-21362/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:26:05.215 19998-21366/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:26:05.805 19998-21373/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:26:06.387 19998-21380/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:26:06.936 19998-21385/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:26:07.515 19998-21392/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:26:08.103 19998-21400/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:26:08.714 19998-21406/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:26:09.320 19998-21411/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:26:09.874 19998-21413/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:26:10.498 19998-21419/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
04-24 19:26:11.081 19998-21424/com.applications.r08y.beaconreader E/BEACON MANAGER: Beacon out of region
04-24 19:26:11.123 19998-21424/com.applications.r08y.beaconreader E/BEACON MANAGER: Frame received
答案 0 :(得分:0)
您获得不可靠检测的部分原因是配置的短扫描周期为101毫秒。
为什么呢? Android Beacon Library将在每个扫描周期结束时停止BLE扫描,然后重新启动它。这样做是因为一些较旧的Android设备无法检测到多个相同的信标广告,除非扫描已停止然后再次启动。大多数较新的设备都不会这样做。但是,无论何时停止并重新启动扫描,都会有一个短暂的时间段(因设备而异),而无法检测到数据包。扫描周期约为100毫秒时,可能会有很长一段时间没有检测到数据包。
此问题的部分解决方案已在[ad-hoc build here] (https://github.com/AltBeacon/android-beacon-library/releases/tag/2.9.2-mpb2)中提供的未发布版本的库中实现。此版本将检测在单个扫描周期中是否检测到两个相同的数据包,如果是,则在每个扫描周期结束时不再停止扫描。
上述更改可能会解决您设备的问题,但是,即使使用此版本的库,您也需要一个至少足以在一个周期内捕获两个数据包的扫描周期:&gt ;用于以10Hz发送的信标为200ms。如果您愿意,可以在较长的扫描周期开始以允许进行此检测,然后在获得didEnterRegion回调后,将扫描周期更改为更短的时间。 / p>