Background
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.
Problem
So my simple goal at the moment is to create a connection with the Wii Balance Board.
My approach for connection is:
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);
As mentioned on the WiiBrew site I'm using psm value 0x13 for input and 0x11 for output.
I then use
bluetoothSocket.connect
and proceed to receive a IOException (timeout error)I've also tried using both
createL2capChannel
andcreateInsecureL2capChannel
with same resultsI 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)
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.
Have you looked at the bt_stack logs?
Here is mine from trying to open a socket with a wiimote:
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