summaryrefslogtreecommitdiffstats
path: root/libs/uds-c/src/uds/extras.h
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-06-20 10:24:05 +0000
committerRomain Forlot <romain.forlot@iot.bzh>2017-06-20 10:24:05 +0000
commit32e25cbca210a359b09768537b6f443fe90a3070 (patch)
tree3309794c15d8a8f8e9c1c08cad072ee1378813ba /libs/uds-c/src/uds/extras.h
parent76c43dec62b2e21cd6446360c00d4fe6b437533f (diff)
Separation Generator to a dedicated repo
Change-Id: Id94831651c3266861435272a6e36c7884bef2c45 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'libs/uds-c/src/uds/extras.h')
-rw-r--r--libs/uds-c/src/uds/extras.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/libs/uds-c/src/uds/extras.h b/libs/uds-c/src/uds/extras.h
new file mode 100644
index 00000000..126e5d42
--- /dev/null
+++ b/libs/uds-c/src/uds/extras.h
@@ -0,0 +1,71 @@
+#ifndef __EXTRAS_H__
+#define __EXTRAS_H__
+
+#include <uds/uds_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);
+
+DiagnosticRequestHandle diagnostic_request_vin(DiagnosticShims* shims,
+ DiagnosticVinReceived callback);
+
+DiagnosticRequestHandle diagnostic_request_dtc(DiagnosticShims* shims,
+ DiagnosticTroubleCodeType dtc_type,
+ DiagnosticTroubleCodesReceived callback);
+
+bool diagnostic_clear_dtc(DiagnosticShims* shims);
+
+DiagnosticRequestHandle diagnostic_enumerate_pids(DiagnosticShims* shims,
+ DiagnosticRequest* request, DiagnosticPidEnumerationReceived callback);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __EXTRAS_H__