File syn_doip.h¶
FileList > proto > syn_doip.h
Go to the source code of this file
SyntropicOS ISO 13400-2 Diagnostic over IP (DoIP) Protocol Stack. More...
#include "syntropic/proto/syn_uds.h"#include "syntropic/syntropic.h"#include <stdbool.h>#include <stddef.h>#include <stdint.h>
Classes¶
| Type | Name |
|---|---|
| struct | SYN_DoIP_Header ISO 13400-2 DoIP Header Structure (8 bytes) |
| struct | SYN_DoIP_Server DoIP Server State Structure. |
Public Functions¶
| Type | Name |
|---|---|
| uint16_t | syn_doip_encode_header (const SYN_DoIP_Header * hdr, uint8_t * buf, uint16_t max_len) Encode 8-byte DoIP Header into target buffer. |
| bool | syn_doip_init (SYN_DoIP_Server * server, uint16_t logical_address) Initialize DoIP Server instance. |
| bool | syn_doip_parse_header (const uint8_t * buf, uint16_t len, SYN_DoIP_Header * hdr) Parse 8-byte DoIP Header from raw buffer. |
| bool | syn_doip_process_msg (SYN_DoIP_Server * server, SYN_UDS_Server * uds, const uint8_t * rx_buf, uint16_t rx_len, uint8_t * tx_buf, uint16_t max_tx_len, uint16_t * tx_len) Process incoming DoIP message (UDP or TCP) and route UDS requests to syn_uds. |
| bool | syn_doip_set_identifiers (SYN_DoIP_Server * server, const uint8_t vin, const uint8_t eid, const uint8_t gid) Set VIN, EID, and GID parameters for vehicle identification responses. |
Macros¶
Detailed Description¶
Implements lightweight, zero-malloc ISO 13400-2 DoIP header serialization, vehicle identification, routing activation, and UDS (ISO 14229-1) message routing over TCP/UDP.
Public Functions Documentation¶
function syn_doip_encode_header¶
Encode 8-byte DoIP Header into target buffer.
Parameters:
hdrInput header structure.bufOutput buffer.max_lenOutput buffer capacity (must be >= 8).
Returns:
Length written (8), or 0 on error.
function syn_doip_init¶
Initialize DoIP Server instance.
Parameters:
serverPointer to DoIP server instance.logical_addressECU logical address (e.g. 0x1001).
Returns:
true on success, false if server is NULL.
function syn_doip_parse_header¶
Parse 8-byte DoIP Header from raw buffer.
Parameters:
bufInput buffer.lenInput buffer length.hdrOutput header structure.
Returns:
true if header is valid, false otherwise.
function syn_doip_process_msg¶
Process incoming DoIP message (UDP or TCP) and route UDS requests to syn_uds.
bool syn_doip_process_msg (
SYN_DoIP_Server * server,
SYN_UDS_Server * uds,
const uint8_t * rx_buf,
uint16_t rx_len,
uint8_t * tx_buf,
uint16_t max_tx_len,
uint16_t * tx_len
)
Parameters:
serverPointer to DoIP server instance.udsPointer to UDS server instance.rx_bufIncoming raw DoIP packet.rx_lenIncoming packet length.tx_bufOutput buffer for DoIP response frame.max_tx_lenMaximum output buffer capacity.tx_lenOutput pointer for written response length.
Returns:
true if message was processed successfully, false on invalid request/null.
function syn_doip_set_identifiers¶
Set VIN, EID, and GID parameters for vehicle identification responses.
bool syn_doip_set_identifiers (
SYN_DoIP_Server * server,
const uint8_t vin,
const uint8_t eid,
const uint8_t gid
)
Parameters:
serverPointer to DoIP server.vin17-byte VIN buffer.eid6-byte EID (MAC) buffer.gid6-byte GID buffer.
Returns:
true on success, false on NULL pointers.
Macro Definition Documentation¶
define SYN_DOIP_DEFAULT_PORT¶
Standard DoIP TCP/UDP port
define SYN_DOIP_HEADER_SIZE¶
Fixed 8-byte DoIP header size
define SYN_DOIP_INVERSE_PROTOCOL_VERSION¶
Bitwise inverse of protocol version
define SYN_DOIP_NACK_INCORRECT_PATTERN¶
ISO 13400-2 Generic NACK Codes Incorrect header pattern
define SYN_DOIP_NACK_INVALID_PAYLOAD_LENGTH¶
Invalid payload length
define SYN_DOIP_NACK_MESSAGE_TOO_LARGE¶
Message payload too large
define SYN_DOIP_NACK_OUT_OF_MEMORY¶
Out of memory
define SYN_DOIP_NACK_UNKNOWN_PAYLOAD_TYPE¶
Unknown payload type
define SYN_DOIP_PROTOCOL_VERSION¶
ISO 13400-2 Protocol Constants ISO 13400-2 protocol version
define SYN_DOIP_ROUTING_DENIED_DIFFERENT_PORT¶
Denied: Invalid socket port
define SYN_DOIP_ROUTING_DENIED_UNKNOWN_TESTER¶
Denied: Unknown tester address
define SYN_DOIP_ROUTING_SUCCESS¶
ISO 13400-2 Routing Activation Response Codes Routing activation successful
define SYN_DOIP_TYPE_ALIVE_CHECK_REQ¶
Alive Check Request
define SYN_DOIP_TYPE_ALIVE_CHECK_RESP¶
Alive Check Response
define SYN_DOIP_TYPE_DIAGNOSTIC_MSG¶
UDS Diagnostic Message
define SYN_DOIP_TYPE_DIAGNOSTIC_MSG_ACK¶
Diagnostic Message Positive Ack
define SYN_DOIP_TYPE_DIAGNOSTIC_MSG_NACK¶
Diagnostic Message Negative Ack
define SYN_DOIP_TYPE_GENERIC_NACK¶
ISO 13400-2 Payload Types Generic NACK payload type
define SYN_DOIP_TYPE_ROUTING_ACTIVATION_REQ¶
Routing Activation Request
define SYN_DOIP_TYPE_ROUTING_ACTIVATION_RESP¶
Routing Activation Response
define SYN_DOIP_TYPE_VEHICLE_ANNOUNCEMENT¶
Vehicle Announcement Message
define SYN_DOIP_TYPE_VEHICLE_ID_REQ¶
Vehicle Identification Request
define SYN_DOIP_TYPE_VEHICLE_ID_REQ_EID¶
Vehicle ID Request with EID
define SYN_DOIP_TYPE_VEHICLE_ID_REQ_VIN¶
Vehicle ID Request with VIN
The documentation for this class was generated from the following file src/syntropic/proto/syn_doip.h