开发者

Can't connect to OBDKey sometimes

I can't 开发者_JAVA技巧connect to OBDKey sometimes . I use BluetoothChat example to connect to OBDKey. I can connect to it and read data, but sometimes socket is closed.

m = mmDevice.getClass().getMethod("createRfcommSocket", new Class[] { int.class });

mmSocket = (BluetoothSocket) m.invoke(mmDevice, 1);

mmSocket.connect();

Before this OBDKey is paired succesfully. Why does socket close sometimes?


Make sure you have a valid BluetoothSocket before calling connect(). Let me know directly if you need specific help with the OBDKey interface.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜