Open benjaminBrownlee opened 6 years ago
Never mind, I figured it out.
Serial.write("ODB State: ");
OBD_STATES state = obd.getState();
if(state == OBD_DISCONNECTED) Serial.write("Disconnected");
if(state == OBD_CONNECTING) Serial.write("Connecting");
if(state == OBD_CONNECTED) Serial.write("Connected");
if(state == OBD_FAILED) Serial.write("Failed");
Serial.write("\n");
In the code there is the following function to fetch the state of the OBD:
These states also have there own variable type defined in the library:
I actually have two questions here. First, how can I get the state of the OBD into a usable format? I have tried casting and comparing, as shown below, with little sucess:
Also, what is the point of making a function that returns a useless variable type? There are no built in functions to these variables that provide any utility to the user, and as far as I can see, they are fairly inconvenient (or even impossible) to get in a format that can interact with other code.