蓝牙配对问题
Issue in Bluetooth pairing
我们正在 WEC2013 中使用通用供应商提供的基于 USB 的加密狗在 iMx6 平台上测试蓝牙。我们正在使用 WEC2013 BSP 提供的默认 HCI 传输层。
BT 已开启,可以扫描附近的所有设备。
我们启用了以下一组 sysgen 变量和注册表项。
Sysgen 变量:
SYSGEN_BTH (Bluetooth stack with universal loadable driver)
SYSGEN_BTH_BTHUTIL (Bluetooth Profile Management APIs)
SYSGEN_BTH_HID_KEYBOARD (Bluetooth HID - Keyboard)
SYSGEN_BTH_HID_MOUSE (Bluetooth HID - Mouse)
SYSGEN_BTH_AG (Bluetooth HS/HF and Audio gateway service)
SYSGEN_BTH_SETTINGS (Bluetooth settings UI)
SYSGEN_OBEX_CLIENT (Obex client)
SYSGEN_OBEX_SERVER (Obex server)
SYSGEN_OBEX_FILEBROWSER (OBEX file browser)
SYSGEN_OBEX_INBOX (OBEX Inbox)
SYSGEN_FTPD (FTP server)
SYSGEN_BTH_BTHSSVC(Support Secure Simple Pairing)
注册表项:
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\Default4_1_1\Default\Bluetooth_USB_Driver]
"DLL"="bthusb.dll"
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\Default\Default4_1_1\Bluetooth_USB_Driver]
"DLL"="bthusb.dll"
[HKEY_LOCAL_MACHINE\Software\Microsoft\Bluetooth\Transports\PnP\{B3DD867A-1E6E-4215-8AA7-EAC1DFC46548}]
"flags"=dword:80000000
"driver"="bthusb.dll"
"resetdelay"=dword:0
"PacketSize"=dword:200
"BlockSize"=dword:5
[HKEY_LOCAL_MACHINE\ControlPanel\Bluetooth]
"PinAttemptInterval"=dword:200000
"PinEntries"=multi_sz:"0000","8888"
我们观察到与设备配对的不同情况。
从主板连接到手机(imx6+usb dongle 运行 WEC2013)
这里通过bthsettingsUI发起pair时配对成功。它将触发双方的 6 位自动密码。
在不打开 bthsettings 的情况下从手机连接到主板 UI。
这里配对成功一次。当 UI 未打开(BT 在后台打开)时,从手机启动配对,两者都将使用自动配对
6 位密码方法。但这会在内部调用 bthsettings UI,所以下次我们从移动端进行配对时,移动端会要求手动
钥匙插入。一旦在手机上输入密钥并按下配对,就会在移动终端上看到配对被拒绝的通知。
所以在这种情况下配对失败。
打开 bthsettings 时从手机连接到主板。
这里配对失败。当从移动设备启动配对时,将调用手动密钥插入 UI 并且当插入密钥并按下配对时,
移动端会显示配对被拒绝通知,配对失败。
在这些失败的场景中,上层正在响应 "Pin code request negative reply command" for "Pin code request event" from chip.
我们需要有关此配对过程的信息。为什么根据 UI 是否打开或从未打开来调用此自动密钥和手动密钥生成方法?为什么手动钥匙包失败?
我们是否缺少任何注册表项或堆栈功能?
It all got to do with SSP(Secured Simple Pairing), which decides the pairing authentication model. This is affected in WEC8(2013) through the changes under bthsettings.
Under WEC8 they disable SSP(via function EnbaleSSP()) whenever a connection is initiated from external device and enable back SSP when conenction is initiated internally. Though this is the logic, I'm not aware of why this is introduced(and is it a bug, that'll be fixed in upcoming updates as they initially did for NDIS 5 wireless driver connection).
And as a workaround to this, disable EnableSSP().
Also SYSGEN_BTH_BTHSSVC is implicitly needed by SYSGEN_BTH_SETTINGS component, and the link is broken under WEC8.
Microsoft has provided the fix in April 2015 update. Details available here.
我们正在 WEC2013 中使用通用供应商提供的基于 USB 的加密狗在 iMx6 平台上测试蓝牙。我们正在使用 WEC2013 BSP 提供的默认 HCI 传输层。
BT 已开启,可以扫描附近的所有设备。
我们启用了以下一组 sysgen 变量和注册表项。
Sysgen 变量:
SYSGEN_BTH (Bluetooth stack with universal loadable driver)
SYSGEN_BTH_BTHUTIL (Bluetooth Profile Management APIs)
SYSGEN_BTH_HID_KEYBOARD (Bluetooth HID - Keyboard)
SYSGEN_BTH_HID_MOUSE (Bluetooth HID - Mouse)
SYSGEN_BTH_AG (Bluetooth HS/HF and Audio gateway service)
SYSGEN_BTH_SETTINGS (Bluetooth settings UI)
SYSGEN_OBEX_CLIENT (Obex client)
SYSGEN_OBEX_SERVER (Obex server)
SYSGEN_OBEX_FILEBROWSER (OBEX file browser)
SYSGEN_OBEX_INBOX (OBEX Inbox)
SYSGEN_FTPD (FTP server)
SYSGEN_BTH_BTHSSVC(Support Secure Simple Pairing)
注册表项:
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\Default4_1_1\Default\Bluetooth_USB_Driver]
"DLL"="bthusb.dll"
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\Default\Default4_1_1\Bluetooth_USB_Driver]
"DLL"="bthusb.dll"
[HKEY_LOCAL_MACHINE\Software\Microsoft\Bluetooth\Transports\PnP\{B3DD867A-1E6E-4215-8AA7-EAC1DFC46548}]
"flags"=dword:80000000
"driver"="bthusb.dll"
"resetdelay"=dword:0
"PacketSize"=dword:200
"BlockSize"=dword:5
[HKEY_LOCAL_MACHINE\ControlPanel\Bluetooth]
"PinAttemptInterval"=dword:200000
"PinEntries"=multi_sz:"0000","8888"
我们观察到与设备配对的不同情况。
从主板连接到手机(imx6+usb dongle 运行 WEC2013) 这里通过bthsettingsUI发起pair时配对成功。它将触发双方的 6 位自动密码。
在不打开 bthsettings 的情况下从手机连接到主板 UI。 这里配对成功一次。当 UI 未打开(BT 在后台打开)时,从手机启动配对,两者都将使用自动配对 6 位密码方法。但这会在内部调用 bthsettings UI,所以下次我们从移动端进行配对时,移动端会要求手动 钥匙插入。一旦在手机上输入密钥并按下配对,就会在移动终端上看到配对被拒绝的通知。 所以在这种情况下配对失败。
打开 bthsettings 时从手机连接到主板。 这里配对失败。当从移动设备启动配对时,将调用手动密钥插入 UI 并且当插入密钥并按下配对时, 移动端会显示配对被拒绝通知,配对失败。
在这些失败的场景中,上层正在响应 "Pin code request negative reply command" for "Pin code request event" from chip.
我们需要有关此配对过程的信息。为什么根据 UI 是否打开或从未打开来调用此自动密钥和手动密钥生成方法?为什么手动钥匙包失败?
我们是否缺少任何注册表项或堆栈功能?
It all got to do with SSP(Secured Simple Pairing), which decides the pairing authentication model. This is affected in WEC8(2013) through the changes under bthsettings.
Under WEC8 they disable SSP(via function EnbaleSSP()) whenever a connection is initiated from external device and enable back SSP when conenction is initiated internally. Though this is the logic, I'm not aware of why this is introduced(and is it a bug, that'll be fixed in upcoming updates as they initially did for NDIS 5 wireless driver connection).
And as a workaround to this, disable EnableSSP().
Also SYSGEN_BTH_BTHSSVC is implicitly needed by SYSGEN_BTH_SETTINGS component, and the link is broken under WEC8.
Microsoft has provided the fix in April 2015 update. Details available here.