3

I am trying to do BLE Scan on ChromeOS from my Android App. After turning on the Location Permissions I am able to get scan results. But the Manufacturer Data is not present in the results.

The Manufacturer id I have set in firmware is 0x0. I am printing the whole result object but do not see my Manufacturer Specific Data anywhere (No 0xff which is the Manu. Specific Data type)

Any one knows why this is happening?

private ScanCallback scanCallback = new ScanCallback() {
@Override
public void onScanResult(final int callbackType, final ScanResult result) {
BluetoothDevice device = result.getDevice();
int rssi = result.getRssi();
byte[] scanRecord = result.getScanRecord().getBytes();
Map<ParcelUuid, byte[]> Uuidmap = result.getScanRecord().getServiceData();

Log.i(TAG, "onScanResult- Name: " + device.getName() + " rssi: " + result.getRssi() + " Mfg data: " + Arrays.toString(result.getScanRecord().getManufacturerSpecificData(0)));
for (Map.Entry<ParcelUuid, byte[]> entry : Uuidmap.entrySet()) {
String key = entry.getKey().toString();
byte[] value = entry.getValue();
Log.i(TAG, "UUID: " + key + " Data: " + Arrays.toString(value));
}
Log.i(TAG, "Data " + Arrays.toString(scanRecord));
  • Did you find a solution to this problem? I am wondering the same right now. – IgorGanapolsky Mar 14 '17 at 16:18
  • 1
    It seems to be working with the latest chromebook update. Though you need to re-run the scan multiple times as sometimes so results in the service data field as not populated at all. – Siddarth Gore Jul 31 '17 at 08:39

0 Answers0