diff options
author | Christopher Peplin <chris.peplin@rhubarbtech.com> | 2014-01-03 21:33:45 -0500 |
---|---|---|
committer | Christopher Peplin <chris.peplin@rhubarbtech.com> | 2014-01-03 21:33:45 -0500 |
commit | 122d57e1c70b309542c1b5beb9e62d61726ccc02 (patch) | |
tree | 2d88ba363e07262924222e543b448f3b4f2442e9 /src/obd2/extras.h | |
parent | 30b967cdd8926eb44efa720b8f59a842d836859d (diff) |
Document all remaining methods and data structures.
Diffstat (limited to 'src/obd2/extras.h')
-rw-r--r-- | src/obd2/extras.h | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/src/obd2/extras.h b/src/obd2/extras.h index e4113077..50ad3b77 100644 --- a/src/obd2/extras.h +++ b/src/obd2/extras.h @@ -1,12 +1,52 @@ #ifndef __EXTRAS_H__ #define __EXTRAS_H__ -#include <isotp/isotp.h> +#include <obd2/obd2_types.h> #ifdef __cplusplus extern "C" { #endif +// TODO everything in here is unused for the moment! + +typedef enum { + POWERTRAIN = 0x0, + CHASSIS = 0x1, + BODY = 0x2, + NETWORK = 0x3 +} DiagnosticTroubleCodeGroup; + +typedef struct { + DiagnosticTroubleCodeGroup group; + uint8_t group_num; + uint8_t code; +} DiagnosticTroubleCode; + + +/* Private: TODO unused for now + */ +typedef enum { + DTC_EMISSIONS, + DTC_DRIVE_CYCLE, + DTC_PERMANENT +} DiagnosticTroubleCodeType; + + +// TODO should we enumerate every OBD-II PID? need conversion formulas, too +typedef struct { + uint16_t pid; + uint8_t bytes_returned; + float min_value; + float max_value; +} DiagnosticParameter; + +typedef void (*DiagnosticMilStatusReceived)(bool malfunction_indicator_status); +typedef void (*DiagnosticVinReceived)(uint8_t vin[]); +typedef void (*DiagnosticTroubleCodesReceived)( + DiagnosticMode mode, DiagnosticTroubleCode* codes); +typedef void (*DiagnosticPidEnumerationReceived)( + const DiagnosticResponse* response, uint16_t* pids); + DiagnosticRequestHandle diagnostic_request_malfunction_indicator_status( DiagnosticShims* shims, DiagnosticMilStatusReceived callback); |