How to read UDID, Major, Minor of beacon on android devices?

后端 未结 2 1526
一整个雨季
一整个雨季 2021-01-03 08:41

I am trying to develop a BLE application for Android.

Is the any way through which i can detect and read UDID, Major, Minor of beacon on android devices?

I h

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-03 09:24

    When you get the byte[] scanRecord from BluetoothAdapter.LeScanCallback, it will include the Bluetooth LE headers, which can be variable length depending on the type of iBeacon.

    Because of the variable length headers the four bytes that indicate an iBeacon advertisement (4c 00 02 15) may begin anywhere from the third byte (scanRecord[2]) up to the sixth byte (scanRecord[5]). In the latest code, the Android iBeacon Library finds the index position of the 4c 00 02 15 within the scanRecord and calls it the startByte. Everything else is at a fixed position relative to that startByte.

提交回复
热议问题