Fixed #1.
-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
-#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.
#ifndef __EXTRAS_H__
#define __EXTRAS_H__
-#include <obd2/obd2_types.h>
+#include <uds/uds_types.h>
#ifdef __cplusplus
extern "C" {
DiagnosticRequest* request, DiagnosticPidEnumerationReceived callback);
// TODO
-float diagnostic_decode_obd2_pid(DiagnosticResponse* response);
+float diagnostic_decode_OBD2_pid(DiagnosticResponse* response);
#ifdef __cplusplus
}
-#include <obd2/obd2.h>
+#include <uds/uds.h>
#include <bitfield/bitfield.h>
#include <string.h>
#include <limits.h>
-#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>
}
#endif
-#endif // __OBD2_H__
+#endif // __UDS_H__
-#ifndef __OBD2_TYPES_H__
-#define __OBD2_TYPES_H__
+#ifndef __UDS_TYPES_H__
+#define __UDS_TYPES_H__
#include <isotp/isotp.h>
#include <stdint.h>
// 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
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;
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;
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;
}
#endif
-#endif // __OBD2_TYPES_H__
+#endif // __UDS_TYPES_H__
-#include <obd2/obd2.h>
+#include <uds/uds.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
-#include <obd2/obd2.h>
+#include <uds/uds.h>
#include <check.h>
#include <stdint.h>
#include <stdio.h>
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);