Expand description
§Unified Diagnostics Services (UDS) Protocol
This crate aims to offer an ergonomic implementation of the UDS protocol in Rust. It suppports both serialization and deserialization of UDS both protocol messages as well as custom data types. It is not in a complete state yet with the 0.1.0 release, please check back soon!
This library provides serialization and deserialization of UDS messages. It is based on the ISO 14229-1:2020 standard.
Service Name | Request SID | Response SID | Support |
---|---|---|---|
DiagnosticSessionControl | 0x10 | 0x50 | ✓ |
ECUReset | 0x11 | 0x51 | ✓ |
ClearDiagnosticInformation | 0x14 | 0x54 | ✓ |
ReadDTCInformation | 0x19 | 0x59 | Partial |
ReadDataByIdentifier | 0x22 | 0x62 | ✓ |
ReadMemoryByAddress | 0x23 | 0x63 | |
ReadScalingDataByIdentifier | 0x24 | 0x64 | |
SecurityAccess | 0x27 | 0x67 | ✓ |
CommunicationControl | 0x28 | 0x68 | ✓ |
Authentication | 0x29 | 0x69 | |
ReadDataByPeriodicIdentifier | 0x2A | 0x6A | |
WriteDataByIdentifier | 0x2E | 0x6E | ✓ |
InputOutputControlByIdentifier | 0x2F | 0x6F | |
RoutineControl | 0x31 | 0x71 | ✓ |
RequestDownload | 0x34 | 0x74 | ✓ |
RequestUpload | 0x35 | 0x75 | |
TransferData | 0x36 | 0x76 | ✓ |
RequestTransferExit | 0x37 | 0x77 | ✓ |
RequestFileTransfer | 0x38 | 0x78 | ✓ |
WriteMemoryByAddress | 0x3D | 0x7D | |
TesterPresent | 0x3E | 0x7E | ✓ |
SecuredDataTransmission | 0x84 | 0xC4 | |
ControlDTCSetting | 0x85 | 0xC5 | ✓ |
ResponseOnEvent | 0x86 | 0xC6 | |
LinkControl | 0x87 | 0xC7 |
Macros§
Structs§
- Active
Diagnostic Session - Represents the active diagnostic session of the lidar module.
- BCD4
ByteLE - Clear
Diagnostic Info Request - Communication
Control Request - Request for the server to change communication behavior
- Communication
Control Response - Positive response from the server to change communication behavior
- ControlDTC
Settings Request - The
ControlDTCSettings
service is used to control the DTC settings of the ECU. - ControlDTC
Settings Response - Positive response to a
ControlDTCSettingsRequest
- DTCExt
Data Record - DTCExt
Data Record List - DTCRecord
- DTCSeverity
Mask - GTR DTC Class Information
- DTCSeverity
Record - Represents a record containing information about the severity of a Diagnostic Trouble Code (DTC).
- DTCSnapshot
Record - Contains a snapshot of data values from the time of the system malfunction occurrence.
- DTCSnapshot
Record List - DTCStatus
Mask - Bit-packed DTC status information used by the
ReadDTCInformation
service - DTCStored
Data Record Number - Indicates the number of the specific
DTCSnapshot
data record requested Setting to 0xFF will return allDTCStoredDataRecords
at once - Diagnostic
Session Control Request - Request for the server to change diagnostic session type
- Diagnostic
Session Control Response - Positive response to a
DiagnosticSessionControlRequest
- EcuReset
Request - Request for the server to reset the ECU
- EcuReset
Response - Negative
Response - Protocol
Identifier - Protocol Identifier provides an implementation of Diagnostics Identifiers that only supports Diagnostic Identifiers defined by UDS
- Protocol
Payload - The UDS protocol does not define the structure of any payload, so this struct will always return an error when attempting to read from a reader It cannot be constructed, and therefore the write method is unreachable
- ReadDTC
Info Request - Read
Data ByIdentifier Request - See ISO-14229-1:2020, Table 11.2.1 for format information
- Read
Data ByIdentifier Response - See ISO-14229-1:2020, Table 11.2.3 for format information
- Request
Download Request - A request to the server for it to download data from the client
- Request
Download Response - Routine
Control Request - Used by a client to execute a defined sequence of events and obtain any relevant results
- Routine
Control Response RoutineControlResponse
is a variable length field that can contain the status of the routine- Security
Access Request - Client request to access a security level
- Security
Access Response - Response to
SecurityAccessRequest
- Tester
Present Request - Tester
Present Response - Transfer
Data Request - A request to the server to transfer data (either upload or download)
- Transfer
Data Response - UdsResponse
- UdsSpec
- Basic UDS implementation of the
DiagnosticDefinition
trait. - Write
Data ByIdentifier Request - See ISO-14229-1:2020, Section 11.7.2.1
- Write
Data ByIdentifier Response - See ISO-14229-1:2020, Section 11.7.3.1
Enums§
- Communication
Control Type CommunicationControlType
is used to specify the type of communication behavior to be modified- Communication
Type CommunicationType
is used to specify the type of communication behavior to be modified.- DTCExt
Data Record Number - The
DTCExtDataRecordNumber
is used in the request message to get a storedDTCExtDataRecord
Its used to specify the type ofDTCExtDataRecord
to be reported. - DTCFormat
Identifier - Specifies the format of the DTC reported by the server.
- DTCSnapshot
Record Number - Diagnostic
Session Type DiagnosticSessionType
is used to specify or describe the session type of the server- DtcSettings
- Error
- File
Operation Mode - Functional
Group Identifier - Used to distinguish commands sent by the test equipment between different functional system groups within an electrical architecture which consists of many different servers.
- Negative
Response Code NegativeResponseCode
is a shared error mechanism- ReadDTC
Info Response - Response payloads can be shared among multiple request subfunctions
- ReadDTC
Info SubFunction - Subfunctions for the
ReadDTCInformation
service - Request
- UDS Request types Each variant corresponds to a request for a different UDS service The variants contain all request data for each service
- Request
File Transfer Request - A request to the server to transfer a file, either upload or download.
- Request
File Transfer Response - Response to a
RequestFileTransferRequest
from the server - Reset
Type - UDS defines a number of different types of resets that can be requested The reset type is used to specify the type of reset that the ECU should perform
- Response
- Routine
Control SubFunction - What type of routine control to perform for a
RoutineControlRequest
. - Security
Access Type - Security Access Type allows for multiple different security challenges within an ECU.
- UDSIdentifier
- C.1 DID - Diagnostic Data Identifier specified in ISO 14229-1
- UDSRoutine
Identifier - Standard UDS Routine Identifier for the
RoutineControl
(0x31, 0x71) service - UdsService
Type
Constants§
- CLEAR_
ALL_ DTCS - Use to clear all DTCs in a
crate::ClearDiagnosticInfoRequest
- PENDING
- SUCCESS
Traits§
- Diagnostic
Definition - A trait that defines the user-defined diagnostic definitions/specifiers for UDS requests and responses.
- Identifier
- Trait for types that can be used as identifiers (ie Data Identifiers and Routine Identifiers)
- Iterable
Wire Format - Routine
Identifier - Single
Value Wire Format - Wire
Format - A trait for types that can be deserialized from a
Reader
and serialized to aWriter
.
Functions§
Type Aliases§
- Protocol
Request - Type alias for a UDS Request type that only implements the messages explicitly defined by the UDS specification.
- Protocol
Response - Type alias for a UDS Response type that only implements the messages explicitly defined by the UDS specification.
- User
DefDTC Snapshot Record Number - This might be a duplicate of the non-user defined DTC snapshot data
Indicates the number of the specific
DTCSnapshot
data record requested
Derive Macros§
- Identifier
- Derive Identifier and implement
TryFrom<u16>
,Into<u16>
traits