我正在尝试从我的Android应用中对ChromeOS进行BLE扫描。打开位置权限后,我可以获得扫描结果。但结果中没有制造商数据。
我在固件中设置的制造商ID是0x0。我正在打印整个结果对象,但没有在任何地方看到我的制造商特定数据(No 0xff,这是Manu。特定数据类型)
任何人都知道为什么会这样吗?
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));