summaryrefslogtreecommitdiffstats
path: root/CAN-binder/libs/uds-c/src/uds/extras.h
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-05-02 17:52:11 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-05-02 17:52:11 +0200
commit0242c26c2f5dc96387bca7efb118364c800f4ee7 (patch)
treeba0a67a78004a45afd158a3ca3fb01c6fc012e06 /CAN-binder/libs/uds-c/src/uds/extras.h
parent3102ec9ce009d0f28355c5b7df9c5bd5013e6e75 (diff)
parentca20db3dd978871bbb9f01f3c862b510c03d1dc4 (diff)
Add 'CAN-binder/libs/uds-c/' from commit 'ca20db3dd978871bbb9f01f3c862b510c03d1dc4'
git-subtree-dir: CAN-binder/libs/uds-c git-subtree-mainline: 3102ec9ce009d0f28355c5b7df9c5bd5013e6e75 git-subtree-split: ca20db3dd978871bbb9f01f3c862b510c03d1dc4
Diffstat (limited to 'CAN-binder/libs/uds-c/src/uds/extras.h')
-rw-r--r--CAN-binder/libs/uds-c/src/uds/extras.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/CAN-binder/libs/uds-c/src/uds/extras.h b/CAN-binder/libs/uds-c/src/uds/extras.h
new file mode 100644
index 00000000..126e5d42
--- /dev/null
+++ b/CAN-binder/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__