当前位置: 首页 > 知识库问答 >
问题:

背景信标检测多次失败

李飞翼
2023-03-14
04-20 17:10:07.335  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ cancel wakeup alarm: PendingIntent{422554f0: android.os.BinderProxy@42255480}
    04-20 17:10:07.365  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ Set a wakeup alarm to go off in 300000 ms: PendingIntent{42256498: android.os.BinderProxy@42256428}
    04-20 17:10:07.925  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ starting a new scan cycle
    04-20 17:10:07.925  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ starting a new bluetooth le scan
    04-20 17:10:07.925  24817-24817/com.mobinteg.ibeacon D/BluetoothAdapter﹕ startLeScan(): null
    04-20 17:10:07.945  24817-24833/com.mobinteg.ibeacon D/BluetoothAdapter﹕ onClientRegistered() - status=0 clientIf=5
    04-20 17:10:07.955  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ Waiting to stop scan cycle for another 1100 milliseconds
    04-20 17:10:07.965  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ cancel wakeup alarm: PendingIntent{42256498: android.os.BinderProxy@42256428}
    04-20 17:10:07.985  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ Set a wakeup alarm to go off in 300000 ms: PendingIntent{422577d0: android.os.BinderProxy@42257760}
    04-20 17:10:07.985  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ Scan started
    04-20 17:10:08.765  24817-24832/com.mobinteg.ibeacon D/BluetoothAdapter﹕ onScanResult() - Device=D6:06:36:3A:71:B3 RSSI=-63
    04-20 17:10:08.765  24817-24832/com.mobinteg.ibeacon D/CycledLeScannerForJellyBeanMr2﹕ got record
    04-20 17:10:08.765  24817-25200/com.mobinteg.ibeacon D/BeaconParser﹕ This is not a matching Beacon advertisement. (Was expecting be ac.  The bytes I see are: 0201041bff4c000215ebefd08370a247c89837e7b5634df52400010001cb5f00000000000000000000000000000000000000000000000000000000000000
    04-20 17:10:08.765  24817-25200/com.mobinteg.ibeacon D/BeaconParser﹕ This is a recognized beacon advertisement -- 02 15 seen
    04-20 17:10:08.765  24817-25200/com.mobinteg.ibeacon D/BeaconService﹕ beacon detected multiple times in scan cycle : id1: ebefd083-70a2-47c8-9837-e7b5634df524 id2: 1 id3: 1
    04-20 17:10:08.765  24817-25200/com.mobinteg.ibeacon D/BeaconService﹕ beacon detected : id1: ebefd083-70a2-47c8-9837-e7b5634df524 id2: 1 id3: 1
    04-20 17:10:08.775  24817-25200/com.mobinteg.ibeacon D/BeaconService﹕ looking for ranging region matches for this beacon
    04-20 17:10:08.985  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ Waiting to stop scan cycle for another 71 milliseconds
    04-20 17:10:08.985  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ cancel wakeup alarm: PendingIntent{422577d0: android.os.BinderProxy@42257760}
    04-20 17:10:08.995  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ Set a wakeup alarm to go off in 300000 ms: PendingIntent{4225b930: android.os.BinderProxy@4225b8c0}
    04-20 17:10:09.065  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ Done with scan cycle
    04-20 17:10:09.065  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ stopping bluetooth le scan
    04-20 17:10:09.075  24817-24817/com.mobinteg.ibeacon D/BluetoothAdapter﹕ stopLeScan()
    04-20 17:10:09.085  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ Normalizing between scan period from 15000 to 14915
    04-20 17:10:09.085  24817-24817/com.mobinteg.ibeacon D/CycledLeScannerForJellyBeanMr2﹕ Waiting to start next bluetooth scan for another 14915 milliseconds
04-20 17:10:56.225  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ starting a new scan cycle
04-20 17:10:56.225  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ starting a new bluetooth le scan
04-20 17:10:56.225  24817-24817/com.mobinteg.ibeacon D/BluetoothAdapter﹕ startLeScan(): null
04-20 17:10:56.235  24817-24833/com.mobinteg.ibeacon D/BluetoothAdapter﹕ onClientRegistered() - status=0 clientIf=5
04-20 17:10:56.245  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ Waiting to stop scan cycle for another 1100 milliseconds
04-20 17:10:56.245  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ cancel wakeup alarm: PendingIntent{422922d0: android.os.BinderProxy@42292260}
04-20 17:10:56.285  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ Set a wakeup alarm to go off in 300000 ms: PendingIntent{42293608: android.os.BinderProxy@42293598}
04-20 17:10:56.285  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ Scan started
04-20 17:10:56.995  24817-24832/com.mobinteg.ibeacon D/BluetoothAdapter﹕ onScanResult() - Device=D6:06:36:3A:71:B3 RSSI=-68
04-20 17:10:56.995  24817-24832/com.mobinteg.ibeacon D/CycledLeScannerForJellyBeanMr2﹕ got record
04-20 17:10:56.995  24817-24865/com.mobinteg.ibeacon D/BeaconParser﹕ This is not a matching Beacon advertisement. (Was expecting be ac.  The bytes I see are: 0201041bff4c000215ebefd08370a247c89837e7b5634df52400010001cb6100000000000000000000000000000000000000000000000000000000000000
04-20 17:10:57.005  24817-24865/com.mobinteg.ibeacon D/BeaconParser﹕ This is a recognized beacon advertisement -- 02 15 seen
04-20 17:10:57.005  24817-24865/com.mobinteg.ibeacon D/BeaconService﹕ beacon detected multiple times in scan cycle : id1: ebefd083-70a2-47c8-9837-e7b5634df524 id2: 1 id3: 1
04-20 17:10:57.015  24817-24865/com.mobinteg.ibeacon D/BeaconService﹕ beacon detected : id1: ebefd083-70a2-47c8-9837-e7b5634df524 id2: 1 id3: 1
04-20 17:10:57.015  24817-24865/com.mobinteg.ibeacon D/Callback﹕ attempting callback via intent: ComponentInfo{com.mobinteg.ibeacon/org.altbeacon.beacon.BeaconIntentProcessor}
04-20 17:10:57.025  24817-24865/com.mobinteg.ibeacon D/BeaconService﹕ looking for ranging region matches for this beacon
04-20 17:10:57.035  24817-25231/com.mobinteg.ibeacon D/BeaconIntentProcessor﹕ got an intent to process
04-20 17:10:57.035  24817-25231/com.mobinteg.ibeacon D/BeaconIntentProcessor﹕ got monitoring data
04-20 17:10:57.045  24817-25231/com.mobinteg.ibeacon D/BeaconIntentProcessor﹕ Calling monitoring notifier: com.mobinteg.ibeacon.Background@420719f8
04-20 17:10:57.045  24817-25231/com.mobinteg.ibeacon D/testbackground﹕ Region id1: null id2: null id3: null
04-20 17:10:57.045  24817-25231/com.mobinteg.ibeacon D/testbackground﹕ Got a didEnterRegion call
04-20 17:10:57.285  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ Waiting to stop scan cycle for another 63 milliseconds
04-20 17:10:57.285  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ cancel wakeup alarm: PendingIntent{42293608: android.os.BinderProxy@42293598}
04-20 17:10:57.295  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ Set a wakeup alarm to go off in 300000 ms: PendingIntent{422a1e20: android.os.BinderProxy@422a1db0}
04-20 17:10:57.355  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ Done with scan cycle
04-20 17:10:57.355  24817-24817/com.mobinteg.ibeacon D/CycledLeScanner﹕ stopping bluetooth le scan
04-20 17:10:57.355  24817-24817/com.mobinteg.ibeacon D/BluetoothAdapter﹕ stopLeScan()
public class Background extends Application implements BootstrapNotifier{

    private static final String TAG = "testbackground";//".MyApplicationName";
    private static final String UUID = "EBEFD08370A247C89837E7B5634DF524";//"ebefd083-70a2-47c8-9837-e7b5634df524";//
    //private BackgroundPowerSaver backgroundPowerSaver;//to able battery saving
    private RegionBootstrap regionBootstrap;
    private BeaconManager beaconManager;


    @Override
    public void onCreate() {
        super.onCreate();
        beaconManager.setDebug(true);
        // Simply constructing this class and holding a reference to it in your custom Application class
        // enables auto battery saving of about 60%
        //backgroundPowerSaver = new BackgroundPowerSaver(this);
        Region region = new Region(".Background",null,null,null);
        beaconManager = BeaconManager.getInstanceForApplication(this);
        beaconManager.getBeaconParsers().add(new BeaconParser()
                .setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25"));
        try{
            // set the duration of the scan to be 1.1 seconds
            beaconManager.setBackgroundScanPeriod(1100l);
            // set the time between each scan to be 1 hour (3600 seconds)//50000l
            beaconManager.setBackgroundBetweenScanPeriod(15000l);//3600000l
            beaconManager.updateScanPeriods();
            //beaconManager.startMonitoringBeaconsInRegion(region);

        }  catch (RemoteException e) {
            //Log.e(TAG, "Cannot talk to service");
        }

        // wake up the app when any beacon is seen (you can specify specific id filers in the parameters below)
        regionBootstrap = new RegionBootstrap(Background.this, region);

    }

    @Override
    public void didDetermineStateForRegion(int state, Region region) {
        // Don't care
        Log.d(TAG, "Region " + region.toString());
    }

    @Override
    public void didEnterRegion(Region arg0) {
        Log.d(TAG, "Got a didEnterRegion call");
        // This call to disable will make it so the activity below only gets launched the first time a beacon is seen (until the next time the app is launched)
        // if you want the Activity to launch every single time beacons come into view, remove this call.
        //regionBootstrap.disable();
        Intent intent = new Intent(this, MainActivity.class);
        // IMPORTANT: in the AndroidManifest.xml definition of this activity, you must set android:launchMode="singleInstance" or you will get two instances
        // created when a user launches the activity manually and it gets launched from here.
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        //beaconManager.setBackgroundMode(false);
        this.startActivity(intent);
    }

    @Override
    public void didExitRegion(Region arg0) {
        // Don't care
    }


}

共有1个答案

隗驰
2023-03-14

这两个日志摘录都显示了正常操作。在第一种情况下,当设备已经在信标区域内(例如,信标已经可见)时检测信标。因此,不调用DidenterRegion回调。

在第二种情况下,当设备不在信标区域内时(例如,当当前没有信标可见时)检测信标。因此调用DidenterRegion回调。

为了获得对DidenterRegion方法的第二次回调,您必须等待足够长的时间让设备检测到周围没有信标。基于每15秒扫描1.1秒的背景设置,这可能需要21.1秒才能发生(15秒+1.1秒+5秒才能消失)。因此,在第二次调用didenterregion之前,必须关闭一个信标20秒以上(或者将Android设备从所有信标移开)。

 类似资料:
  • 在CSS3之前,一个元素只能设置一个背景图像。而CSS3中,可以为一个元素添加多个背景图像。定义多图像背景时,只需在 background-image 或 background 属性列出需要使用的所有背景图像,并用逗号隔开。而且,每个背景图像都具有 background 中的任何属性,如可以设置背景位置、设置背景重复、设置背景尺寸等,多个属性值按顺序依次对应。如果某个属性只提供了一个参数值,则所有

  • 问题内容: 假设我要在CSS中渲染箭头,箭头应具有头部,尾部和灵活的宽度,以便可以包含文本。我当然可以创建多个div来获得所需的内容,但是如何在CSS3中完成呢? 我可以使用多个背景图片: 的HTML: 这给了我一个带有箭头和尾巴的透明中间部分。似乎不可能在中间部分指定颜色。 仅使用一张背景图像,您可以执行以下操作: 我知道这在很多方面都是可行的,但是背景颜色属性是否真的从速记定义中丢失了? 问题

  • 使用https://altbeacon.github.io/android-beacon-library/samples.html中的代码试图检测IBeacon发射器,该发射器是iOS8,如下http://blog.passkit.com/configure-iphone-ibeacon-transmiter/,在哪一步出错了,我需要在区域中使用BeaconIdentifier作为mymonito

  • 问题内容: 我有一个JLabel,可以在鼠标输入时更改其背景颜色。我的问题是我希望JLabel在鼠标退出后变得透明。 有没有我可以用来完成此任务的声明? 问题答案: 在德国,这是一个懒惰的假期,因此结合以下两个答案: 问题(实际上,我倾向于将其视为错误)是设置opaque属性不会触发适当的重绘。JComponent触发了change事件,但似乎没人在听:

  • 在“锚框”一节中,我们在实验中以输入图像的每个像素为中心生成多个锚框。这些锚框是对输入图像不同区域的采样。然而,如果以图像每个像素为中心都生成锚框,很容易生成过多锚框而造成计算量过大。举个例子,假设输入图像的高和宽分别为561像素和728像素,如果以每个像素为中心生成5个不同形状的锚框,那么一张图像上则需要标注并预测200多万个锚框($561 \times 728 \times 5$)。 减少锚框

  • 本文向大家介绍OpenCV利用背景建模检测运动物体,包括了OpenCV利用背景建模检测运动物体的使用技巧和注意事项,需要的朋友参考一下 本文实例为大家分享了OpenCV利用背景建模检测运动物体的具体代码,供大家参考,具体内容如下 效果图: 以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持呐喊教程。