isValidPID function is stopping at PID 0x7F, why?
Posted: Wed Nov 04, 2020 12:46 am
Hello,
I try to read out the list of all supported PIDs of a car, but I noticed that PIDs equal/above 0x7F are all reporting true, when using the isValidPID function? Due to the OBD PID list on wikipedia I assume the behaviour is wrong https://en.wikipedia.org/wiki/OBD-II_PIDs
Best Christian
I try to read out the list of all supported PIDs of a car, but I noticed that PIDs equal/above 0x7F are all reporting true, when using the isValidPID function? Due to the OBD PID list on wikipedia I assume the behaviour is wrong https://en.wikipedia.org/wiki/OBD-II_PIDs
Code: Select all
bool COBD::isValidPID(byte pid)
{
if (pid >= 0x7f) //<---- this looks wrong to me.
return true;
pid--;
byte i = pid >> 3;
byte b = 0x80 >> (pid & 0x7);
return (pidmap[i] & b) != 0;
}