我想我的Nexus 4采用了Wii的平衡板连接,但我得到这个错误:安卓:getBluetoothService()调用时没有BluetoothManagerCallback
getBluetoothService() called with no BluetoothManagerCallback
connect(), SocketState: INIT, mPfd: null
所以也没有完成连接。
我的插座:
public final class wSocket
{
public static BluetoothSocket create(BluetoothDevice dev, int port)
{
try {
/*
* BluetoothSocket(int type, int fd, boolean auth, boolean encrypt, BluetoothDevice device, int port, ParcelUuid uuid)
*/
Constructor<BluetoothSocket> construct = BluetoothSocket.class.getDeclaredConstructor(int.class, int.class, boolean.class,
boolean.class, BluetoothDevice.class, int.class, ParcelUuid.class);
construct.setAccessible(true);
return construct.newInstance(3 /* TYPE_L2CAP */, -1, false, false, dev, port, null);
} catch (Exception ex) {
return null;
}
}
}
凡给我的错误:
private BluetoothSocket sk;
...
sk = wSocket.create(wm.dev, 0x11);
...
sk.connect();
我已经检查没有成功这个链接,因为我只开1个插槽: getbluetoothservice() called with no bluetoothmanagercallback
任何帮助还是想法探索?
你使用的是什么版本的android?我现在也突然得到这个错误,但从来没有过。 –
我刚开始在Android 4.4上看到这个错误。我在各种设备上使用蓝牙完成了大量工作,不过大部分是2.x和3.x。 –