我想我的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。 –