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?
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.