上下文:
我正在用nRF52 BLE SoC开发一个FIDO-U2F蓝牙认证器。并希望用google示例进行测试。
到目前为止,我已经实现了FIDO蓝牙规范,我有一个设备广告作为一个与FIDO兼容的设备。
多亏了nRF连接,我确保了所有服务和特性都被正确地公开,并且只有当我的设备安全地配对(与LTK)时,我才能与它交互:

问题:
当应用程序扫描合格的FIDO设备时,它找不到我的设备。
我被困在要求按5s按钮的屏幕上,因为我的设备在没有用户交互的情况下响应配对请求,并且已经和我的三星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不支持“,但我也尝试了”Limited发现模式“和"LE General Discoverable Mode”,但没有成功。
我查看了android的源代码,但是BLE扫描似乎是从其他地方导入的,我不能在这个项目中调试它。
任何指针都欢迎。
发布于 2019-05-27 12:38:42
你到这个屏幕上了吗?

我们可能需要在广告包中添加服务数据字段(0x16)。FIDO规范这里中提到了这一点。
添加了用于广告广告的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)。
这是广告包的截图。

红色框是服务数据
https://stackoverflow.com/questions/54864840
复制相似问题