Rename from simply obd2 to more general UDS (unified diagnostics).
authorChristopher Peplin <chris.peplin@rhubarbtech.com>
Mon, 20 Jan 2014 20:22:27 +0000 (15:22 -0500)
committerChristopher Peplin <chris.peplin@rhubarbtech.com>
Mon, 20 Jan 2014 20:22:27 +0000 (15:22 -0500)
Fixed #1.

README.mkd
src/uds/extras.c [moved from src/obd2/extras.c with 96% similarity]
src/uds/extras.h [moved from src/obd2/extras.h with 95% similarity]
src/uds/uds.c [moved from src/obd2/obd2.c with 99% similarity]
src/uds/uds.h [moved from src/obd2/obd2.h with 97% similarity]
src/uds/uds_types.h [moved from src/obd2/obd2_types.h with 95% similarity]
tests/common.c
tests/test_core.c

index 0c28206..8f9574f 100644 (file)
@@ -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
similarity index 96%
rename from src/obd2/extras.c
rename to src/uds/extras.c
index 37a55fe..2be6bdd 100644 (file)
@@ -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.
 
similarity index 95%
rename from src/obd2/extras.h
rename to src/uds/extras.h
index 5ec4b47..c59c7ba 100644 (file)
@@ -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
 }
similarity index 99%
rename from src/obd2/obd2.c
rename to src/uds/uds.c
index 5061dd6..443b05a 100644 (file)
@@ -1,4 +1,4 @@
-#include <obd2/obd2.h>
+#include <uds/uds.h>
 #include <bitfield/bitfield.h>
 #include <string.h>
 #include <limits.h>
similarity index 97%
rename from src/obd2/obd2.h
rename to src/uds/uds.h
index bcd6e76..091d3c9 100644 (file)
@@ -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__
similarity index 95%
rename from src/obd2/obd2_types.h
rename to src/uds/uds_types.h
index 15552e8..f8c7ef0 100644 (file)
@@ -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__
index f79b8ad..8d7dd50 100644 (file)
@@ -1,4 +1,4 @@
-#include <obd2/obd2.h>
+#include <uds/uds.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
index 1ab9409..489e174 100644 (file)
@@ -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);