开发者

Can't connect to OBDKey sometimes

开发者 https://www.devze.com 2023-01-10 07:52 出处:网络
I can\'t 开发者_JAVA技巧connect to OBDKey sometimes . I use BluetoothChat example to connect to OBDKey.

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

精彩评论

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