Android Bluetooth .connect() exception Nexus 7 OBDII adapter -
i'm using standard api procedures connecting device. obdii bluetooth adapters.
i have 2 obdii bluetooth adapters, of different models. running exact same code, first pair , connect without issue every phone/tablet i've tested. second pair , connect fine except nexus 7 running android 4.2
it throws ioexception: read failed, socket might closed or timeout, read ret: -1
thought wrong device or newer release... piece of software "torque" able connect either adapter nexus 7.
so i'm doing wrong/different issue in later os???
any figuring out appreciated.
public void run() { log.i(tag, "begin mconnectthread"); setname("connectthread"); // cancel discovery because slow down connection madapter.canceldiscovery(); // make connection bluetoothsocket try { // blocking call , return on // successful connection or exception mmsocket.connect(); <=**this exception thrown } catch (ioexception e) { etype = "connection to: " + mmdevice.getname() + " at: " + mmdevice.getaddress() + " failed: " + e.getmessage(); connectionfailed(); // close socket try { mmsocket.close(); } catch (ioexception e2) { log.e(tag, "unable close() socket during connection failure", e2); } // start service on restart listening mode bluetoothchatservice.this.start(); return; }
i know kind of old question. not able find solution on web. people searching might interested in workaround have found: ioexception: read failed, socket might closed - bluetooth on android 4.3
Comments
Post a Comment