I deal with a thesis on the topic "car diagnostics via bluetooth". However, now I'm stuck in the problem. I have application, which can connect bluetooth to mobile (from tablet - android to android). Its ok state is CONNECT. But when I tried to connect to the OBD adapter. It was unsuccessful.
Trying to connect approximately this way:
public void run() {
// Cancel discovery because it will slow down the connection
mBluetoothAdapter.cancelDiscovery();
try {
mmSocket.connect();
} catch (IOException connectException) {
connectException = connectException;
mHandler.obtainMessage(NOT_CONNECT).sendToTarget();
try {
mmSocket.close();
} catch (IOException closeException) { }
return;
}
mHandler.obtainMessage(SUCCESS_CONNECT, mmSocket).sendToTarget();
}
}
Please can you advise me also how to create a valid AT command, which is then queries the OBD adapter?
Thank you for helps!