BluetoothPairingStateProvider:getUuids()为设备返回null

时间:2019-02-25 11:08:05

标签: android bluetooth bluetooth-lowenergy fido-u2f fido

上下文:

我正在使用nRF52 BLE SoC开发FIDO-U2F蓝牙认证器。并希望它使用google example进行测试。

到目前为止,我已经实现了FIDO Bluetooth specification,并且有一台广告宣传为与FIDO兼容的设备。

感谢nRF Connect,我确保正确公开了所有服务和特征,并且只有在我的设备与LTK安全配对后,我才能与之交互: nRF Connect screenshot

问题:

该应用扫描符合条件的FIDO设备时,找不到我的设备。

我被困在要求按下按钮5秒钟的屏幕上,这是我不需要的,因为我的设备无需用户交互即可响应配对请求,并且已经与我的SAMSUNG A8配对。

I/BluetoothDevicePreference: onDeviceAttributesChanged :: Device = (N) D8BE86, isBonded = 12 , mIsOnProgressAddVI = false
I/Fido: [BleScanner] startScan()
E/Fido: [BluetoothPairingStateProvider] getUuids() returns null for device: D8:BE:86:4A:E5:65
I/Fido: [PreferredTransportProvider] BLE enabled but no device is paired
I/Fido: [AuthenticateBaseChimeraActivity] User selected transport ble
I/Fido: [ViewController] Accepting proposed view {"viewName":"ble_instructions","anyU2fDevicesPaired":false}: outranks current (2 > 0)
I/Fido: [ViewPresenter] viewSelected(...) ble_instructions
I/Fido: [U2fRequestController] onResultReceived(null, ErrorResponseData{errorCode=5})
I/Fido: [BleScanner] stopScan()

我试图删除配对数据,但是我只有:

I/BluetoothDevicePreference: onDeviceAttributesChanged :: Device = (N) D8BE86, isBonded = 10 , mIsOnProgressAddVI = false

广告标记当前设置为“ 不支持BR / EDR ”,但我还尝试了“ LE限制可发现模式”和“ LE常规可发现”模式”没有成功。

我查看了 android-fido 源,但是BLE扫描似乎是从其他地方导入的,我无法在此项目中对其进行调试。

欢迎任何指针

1 个答案:

答案 0 :(得分:0)

您是否已进入此屏幕?

enter image description here

我们可能需要在广告数据包中添加服务数据字段(0x16)。 FIDO规范here

中提到了这一点

用于广告的Android代码段,其中添加了“服务数据”字段:

AdvertiseData data = new AdvertiseData.Builder()
                        .addServiceUuid(new ParcelUuid(fido2GattService.getUuid()))
                        .setIncludeDeviceName(true)
                        .addServiceData(new ParcelUuid(fido2GattService.getUuid()), new byte[] {(byte)192, (byte)192, (byte)192})
                        .build();

如果您想捕获蓝牙数据包以查看您的广告数据包,则可以使用PacketLogger(对于MacOS)

这是广告包的屏幕截图 enter image description here

红色框为服务数据