I am working on an Android app that broadcasts iBeacon signals. However, when I inspect the broadcasted packet, it doesn’t include the BLE flags (0x02, 0x01, 0x06), which are necessary for proper detection. The receiver I am working with does not detect the broadcast unless these flags are included.
Is there a way to force the device to include these flags during the broadcast? Could this issue be related to the Android version (I’m using Android 9), or is it specific to the device?
Any help would be appreciated!
I am using Android’s Bluetooth Low Energy (BLE) API in my test app. Below is the code where I prepare the broadcast.
val manufacturerData = byteArrayOf(
0x02, 0x15,
0xE2.toByte(), 0xC5.toByte(), 0x6D.toByte(), 0xB5.toByte(),
0xDF.toByte(), 0xFB.toByte(), 0x48.toByte(), 0xD2.toByte(),
0xB0.toByte(), 0x60.toByte(), 0xD0.toByte(), 0xF5.toByte(),
0xA7.toByte(), 0x10.toByte(), 0x96.toByte(), 0xE0.toByte(),
0x00, 0x01, 0x00, 0x01, 0xC5.toByte()
)
val advertiseData = AdvertiseData.Builder()
.setIncludeDeviceName(false)
.addManufacturerData(0x004C, manufacturerData)
.build()
val advertiseSettings = AdvertiseSettings.Builder()
.setAdvertiseMode(AdvertiseSettings.ADVERTISE_MODE_LOW_LATENCY)
.setTxPowerLevel(AdvertiseSettings.ADVERTISE_TX_POWER_HIGH)
.setConnectable(false)
.build()
Miky is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.