Android Beacon Library在一台Android 4.4设备上运行良好,但在另一台Android设备上运行良好

Android Beacon Library在一台Android 4.4设备上运行良好,但在另一台Android设备上运行良好,第1张

概述更新:我尝试了一种更直接的方法(参见下面的编辑3),这使得手表上的信标缺乏有趣的数据. 有关非工作设备的详细信息. 智能手表(通用)列为蓝牙4.0功能 MTK6572芯片组 型号EC720(似乎有很多变种) Android 4.4.2 内核:3.4.67 chendalin-Z87-HD3#1 2014年12月27日 内部版本号:H82D.SMARTWATCH.OC4.0.20141447 自定义 更新:我尝试了一种更直接的方法(参见下面的编辑3),这使得手表上的信标缺乏有趣的数据.

有关非工作设备的详细信息.
智能手表(通用)列为蓝牙4.0功能
MTK6572芯片组
型号EC720(似乎有很多变种)
Android 4.4.2
内核:3.4.67 chendalin-Z87-HD3#1 2014年12月27日
内部版本号:H82D.SMARTWATCH.OC4.0.20141447
自定义版本:1419655453

我正在使用相同的Radius Networks标签信标测试相同的应用程序.在这个测试中,我在我的设备的近距离内有相同的4个信标.

设备1是Nexus 7(2013),我还没有更新到AndroID L,它运行4.4.4

Device 2是一款通用的智能手表,在MTK6572上运行androID 4.4.2.规格列出有蓝牙4.0

当我使用AndroID Beacon library运行我的测试应用程序时,Nexus报告信标,但智能手表没有.它似乎检测到它们,但我看到logcat中的条目如:D / BluetoothAdapter:onScanResult() – Device = E5:E0:20:CF:63:32 RSSI = -60.当BeaconParser未设置为读取正确类型的信标时,通常会显示这些消息,但在我的情况下,我很确定这不是问题,因为nexus看到的信标具有完全相同的代码.

对于2个设备看起来非常不同的日志输出,我开始怀疑手表的androID构建是否因为BLE支持被禁用或者具有不完整的堆栈.我已经仔细检查了蓝牙是否打开,并且还想注意该手表具有应用程序权限管理,我为应用程序请求的所有权限设置为“始终允许”.

这里来自smartwatch的部分logcat:

02-03 19:40:40.393    2620-2620/com.mapcushion.androID.mapcushionPingl D/BeaconManager﹕ This consumer is not bound.  binding: com.mapcushion.androID.mapcushionPingl.Scan@41c7d2c002-03 19:40:40.435    2620-2620/com.mapcushion.androID.mapcushionPingl D/BeaconManager﹕ consumer count is Now:1...02-03 19:40:40.617    2620-2620/com.mapcushion.androID.mapcushionPingl I/BeaconService﹕ beaconService version 2.1 is starting up02-03 19:40:40.638    2620-2620/com.mapcushion.androID.mapcushionPingl I/CycledLeScanner﹕ This is not AndroID 5.0.  We are using old scanning APIs02-03 19:40:40.645    2620-2620/com.mapcushion.androID.mapcushionPingl D/ModelSpecificdistanceCalculator﹕ Finding best distance calculator for 4.4.2,KOT49H,EC720,alps02-03 19:40:40.645    2620-2620/com.mapcushion.androID.mapcushionPingl D/AndroIDModel﹕ score is 0 for LGE;Nexus 4;KOT49H;4.4.2 compared to alps;EC720;KOT49H;4.4.202-03 19:40:40.645    2620-2620/com.mapcushion.androID.mapcushionPingl D/AndroIDModel﹕ score is 0 for LGE;Nexus 5;LPV79;4.4.2 compared to alps;EC720;KOT49H;4.4.202-03 19:40:40.645    2620-2620/com.mapcushion.androID.mapcushionPingl W/ModelSpecificdistanceCalculator﹕ Cannot find match for this device.  Using default02-03 19:40:40.645    2620-2620/com.mapcushion.androID.mapcushionPingl D/ModelSpecificdistanceCalculator﹕ Finding best distance calculator for 4.4.2,alps02-03 19:40:40.645    2620-2620/com.mapcushion.androID.mapcushionPingl D/AndroIDModel﹕ score is 0 for LGE;Nexus 4;KOT49H;4.4.2 compared to alps;EC720;KOT49H;4.4.202-03 19:40:40.646    2620-2620/com.mapcushion.androID.mapcushionPingl D/AndroIDModel﹕ score is 0 for LGE;Nexus 5;LPV79;4.4.2 compared to alps;EC720;KOT49H;4.4.202-03 19:40:40.646    2620-2620/com.mapcushion.androID.mapcushionPingl W/ModelSpecificdistanceCalculator﹕ Cannot find match for this device.  Using default02-03 19:40:40.648    2620-2620/com.mapcushion.androID.mapcushionPingl D/BeaconService﹕ No org.altbeacon.beacon.SimulatedScanData class exists.02-03 19:40:40.649    2620-2620/com.mapcushion.androID.mapcushionPingl D/ActivityThread﹕ SVC-CREATE_SERVICE handled : 0 / CreateServiceData{token=androID.os.BinderProxy@41cbbec8 classname=org.altbeacon.beacon.service.BeaconService packagename=com.mapcushion.androID.mapcushionPingl intent=null}02-03 19:40:40.650    2620-2620/com.mapcushion.androID.mapcushionPingl I/BeaconService﹕ binding02-03 19:40:40.656    2620-2620/com.mapcushion.androID.mapcushionPingl D/ActivityThread﹕ SVC-BIND_SERVICE handled : 0 / BindServiceData{token=androID.os.BinderProxy@41cbbec8 intent=Intent { cmp=com.mapcushion.androID.mapcushionPingl/org.altbeacon.beacon.service.BeaconService }}02-03 19:40:40.723    2620-2620/com.mapcushion.androID.mapcushionPingl D/GraphicBuffer﹕ create handle(0x552ed2b8) (w:256,h:240,f:1)02-03 19:40:40.725    2620-2620/com.mapcushion.androID.mapcushionPingl I/MalIEGL﹕ [Mali]surface->num_buffers=4,surface->num_frames=3,win_min_undequeued=102-03 19:40:40.725    2620-2620/com.mapcushion.androID.mapcushionPingl I/MalIEGL﹕ [Mali]max_allowed_dequeued_buffers=302-03 19:40:40.725    2620-2620/com.mapcushion.androID.mapcushionPingl D/GraphicBuffer﹕ close handle(0x552ed2b8) (w:256 h:240 f:1)02-03 19:40:40.733    2620-2620/com.mapcushion.androID.mapcushionPingl D/GraphicBuffer﹕ create handle(0x553ec108) (w:256,f:1)02-03 19:40:40.735    2620-2620/com.mapcushion.androID.mapcushionPingl D/Openglrenderer﹕ Enabling deBUG mode 002-03 19:40:40.737    2620-2620/com.mapcushion.androID.mapcushionPingl D/GraphicBuffer﹕ create handle(0x5542c8a8) (w:768,h:768,f:1)02-03 19:40:40.741    2620-2620/com.mapcushion.androID.mapcushionPingl W/MAli﹕ MTK_AUX_isMTKFormat:168: int MTK_AUX_isMTKFormat(ANativeWindowBuffer_t*): format=102-03 19:40:40.743    2620-2620/com.mapcushion.androID.mapcushionPingl D/Openglrenderer﹕ setVIEwport 240x240 <0x553ec690>02-03 19:40:40.745    2620-2620/com.mapcushion.androID.mapcushionPingl D/BeaconManager﹕ we have a connection to the service Now02-03 19:40:40.747    2620-2620/com.mapcushion.androID.mapcushionPingl D/BeaconManager﹕ callback packagename: com.mapcushion.androID.mapcushionPingl02-03 19:40:40.747    2620-2620/com.mapcushion.androID.mapcushionPingl D/BeaconManager﹕ This consumer is already bound...02-03 19:40:40.814    2620-2620/com.mapcushion.androID.mapcushionPingl I/BeaconService﹕ start ranging received02-03 19:40:40.814    2620-2620/com.mapcushion.androID.mapcushionPingl D/BeaconService﹕ Currently ranging 1 regions.02-03 19:40:40.814    2620-2620/com.mapcushion.androID.mapcushionPingl D/CycledLeScanner﹕ start called02-03 19:40:40.828    2620-2620/com.mapcushion.androID.mapcushionPingl D/CycledLeScanner﹕ starting a new scan cycle02-03 19:40:40.829    2620-2620/com.mapcushion.androID.mapcushionPingl D/BluetoothAdapter﹕ isEnabled02-03 19:40:40.834    2620-2620/com.mapcushion.androID.mapcushionPingl D/CycledLeScanner﹕ starting a new bluetooth le scan02-03 19:40:40.835    2620-2620/com.mapcushion.androID.mapcushionPingl D/BluetoothAdapter﹕ startLeScan(): null02-03 19:40:40.874    2620-2633/com.mapcushion.androID.mapcushionPingl D/BluetoothAdapter﹕ onClIEntRegistered() - status=0 clIEntIf=102-03 19:40:40.879    2620-2620/com.mapcushion.androID.mapcushionPingl D/CycledLeScanner﹕ Waiting to stop scan cycle for another 1100 milliseconds02-03 19:40:40.880    2620-2620/com.mapcushion.androID.mapcushionPingl D/CycledLeScanner﹕ Scan started02-03 19:40:40.880    2620-2620/com.mapcushion.androID.mapcushionPingl D/CycledLeScanner﹕ Set scan periods called with 1100,0  Background mode must have changed.02-03 19:40:40.881    2620-2620/com.mapcushion.androID.mapcushionPingl D/CycledLeScanner﹕ We are not in the background.  Cancelling wakeup alarm02-03 19:40:40.881    2620-2620/com.mapcushion.androID.mapcushionPingl D/CycledLeScanner﹕ cancel wakeup alarm: null02-03 19:40:41.084    2620-2634/com.mapcushion.androID.mapcushionPingl D/BluetoothAdapter﹕ onScanResult() - Device=E5:E0:20:CF:63:32 RSSI=-4502-03 19:40:41.084    2620-2634/com.mapcushion.androID.mapcushionPingl D/CycledLeScannerForJellyBeanMr2﹕ got record

这是我的代码:

@OverrIDeprotected voID onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentVIEw(R.layout.activity_scan);    mHandler = new androID.os.Handler();    beaconManager = BeaconManager.getInstanceForApplication(this);    beaconManager.setDeBUG(true);    beaconManager.getBeaconParsers().add(new BeaconParser().            setBeaconLayout(" m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24"));    beaconManager.bind(this);    sendbeacons();}@OverrIDepublic voID onBeaconServiceConnect() {    beaconManager.setRangeNotifIEr(new RangeNotifIEr() {        @OverrIDe        public voID dIDRangeBeaconsInRegion(Collection<Beacon> beacons,Region region) {            System.out.println("------- dIDRangeBeacons!!!!");            iBeacons = beacons;            System.out.println("------ num:: " + iBeacons.size());            /*            for(Beacon iBeacon : iBeacons) {                Log.i("Beacon","found \nProxUUID: " + iBeacon.getID1()                        + "\ntx: " + Integer.toString(iBeacon.getTxPower())                        + "\nmanu: " + Integer.toString(iBeacon.getManufacturer())                        + "\ndistance: " + Double.toString(iBeacon.getdistance())                        + "\nRSSI:" + Integer.toString(iBeacon.getRSSi())                        + "\nTxPow:" + Integer.toString(iBeacon.getTxPower())                        + "\nBeacon type code:" + Double.toString(iBeacon.getBeaconTypeCode())                        + "\n------------------------------------------------");            }            */        }    });    try {        beaconManager.startRangingBeaconsInRegion(new Region("briansbeacons",null,null));    } catch(remoteexception e) {        e.printstacktrace();    }    beaconManager.bind(this);}

编辑1:

添加更多特定日志条目以尝试显示信标检测中的差异:我删除了除一个信标之外的所有信息,我注意到工作设备正在通过UUID识别信标,而非工作设备则不是.但我在工作设备的日志中找不到对Device = E5:E0:20:CF:63:32的任何引用.

Nexus 7(工作):

02-02 23:48:14.795  10727-10751/com.mapcushion.androID.mapcushionPingl D/BeaconService﹕ beacon detected multiple times in scan cycle :ID1: 2f234454-cf6d-4a0f-adf2-f4911ba9ffa6 ID2: 4 ID3: 10102-02 23:48:14.795  10727-10751/com.mapcushion.androID.mapcushionPingl D/BeaconService﹕ beacon detected :ID1: 2f234454-cf6d-4a0f-adf2-f4911ba9ffa6 ID2: 4 ID3: 10102-02 23:48:14.795  10727-10751/com.mapcushion.androID.mapcushionPingl D/BeaconService﹕ looking for ranging region matches for this beacon02-02 23:48:14.795  10727-10751/com.mapcushion.androID.mapcushionPingl D/BeaconService﹕ matches ranging region: ID1: null ID2: null ID3: null02-02 23:48:14.795  10727-10751/com.mapcushion.androID.mapcushionPingl D/RangeState﹕ adding ID1: 2f234454-cf6d-4a0f-adf2-f4911ba9ffa6 ID2: 4 ID3: 101 to existing range for: org.altbeacon.beacon.service.RangedBeacon@41eb538002-02 23:48:14.915  10727-10738/com.mapcushion.androID.mapcushionPingl D/CycledLeScannerForJellyBeanMr2﹕ got record02-02 23:48:14.915  10727-10759/com.mapcushion.androID.mapcushionPingl D/BeaconParser﹕ This is not a matching Beacon advertisement.  (Was expecting be ac.  The bytes I see are: 02011a0bff4c0009060102c0a80113000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002-02 23:48:14.915  10727-10759/com.mapcushion.androID.mapcushionPingl D/BeaconParser﹕ This is not a matching Beacon advertisement.  (Was expecting 02 15.  The bytes I see are: 02011a0bff4c0009060102c0a801130000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

SmartWatch(不工作):

02-02 23:46:52.598    3351-3364/com.mapcushion.androID.mapcushionPingl D/BluetoothAdapter﹕ onScanResult() - Device=E5:E0:20:CF:63:32 RSSI=-3102-02 23:46:52.599    3351-3364/com.mapcushion.androID.mapcushionPingl D/CycledLeScannerForJellyBeanMr2﹕ got record02-02 23:46:52.600    3351-3364/com.mapcushion.androID.mapcushionPingl D/BluetoothDevice﹕ mAddress: E5:E0:20:CF:63:3202-02 23:46:52.603    3351-3383/com.mapcushion.androID.mapcushionPingl D/BeaconParser﹕ This is not a matching Beacon advertisement.  (Was expecting be ac.  The bytes I see are: 020100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002-02 23:46:52.603    3351-3383/com.mapcushion.androID.mapcushionPingl D/BeaconParser﹕ This is not a matching Beacon advertisement.  (Was expecting 02 15.  The bytes I see are: 020100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002-02 23:46:52.605    3351-3383/com.mapcushion.androID.mapcushionPingl D/BeaconParser﹕ This is not a matching Beacon advertisement.  (Was expecting 02 15.  The bytes I see are: 020100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002-02 23:46:53.432    3351-3351/com.mapcushion.androID.mapcushionPingl D/CycledLeScanner﹕ Waiting to stop scan cycle for another 98 milliseconds02-02 23:46:53.531    3351-3351/com.mapcushion.androID.mapcushionPingl D/CycledLeScanner﹕ Done with scan cycle02-02 23:46:53.531    3351-3351/com.mapcushion.androID.mapcushionPingl D/BeaconService﹕ Calling ranging callback

我注意到的另一件事是,在非工作设备中,对BeaconService的唯一引用如下:

02-02 23:46:52.364    3351-3351/com.mapcushion.androID.mapcushionPingl D/BeaconService﹕ Calling ranging callback02-02 23:46:52.364    3351-3351/com.mapcushion.androID.mapcushionPingl D/Callback﹕ attempting callback via intent: ComponentInfo{com.mapcushion.androID.mapcushionPingl/org.altbeacon.beacon.BeaconIntentProcessor}

而在工作设备中,大多数信标的记录似乎来自该类…

编辑 – 更新2:

回答DavID关于MAC地址的问题

以下代码:

beaconManager.setRangeNotifIEr(new RangeNotifIEr() {    @OverrIDe    public voID dIDRangeBeaconsInRegion(Collection<Beacon> beacons,Region region) {    System.out.println("------- dIDRangeBeacons!!!!");    iBeacons = beacons;    System.out.println("------ num:: " + iBeacons.size());    for(Beacon iBeacon : iBeacons) {        Log.i("Beacon","\n------------------------------------------------");        Log.d(TAG,"Mac address is: "+iBeacon.getBluetoothAddress());        Log.i("Beacon","\n------------------------------------------------");    }    }});

在工作Nexus 7上产生:

02-03 19:44:57.200    3192-3438/com.mapcushion.androID.mapcushionPingl I/System.out﹕ ------- dIDRangeBeacons!!!!02-03 19:44:57.200    3192-3438/com.mapcushion.androID.mapcushionPingl I/System.out﹕ ------ num:: 102-03 19:44:57.200    3192-3438/com.mapcushion.androID.mapcushionPingl I/Beacon﹕ ------------------------------------------------02-03 19:44:57.200    3192-3438/com.mapcushion.androID.mapcushionPingl D/RangingActivity﹕ Mac address is: E5:E0:20:CF:63:3202-03 19:44:57.200    3192-3438/com.mapcushion.androID.mapcushionPingl I/Beacon﹕ ------------------------------------------------

在智能手表上:

02-03 19:40:46.671    2620-2671/com.mapcushion.androID.mapcushionPingl I/System.out﹕ ------- dIDRangeBeacons!!!!02-03 19:40:46.671    2620-2671/com.mapcushion.androID.mapcushionPingl I/System.out﹕ ------ num:: 0

因此BeaconManager(或底层的androID API)没有将“设备”视为信标,但它确实用这条线识别具有相同MAC地址的信标:

02-03 19:40:46.486    2620-2633/com.mapcushion.androID.mapcushionPingl D/BluetoothDevice﹕ mAddress: E5:E0:20:CF:63:32

编辑3:

我决定退后一步,尝试使用AndroID蓝牙API直接查询信标.

基本上我只是想输出返回的字节,看看为什么没有识别信标.并且对于相同的信标,输出看起来完全不同,只有前两个字节具有智能手表所见的信标数据,而nexus 7具有30个字节的数据.

到目前为止,我尝试更改SCAN_TIME没有任何效果.手表收到的数据是否有迹象表明它无法读取数据包?

我使用了以下代码:

private static final long SCAN_TIME = 5000;    boolean mScanning = false;    private voID scanLeDevice(final boolean enable) {        Log.i(null,"InsIDe scanLeDevice");        Log.i(null,"scan time is: " + SCAN_TIME);        if (enable) {            // Stops scanning after a pre-defined scan period.            mHandler.postDelayed(new Runnable() {                @OverrIDe                public voID run() {                    mScanning = false;                    Log.i(null,"Calling stopLeScan");                    mBluetoothAdapter.stopLeScan(mLeScanCallback);                }            },SCAN_TIME);            mScanning = true;            Log.i(null,"Calling startLeScan");            mBluetoothAdapter.startLeScan(mLeScanCallback);        } else {            mScanning = false;            mBluetoothAdapter.stopLeScan(mLeScanCallback);        }    }    private BluetoothAdapter.LeScanCallback mLeScanCallback =        new BluetoothAdapter.LeScanCallback() {            @OverrIDe            public voID onLeScan(final BluetoothDevice device,int RSSi,final byte[] scanRecord) {                runOnUiThread(new Runnable() {                    @OverrIDe                    public voID run() {                        Log.i(null,"INSIDE ONLESCAN");                        //DO MY WORK                        Log.i(null,"scanned record: " + scanRecord.length);                        int startByte = 2;                        boolean patternFound = false;                        for(int i=0; i<scanRecord.length; i++) {                            Log.i(null,"byte " + i + ": " + scanRecord[i]);                        }                        while (startByte <= 5) {                            Log.i(null,"scanned record: " + scanRecord.length);                            Log.i(null,"IDentifIEr check: " + ((int) scanRecord[startByte + 2] & 0xff) + " == " + 0x02);                            Log.i(null,"Length of data : " + ((int) scanRecord[startByte + 3] & 0xff) + "==" + (0x15));                            //Log.i(null," iBeacon IDentifIEr: " + (scanRecord[startByte + 2] & 0xff));                            if (((int) scanRecord[startByte + 2] & 0xff) == 0x02 && //IDentifIEs an iBeacon                                    ((int) scanRecord[startByte + 3] & 0xff) == 0x15) { //IDentifIEs correct data length                                patternFound = true;                                break;                            }                            startByte++;                        }                        if (patternFound) {                            //Convert to hex String                            byte[] uuIDBytes = new byte[16];                            System.arraycopy(scanRecord,startByte+4,uuIDBytes,16);                            String hexString = bytesToHex(uuIDBytes);                            //Here is your UUID                            String uuID =  hexString.substring(0,8) + "-" +                                    hexString.substring(8,12) + "-" +                                    hexString.substring(12,16) + "-" +                                    hexString.substring(16,20) + "-" +                                    hexString.substring(20,32);                            //Here is your Major value                            int major = (scanRecord[startByte+20] & 0xff) * 0x100 + (scanRecord[startByte+21] & 0xff);                            //Here is your Minor value                            int minor = (scanRecord[startByte+22] & 0xff) * 0x100 + (scanRecord[startByte+23] & 0xff);                            System.out.println("-------------output------ : " + uuID + " maj: " + major + " min: " + minor );                        }                    }                });            }        };    }

这是输出:

nexus 7(工作):

02-03 22:50:43.811    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ INSIDE ONLESCAN02-03 22:50:43.811    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ scanned record: 6202-03 22:50:43.811    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 0: 202-03 22:50:43.811    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 1: 102-03 22:50:43.811    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 2: 602-03 22:50:43.811    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 3: 2602-03 22:50:43.811    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 4: -102-03 22:50:43.811    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 5: 7602-03 22:50:43.811    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 6: 002-03 22:50:43.821    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 7: 202-03 22:50:43.821    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 8: 2102-03 22:50:43.831    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 9: 4702-03 22:50:43.831    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 10: 3502-03 22:50:43.831    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 11: 6802-03 22:50:43.831    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 12: 8402-03 22:50:43.831    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 13: -4902-03 22:50:43.831    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 14: 10902-03 22:50:43.831    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 15: 7402-03 22:50:43.831    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 16: 1502-03 22:50:43.841    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 17: -8302-03 22:50:43.841    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 18: -1402-03 22:50:43.841    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 19: -1202-03 22:50:43.841    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 20: -11102-03 22:50:43.841    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 21: 2702-03 22:50:43.841    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 22: -8702-03 22:50:43.841    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 23: -102-03 22:50:43.851    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 24: -9002-03 22:50:43.851    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 25: 002-03 22:50:43.851    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 26: 402-03 22:50:43.851    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 27: 002-03 22:50:43.851    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 28: 10102-03 22:50:43.851    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 29: -7602-03 22:50:43.851    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 30: 0... (all 0's)02-03 22:50:43.882    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ byte 61: 002-03 22:50:43.882    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ scanned record: 6202-03 22:50:43.882    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ IDentifIEr check: 255 == 202-03 22:50:43.882    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ Length of data : 76==2102-03 22:50:43.882    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ scanned record: 6202-03 22:50:43.882    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ IDentifIEr check: 76 == 202-03 22:50:43.882    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ Length of data : 0==2102-03 22:50:43.882    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ scanned record: 6202-03 22:50:43.882    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ IDentifIEr check: 0 == 202-03 22:50:43.882    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ Length of data : 2==2102-03 22:50:43.882    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ scanned record: 6202-03 22:50:43.882    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ IDentifIEr check: 2 == 202-03 22:50:43.882    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ Length of data : 21==2102-03 22:50:43.882    7303-7303/com.mapcushion.androID.mapcushionPingl I/System.out﹕ -------------output------ : 2F234454-CF6D-4A0F-ADF2-F4911BA9FFA6 maj: 4 min: 10102-03 22:50:43.912    7303-7303/com.mapcushion.androID.mapcushionPingl I/﹕ Calling stopLeScan

smartwatch(不工作):

2-03 22:53:37.374    6177-6189/com.mapcushion.androID.mapcushionPingl D/BluetoothAdapter﹕ onScanResult() - Device=E5:E0:20:CF:63:32 RSSI=-4602-03 22:53:37.376    6177-6177/com.mapcushion.androID.mapcushionPingl I/﹕ INSIDE ONLESCAN02-03 22:53:37.376    6177-6177/com.mapcushion.androID.mapcushionPingl I/﹕ scanned record: 6202-03 22:53:37.376    6177-6177/com.mapcushion.androID.mapcushionPingl I/﹕ byte 0: 202-03 22:53:37.376    6177-6177/com.mapcushion.androID.mapcushionPingl I/﹕ byte 1: 102-03 22:53:37.376    6177-6177/com.mapcushion.androID.mapcushionPingl I/﹕ byte 2: 002-03 22:53:37.376    6177-6177/com.mapcushion.androID.mapcushionPingl I/﹕ byte 3: 002-03 22:53:37.376    6177-6177/com.mapcushion.androID.mapcushionPingl I/﹕ byte 4: 002-03 22:53:37.376    6177-6177/com.mapcushion.androID.mapcushionPingl I/﹕ byte 5: 002-03 22:53:37.376    6177-6177/com.mapcushion.androID.mapcushionPingl I/﹕ byte 6: 0... (all 0's)02-03 22:53:37.378    6177-6177/com.mapcushion.androID.mapcushionPingl I/﹕ byte 61: 002-03 22:53:37.378    6177-6177/com.mapcushion.androID.mapcushionPingl I/﹕ scanned record: 6202-03 22:53:37.378    6177-6177/com.mapcushion.androID.mapcushionPingl I/﹕ IDentifIEr check: 0 == 202-03 22:53:37.378    6177-6177/com.mapcushion.androID.mapcushionPingl I/﹕ Length of data : 0==2102-03 22:53:37.378    6177-6177/com.mapcushion.androID.mapcushionPingl I/﹕ scanned record: 6202-03 22:53:37.378    6177-6177/com.mapcushion.androID.mapcushionPingl I/﹕ IDentifIEr check: 0 == 202-03 22:53:37.378    6177-6177/com.mapcushion.androID.mapcushionPingl I/﹕ Length of data : 0==2102-03 22:53:37.378    6177-6177/com.mapcushion.androID.mapcushionPingl I/﹕ scanned record: 6202-03 22:53:37.378    6177-6177/com.mapcushion.androID.mapcushionPingl I/﹕ IDentifIEr check: 0 == 202-03 22:53:37.378    6177-6177/com.mapcushion.androID.mapcushionPingl I/﹕ Length of data : 0==2102-03 22:53:37.378    6177-6177/com.mapcushion.androID.mapcushionPingl I/﹕ scanned record: 6202-03 22:53:37.378    6177-6177/com.mapcushion.androID.mapcushionPingl I/﹕ IDentifIEr check: 0 == 202-03 22:53:37.378    6177-6177/com.mapcushion.androID.mapcushionPingl I/﹕ Length of data : 0==2102-03 22:53:37.643    6177-6177/com.mapcushion.androID.mapcushionPingl I/﹕ Calling stopLeScan02-03 22:53:37.643    6177-6177/com.mapcushion.androID.mapcushionPingl D/BluetoothAdapter﹕ stopLeScan()02-03 22:53:37.743    6177-6177/com.mapcushion.androID.mapcushionPingl I/﹕ Calling stopLeScan02-03 22:53:37.743    6177-6177/com.mapcushion.androID.mapcushionPingl D/BluetoothAdapter﹕ stopLeScan()
解决方法 由于您使用Nexus 7确认信标的Mac地址为E5:E0:20:CF:63:32,您会看到该手表的广告显示为:

0201000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

虽然Nexus 7将其读作一个非常不同的字节序列:

02011a0bff4c0009060102c0a801130000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

我必须得出结论,手表没有正确读取BLE制造商的广告 – 它在两个字节后截断它们.

问题可能是MTK6572 ROM,硬件或两者协同工作的方式.为了其他人,可能值得记录完整的手表配置.

总结

以上是内存溢出为你收集整理的Android Beacon Library在一台Android 4.4设备上运行良好,但在另一台Android设备上运行良好全部内容,希望文章能够帮你解决Android Beacon Library在一台Android 4.4设备上运行良好,但在另一台Android设备上运行良好所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1127758.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-30
下一篇2022-05-30

发表评论

登录后才能评论

评论列表(0条)

    保存