Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
SAE J2534-2/17_0500, part of the J2534-2 series, introduces extensions to the familiar J2534-1 Pass-Thru interface to support Diagnostics over IP (DoIP) via UDP and Ethernet. This recommended practice, issued in January 2022, provides a standardized framework for integrating DoIP (ISO 13400) into existing J2534-1 implementations, enabling vehicle diagnostics over IP networks while maintaining backward compatibility. In this article, we delve into the rationale, key API changes, and practical considerations for engineers adopting this standard.
The growing adoption of Ethernet in automotive networks has necessitated standardized diagnostic access over IP. SAE J2534-2/17_0500 fills this gap by extending the existing J2534-1 API (version 05.00) to support UDP as a transport for DoIP. The standard is designed to work alongside J2534-1, with all existing functionality preserved unless explicitly modified. This ensures that legacy J2534-1 applications can continue to operate while new DoIP-capable features are added. The document covers everything from protocol requirements and pin usage to the Win32 API definitions.
The core of the extension lies in the modification and addition of several Win32 API functions to handle UDP and Ethernet channels. The message structure is updated to accommodate IP-specific fields, and the ProtocolID is expanded to include logical IP channels for IPv4 and IPv6. The API functions that see significant change include:
| Function | Description |
|---|---|
PassThruLogicalConnect |
Establishes a logical connection to a DoIP ECU over an IP channel. Returns a device ID for subsequent operations. |
PassThruReadMsgs |
Retrieves received DoIP messages from the queue. Handles buffer overflow conditions and returns appropriate error codes. |
PassThruQueueMsgs |
Queues messages for transmission over the IP socket. Equivalent to PassThruWriteMsgs in J2534-1. |
PassThruIoctl |
Provides IOCTL commands for socket state management, buffer control, and discovery (e.g., CLEAR_RX_QUEUE, GET_SOCKET_STATE). |
Additionally, the RxStatus bit definitions have been extended to cover IP-specific events, and a new IOCTL GET_DATALENGTH_IN_FIRST_PTMSG provides the data length of the first message in the receive queue. Proper implementation requires careful attention to the format checks and conventions for passing messages to and from the API.
ERR_BUFFER_OVERFLOW return status appropriately, either by re-reading messages or by increasing buffer capacity. This design prevents data loss during periods of high network traffic.
Another critical aspect is the integration of the discovery mechanism. The standard mandates that the API support GET_PROTOCOL_INFO and GET_RESOURCE_INFO IOCTL calls, allowing client applications to enumerate available IP channels and their capabilities. Failing to implement these correctly can lead to interoperability issues.
GET_SOCKET_STATE must be supported to allow applications to verify the connection status before initiating communication. Developers should also ensure that the IP configuration (e.g., port numbers, addressing) aligns with the DoIP protocol requirements.
Network errors are mapped to specific return codes (e.g., ERR_NETWORK for general network failures), enabling consistent error handling across different Pass-Thru implementations. The standard also clarifies that device disconnection events are reported as ERR_DEVICE_NOT_CONNECTED, which should be handled gracefully.
This extension adds UDP and Ethernet transport support while maintaining backward compatibility with J2534-1. New API functions and IOCTL commands are introduced specifically for IP-based channels, and existing functions like PassThruReadMsgs and PassThruQueueMsgs are modified to handle IP-specific message structures.
Common error conditions include receive buffer overflow (ERR_BUFFER_OVERFLOW), device disconnection (ERR_DEVICE_NOT_CONNECTED), and network errors (ERR_NETWORK). The standard provides detailed guidance on handling each condition, including buffer management and reconnection strategies.
SAE J2534-2/17_0500 is a recommended practice, meaning compliance is voluntary. However, for systems that claim to support the UDP feature, all required functionality must be implemented as specified. Optional features are clearly marked in the document.
Since the extension is fully backward compatible, existing J2534-1 applications should continue to work unchanged. To leverage DoIP capabilities, the application needs to be updated to handle the new logical channels (IPV4_LOGICAL and IPV6_LOGICAL) and the corresponding API functions. The standard provides a code example in Appendix A to assist with integration.
🛠️🔍 For more details, refer to the full SAE J2534-2/17_0500 document available from SAE International.