1
votes

My goal is to write an app that allows me to control my Motorola Xoom with a Playstation 3 Bluetooth Remote Control.

The device is able to be discovered by the native bluetooth app & classified as being a joystick. However, I cannot pair via the native bluetooth app because the app requires a PIN & the device does not have a pin that I am aware of.

So far I am able to programmatically discover the device & create a socket, however all attempts to connect to the device fail.

In both cases: UUID u = UUID.fromString("00001124-0000-1000-8000-00805f9b34fb");

This is supposed to be the UUID used by HID devices. I also used the method described on another site to verify the UUID is available on the device.

Method1 (many people seem to have issues with this):

BluetoothSocket socket = device.createRfcommSocketToServiceRecord(u);
socket.connect();

Result: IOException "Service discovery failed"

Method2 (the accepted workaround to Method1. I also tried ports 1-100):

Method m = device.getClass().getMethod("createRfcommSocket", new Class[] {int.class});
BluetoothSocket socket = (BluetoothSocket) m.invoke(device, 1);
socket.connect();

Result: IOException "Connection refused"

I have tried this code using 3 devices (plus their UUIDs):

  • Playstation Remote

    00001124-0000-1000-8000-00805f9b34fb

    00001200-0000-1000-8000-00805f9b34fb

  • Nintento Wiimote

    00001000-0000-1000-8000-00805f9b34fb

    00001124-0000-1000-8000-00805f9b34fb

    00001200-0000-1000-8000-00805f9b34fb

  • Microsoft Bluetooth Number Pad (which sucessfully pairs, with a pin, via the natvie bluetooth app)

    00001000-0000-1000-8000-00805f9b34fb

    00001124-0000-1000-8000-00805f9b34fb

    00001200-0000-1000-8000-00805f9b34fb

1

1 Answers

1
votes

To be able to connect to the devices you have to connect over the HID profile, what you are trying is connecting over SPP (Serial Port Profile) to the UUID for HID etc, this will not work. In addition these devices have some "custom" HID protocol descriptors that allow it to work with this pre-paired gaming consoles, you will need to get access to those to be able to control the Xoom with these controllers