Add ID value to all STATUS-type messages
csurf opened this issue · comments
One quirky things I've noticed with the python-OBD code is that almost all of the commands that produce 'STATUS'-type responses will have return values that are plain English strings. This makes them rather inflexible because it forces the user to programmatically parse the strings before further processing them, such as to translate them, shorten them, customize the name or message, to hand them off to some other program routine, etc.
Ideally, these types of response values would have an associated numeric ID value that can be used in a much easier way in order to process such responses.
example:
when querying the 'fuel status' command (PID 01 03), python-OBD offers these response value strings...
""
--
"Open loop due to insufficient engine temperature"
"Closed loop, using oxygen sensor feedback to determine fuel mix"
"Open loop due to engine load OR fuel cut due to deceleration"
"Open loop due to system failure"
"Closed loop, using at least one oxygen sensor but there is a fault in the feedback system"
It might be more useful to have something where each status response can be uniquely identified with a numeric value, like the following:
0: "Open loop due to insufficient engine temperature"
1: "Closed loop, using oxygen sensor feedback to determine fuel mix"
2: "Open loop due to engine load OR fuel cut due to deceleration"
3: "Open loop due to system failure"
4: "Closed loop, using at least one oxygen sensor but there is a fault in the feedback system"