Android 10 L2CAP连接IOException超时Wii平衡板 [英] Android 10 L2CAP connection IOException timeout Wii Balance Board
问题描述
很久以前,我被责成为Wii平衡板制作一个android应用程序,经过一番纠缠后,我发现android不再支持L2CAP.更多研究导致了解它正在重新是Android 10中的新增功能.随着Android 10的发布,我现在试图对其进行破解.
A long time ago I was tasked with making a android app for the Wii Balance Board, after some screwing around I found that android no longer supported L2CAP. More research lead to understand that it was being re-added in Android 10. With Android 10 out I've been trying to give it a crack now.
所以我目前的简单目标是与Wii平衡板建立连接.
So my simple goal at the moment is to create a connection with the Wii Balance Board.
我的连接方法是:
-
开始发现
Start discovery
将发现的蓝牙设备添加到列表中
Add discovered bluetooth devices to list
当您单击设备时,它会尝试按以下方式打开套接字:
When you click on a device it then tries to open a socket as such:
bluetoothSocket = btDevice.createInsecureL2capChannel(port);
如 WiiBrew 网站中所述,我将psm值0x13用于输入和输出为0x11.
As mentioned on the WiiBrew site I'm using psm value 0x13 for input and 0x11 for output.
然后我使用bluetoothSocket.connect
并继续接收IOException(超时错误)
I then use bluetoothSocket.connect
and proceed to receive a IOException (timeout error)
我还尝试过同时使用createL2capChannel
和createInsecureL2capChannel
并获得相同的结果
I've also tried using both createL2capChannel
and createInsecureL2capChannel
with same results
我能够使用btDevice.createBond()
成功配对到设备,然后将电话BT地址反向使用.setpin()
,Wii平衡板只是充当了哑巴".输入设备. (不确定是否需要配对/好主意)
I was able to successfully pair to the device using btDevice.createBond()
and then using the phones BT address backwards for .setpin()
and the Wii Balance Board simply acts as a "dumb" input device. (not sure if pairing is needed/good idea)
以上是我尝试连接的简化流程.我还尝试过使用Paul Burton的 fitscales 中的BalanceBoard.java
回购更新所有旧的蓝牙代码,再次,我仍然超时.
The above is a simplified flow of how I'm trying to connect. I've also tried using BalanceBoard.java
from Paul Burton's fitscales repo updating all of the old bluetooth code, again I still get the timeout.
推荐答案
您是否看过bt_stack日志?
Have you looked at the bt_stack logs?
这是我尝试用Wiimote打开插座的方法:
Here is mine from trying to open a socket with a wiimote:
04-05 12:25:04.949 E/bt_stack(4895): [ERROR:btif_sock_l2cap.cc(244)] SOCK_LIST: free(id = 4) - NO app_fd!
04-05 12:25:04.949 I/bt_stack(4895): [INFO:btsnoop.cc(323)] clear_l2cap_whitelist: Clearing whitelist from l2cap channel. conn_handle=65535 cid=65:0
04-05 12:25:04.949 E/bt_l2cap(4895): L2CA_FreeLePSM: Invalid PSM=19 value!
04-05 12:25:40.141 I/bt_stack(4895): [INFO:btsnoop.cc(323)] clear_l2cap_whitelist: Clearing whitelist from l2cap channel. conn_handle=1 cid=66:64
04-05 12:25:55.736 I/bt_stack(4895): [INFO:btsnoop.cc(323)] clear_l2cap_whitelist: Clearing whitelist from l2cap channel. conn_handle=2 cid=67:65
我相信这就是问题所在,我只是一个新手,所以我不确定该怎么办.我知道旧的连接方式将fd作为参数传递给了蓝牙套接字构造函数,但我认为这不再可行
I believe this is where the problem lies, Im only a novice so Im not sure what can be done about it. I know the old ways of connecting passed the fd as a parameter to the bluetooth socket constructor but I dont think this is possible anymore
这篇关于Android 10 L2CAP连接IOException超时Wii平衡板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!