I am rather novice at C++, but purchased the UART adaptor and have it working very well on my vehicle. While testing, I noted that some PID requests were incrementing the obd.errors variable (which is totally fine). I wanted to determine what the error was so that I could programmatically skip over those PID(s) in the future. Looking in the library, I see the function "checkErrorMessage", but I'm not clear how to utilize it. Below is some example code where I am checking the PID_INTAKE_MAP value. My particular vehicle uses MAF and not MAP, so I know I am getting an error on this request. Obviously I can simply remove it, but if I hook the Freematics UART connector to another vehicle that uses MAP, i would like it to function. All that said, how can I get the error code from my vehicle when requesting PID_INTAKE_MAP?
Code: Select all
void updateBoostData() {
int value;
obd.readPID(PID_INTAKE_MAP, value); // getting an error here, but unclear what that error is
gaugeData.bv = value;
}
Thanks for any guidance you can provide!