openxc/uds-c logo

openxc/uds-c

Free

Unified Diagnostics Service (UDS) and OBD-II (On Board Diagnostics for Vehicles) C Library

FreeFree tier
Type
Open Source

About openxc/uds-c

A platform-agnostic C library that implements the Unified Diagnostics Services (UDS) protocol for automotive electronics, documented in ISO 14229. Supports UDS running over CAN (ISO 15765-4) using ISO-TP (ISO 15765-2) for message framing. Uses dependency injection to decouple from the CAN bus interface, requiring users to provide shim functions for sending CAN messages, debugging, and timer handling. Enables sending PID requests to standard OBD-II broadcast addresses and receiving diagnostic responses. The library handles multi-frame CAN message assembly and disassembly, providing a complete request/response lifecycle management.

Key Features

Platform-agnostic C library for UDS and OBD-II diagnostics
Implements UDS protocol per ISO 14229
Supports UDS over CAN using ISO-TP (ISO 15765-2) message framing
Uses dependency injection for CAN bus integration via shim functions
Sends PID requests to standard OBD-II functional broadcast addresses
Handles multi-frame CAN message assembly and disassembly
Provides callback-based response handling for diagnostic requests

Pros & Cons

Pros
  • Open source and free to use
  • Platform-agnostic – runs on any system with a C compiler
  • Dependency injection gives full control over CAN bus interface
  • Well-documented API with examples for sending PID requests
  • Supports industry-standard protocols (ISO 14229, ISO 15765)
Cons
  • Requires users to implement their own CAN bus communication layer
  • Limited to UDS over CAN; does not support other transport protocols out of the box
  • No built-in support for higher-level diagnostic services beyond PID requests (user must extend)
  • Library is low-level and may require significant embedded software expertise

Best For

Automotive diagnostic tool developmentVehicle communication and OBD-II data retrievalEmbedded systems integration for vehicle diagnosticsResearch and development of ECU communication protocols

FAQ

What protocols does this library support?
The library implements the Unified Diagnostics Services (UDS) protocol per ISO 14229 and supports UDS running over CAN (ISO 15765-4) using the ISO-TP (ISO 15765-2) protocol for message framing.
Do I need a specific hardware interface?
No, the library is platform-agnostic and uses dependency injection to allow you to provide your own CAN bus communication shims. It does not assume any particular hardware interface.
Can I use this library for OBD-II diagnostics?
Yes, the library supports sending standard PID requests to OBD-II functional broadcast addresses (e.g., 0x7df) and handles the responses.