Bluetooth LE devices can broadcast messages to other devices. That message packet can include informations like length, profile, rssi (signal strength), etc.
How can I read those Bluetooth LE broadcast data when scanning for BLE devices in Android?
API Levels 21+
In android.bluetooth.le.ScanCallback, the callback method as follows has a parameter named result, which has a field called scanRecord, with should contain the advertisement data sent by a BLE device.
void onScanResult (int callbackType, ScanResult result)
API Levels 18-20
In BluetoothAdapter.LeScanCallback, the callback method as follows has a parameter named scanRecord, which should contain the advertisement data sent by a BLE device.
public abstract void onLeScan (BluetoothDevice device, int rssi, byte[] scanRecord)
scanRecord: The content of the advertisement record offered by the remote device.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With