Is it possible to use a wiimote as an android game controller?

∥☆過路亽.° 提交于 2021-02-07 20:59:24

问题


I have been interested in using a Wiimote as a controller for Android for a long time.

I know this was possible many years ago before the methods for creating an l2cap socket were removed from the Android api.

In api 29 (Android 10) methods for creating an l2cap socket were added, so theoretically it should now be possible to to use a Wiimote as a controller.

I create and try to connect to the socket like this:

BluetoothSocket socket = mWiimote.createInsecureL2capChannel(0x13);
socket.connect();

Where 0x13 is the PSM of the Wiimote data pipe, as stated here: https://wiibrew.org/wiki/Wiimote#HID_Interface

I have tried connecting to the control pipe aswell to no avail.

I just get: java.io.IOException: read failed, socket might closed or timeout, read ret -1

Someone else has the same issue trying to connect a Wii Balance Board: Android 10 L2CAP connection IOException timeout Wii Balance Board

They have managed to pair with the Balance Board but I have been unsuccessful, from what I understand this requires the privileged bluetooth permission as you have to set the key (mac address of the host or controller, backwards) depending the buttons pressed to make the Wiimote discoverable. I am unsure if this person is using the privileged permission (and has their app in the /priv-app/ folder), or they have a workaround.

来源:https://stackoverflow.com/questions/61029057/is-it-possible-to-use-a-wiimote-as-an-android-game-controller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!