diff options
-rw-r--r-- | README.mkd | 14 | ||||
-rw-r--r-- | src/uds/extras.c (renamed from src/obd2/extras.c) | 4 | ||||
-rw-r--r-- | src/uds/extras.h (renamed from src/obd2/extras.h) | 4 | ||||
-rw-r--r-- | src/uds/uds.c (renamed from src/obd2/obd2.c) | 2 | ||||
-rw-r--r-- | src/uds/uds.h (renamed from src/obd2/obd2.h) | 8 | ||||
-rw-r--r-- | src/uds/uds_types.h (renamed from src/obd2/obd2_types.h) | 14 | ||||
-rw-r--r-- | tests/common.c | 2 | ||||
-rw-r--r-- | tests/test_core.c | 4 |
8 files changed, 27 insertions, 25 deletions
@@ -1,9 +1,11 @@ -OBD-II Support Library in C -============================= - -This is a platform agnostic C library that implements the standard On Board -Diagnostics system for vehicles. It currently supports OBD-II running over CAN -(ISO 15765-4), which uses the ISO-TP (ISO 15765-2) protocol underneath. +Unified Diagnostic Services (UDS) Support Library in C +====================================================== + +This is a platform agnostic C library that implements the Unified Diagnostics +Services protocol for automotive electronics. UDS is documented in ISO 14229 and +is the underpinning for the more well-known On-board Diagnostics (OBD) standard. +The library currently supports UDS running over CAN (ISO 15765-4), which uses +the ISO-TP (ISO 15765-2) protocol for message framing. This library doesn't assume anything about the source of your diagnostic message requests or underlying interface to the CAN bus. It uses dependency injection to diff --git a/src/obd2/extras.c b/src/uds/extras.c index 37a55fe..2be6bdd 100644 --- a/src/obd2/extras.c +++ b/src/uds/extras.c @@ -1,5 +1,5 @@ -#include <obd2/extras.h> -#include <obd2/obd2.h> +#include <uds/extras.h> +#include <uds/uds.h> // TODO everything below here is for future work...not critical for now. diff --git a/src/obd2/extras.h b/src/uds/extras.h index 5ec4b47..c59c7ba 100644 --- a/src/obd2/extras.h +++ b/src/uds/extras.h @@ -1,7 +1,7 @@ #ifndef __EXTRAS_H__ #define __EXTRAS_H__ -#include <obd2/obd2_types.h> +#include <uds/uds_types.h> #ifdef __cplusplus extern "C" { @@ -64,7 +64,7 @@ DiagnosticRequestHandle diagnostic_enumerate_pids(DiagnosticShims* shims, DiagnosticRequest* request, DiagnosticPidEnumerationReceived callback); // TODO -float diagnostic_decode_obd2_pid(DiagnosticResponse* response); +float diagnostic_decode_OBD2_pid(DiagnosticResponse* response); #ifdef __cplusplus } diff --git a/src/obd2/obd2.c b/src/uds/uds.c index 5061dd6..443b05a 100644 --- a/src/obd2/obd2.c +++ b/src/uds/uds.c @@ -1,4 +1,4 @@ -#include <obd2/obd2.h> +#include <uds/uds.h> #include <bitfield/bitfield.h> #include <string.h> #include <limits.h> diff --git a/src/obd2/obd2.h b/src/uds/uds.h index bcd6e76..091d3c9 100644 --- a/src/obd2/obd2.h +++ b/src/uds/uds.h @@ -1,7 +1,7 @@ -#ifndef __OBD2_H__ -#define __OBD2_H__ +#ifndef __UDS_H__ +#define __UDS_H__ -#include <obd2/obd2_types.h> +#include <uds/uds_types.h> #include <stdint.h> #include <stdbool.h> @@ -99,4 +99,4 @@ DiagnosticResponse diagnostic_receive_can_frame(DiagnosticShims* shims, } #endif -#endif // __OBD2_H__ +#endif // __UDS_H__ diff --git a/src/obd2/obd2_types.h b/src/uds/uds_types.h index 15552e8..f8c7ef0 100644 --- a/src/obd2/obd2_types.h +++ b/src/uds/uds_types.h @@ -1,5 +1,5 @@ -#ifndef __OBD2_TYPES_H__ -#define __OBD2_TYPES_H__ +#ifndef __UDS_TYPES_H__ +#define __UDS_TYPES_H__ #include <isotp/isotp.h> #include <stdint.h> @@ -11,7 +11,7 @@ extern "C" { // TODO This isn't true for multi frame messages - we may need to dynamically // allocate this in the future -#define MAX_OBD2_PAYLOAD_LENGTH 7 +#define MAX_UDS_PAYLOAD_LENGTH 7 #define MAX_RESPONDING_ECU_COUNT 8 #define VIN_LENGTH 17 @@ -46,7 +46,7 @@ typedef struct { uint8_t mode; uint16_t pid; uint8_t pid_length; - uint8_t payload[MAX_OBD2_PAYLOAD_LENGTH]; + uint8_t payload[MAX_UDS_PAYLOAD_LENGTH]; uint8_t payload_length; DiagnosticRequestType type; } DiagnosticRequest; @@ -101,7 +101,7 @@ typedef struct { bool has_pid; uint16_t pid; DiagnosticNegativeResponseCode negative_response_code; - uint8_t payload[MAX_OBD2_PAYLOAD_LENGTH]; + uint8_t payload[MAX_UDS_PAYLOAD_LENGTH]; uint8_t payload_length; } DiagnosticResponse; @@ -119,7 +119,7 @@ typedef enum { OBD2_MODE_CONTROL = 0x8, OBD2_MODE_VEHICLE_INFORMATION = 0x9, OBD2_MODE_PERMANENT_DTC_REQUEST = 0xa, - // this one isn't technically in OBD2, but both of the enhanced standards + // this one isn't technically in uds, but both of the enhanced standards // have their PID requests at 0x22 OBD2_MODE_ENHANCED_DIAGNOSTIC_REQUEST = 0x22 } DiagnosticMode; @@ -185,4 +185,4 @@ typedef struct { } #endif -#endif // __OBD2_TYPES_H__ +#endif // __UDS_TYPES_H__ diff --git a/tests/common.c b/tests/common.c index f79b8ad..8d7dd50 100644 --- a/tests/common.c +++ b/tests/common.c @@ -1,4 +1,4 @@ -#include <obd2/obd2.h> +#include <uds/uds.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> diff --git a/tests/test_core.c b/tests/test_core.c index 1ab9409..489e174 100644 --- a/tests/test_core.c +++ b/tests/test_core.c @@ -1,4 +1,4 @@ -#include <obd2/obd2.h> +#include <uds/uds.h> #include <check.h> #include <stdint.h> #include <stdio.h> @@ -261,7 +261,7 @@ START_TEST (test_negative_response) END_TEST Suite* testSuite(void) { - Suite* s = suite_create("obd2"); + Suite* s = suite_create("uds"); TCase *tc_core = tcase_create("core"); tcase_add_checked_fixture(tc_core, setup, NULL); tcase_add_test(tc_core, test_send_diag_request); |