Crate uds_protocol

Crate uds_protocol 

Source
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!

Crates.io Docs.rs MIT License APACHE License

This library provides serialization and deserialization of UDS messages. It is based on the ISO 14229-1:2020 standard.

Service NameRequest SIDResponse SIDSupport
DiagnosticSessionControl0x100x50
ECUReset0x110x51
ClearDiagnosticInformation0x140x54
ReadDTCInformation0x190x59Partial
ReadDataByIdentifier0x220x62
ReadMemoryByAddress0x230x63
ReadScalingDataByIdentifier0x240x64
SecurityAccess0x270x67
CommunicationControl0x280x68
Authentication0x290x69
ReadDataByPeriodicIdentifier0x2A0x6A
WriteDataByIdentifier0x2E0x6E
InputOutputControlByIdentifier0x2F0x6F
RoutineControl0x310x71
RequestDownload0x340x74
RequestUpload0x350x75
TransferData0x360x76
RequestTransferExit0x370x77
RequestFileTransfer0x380x78
WriteMemoryByAddress0x3D0x7D
TesterPresent0x3E0x7E
SecuredDataTransmission0x840xC4
ControlDTCSetting0x850xC5
ResponseOnEvent0x860xC6
LinkControl0x870xC7

Macros§

signed_primitive_wire_format
unsigned_primitive_wire_format

Structs§

ActiveDiagnosticSession
Represents the active diagnostic session of the lidar module.
BCD4ByteLE
ClearDiagnosticInfoRequest
CommunicationControlRequest
Request for the server to change communication behavior
CommunicationControlResponse
Positive response from the server to change communication behavior
ControlDTCSettingsRequest
The ControlDTCSettings service is used to control the DTC settings of the ECU.
ControlDTCSettingsResponse
Positive response to a ControlDTCSettingsRequest
DTCExtDataRecord
DTCExtDataRecordList
DTCRecord
DTCSeverityMask
GTR DTC Class Information
DTCSeverityRecord
Represents a record containing information about the severity of a Diagnostic Trouble Code (DTC).
DTCSnapshotRecord
Contains a snapshot of data values from the time of the system malfunction occurrence.
DTCSnapshotRecordList
DTCStatusMask
Bit-packed DTC status information used by the ReadDTCInformation service
DTCStoredDataRecordNumber
Indicates the number of the specific DTCSnapshot data record requested Setting to 0xFF will return all DTCStoredDataRecords at once
DiagnosticSessionControlRequest
Request for the server to change diagnostic session type
DiagnosticSessionControlResponse
Positive response to a DiagnosticSessionControlRequest
EcuResetRequest
Request for the server to reset the ECU
EcuResetResponse
NegativeResponse
ProtocolIdentifier
Protocol Identifier provides an implementation of Diagnostics Identifiers that only supports Diagnostic Identifiers defined by UDS
ProtocolPayload
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
ReadDTCInfoRequest
ReadDataByIdentifierRequest
See ISO-14229-1:2020, Table 11.2.1 for format information
ReadDataByIdentifierResponse
See ISO-14229-1:2020, Table 11.2.3 for format information
RequestDownloadRequest
A request to the server for it to download data from the client
RequestDownloadResponse
RoutineControlRequest
Used by a client to execute a defined sequence of events and obtain any relevant results
RoutineControlResponse
RoutineControlResponse is a variable length field that can contain the status of the routine
SecurityAccessRequest
Client request to access a security level
SecurityAccessResponse
Response to SecurityAccessRequest
TesterPresentRequest
TesterPresentResponse
TransferDataRequest
A request to the server to transfer data (either upload or download)
TransferDataResponse
UdsResponse
UdsSpec
Basic UDS implementation of the DiagnosticDefinition trait.
WriteDataByIdentifierRequest
See ISO-14229-1:2020, Section 11.7.2.1
WriteDataByIdentifierResponse
See ISO-14229-1:2020, Section 11.7.3.1

Enums§

CommunicationControlType
CommunicationControlType is used to specify the type of communication behavior to be modified
CommunicationType
CommunicationType is used to specify the type of communication behavior to be modified.
DTCExtDataRecordNumber
The DTCExtDataRecordNumber is used in the request message to get a stored DTCExtDataRecord Its used to specify the type of DTCExtDataRecord to be reported.
DTCFormatIdentifier
Specifies the format of the DTC reported by the server.
DTCSnapshotRecordNumber
DiagnosticSessionType
DiagnosticSessionType is used to specify or describe the session type of the server
DtcSettings
Error
FileOperationMode
FunctionalGroupIdentifier
Used to distinguish commands sent by the test equipment between different functional system groups within an electrical architecture which consists of many different servers.
NegativeResponseCode
NegativeResponseCode is a shared error mechanism
ReadDTCInfoResponse
Response payloads can be shared among multiple request subfunctions
ReadDTCInfoSubFunction
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
RequestFileTransferRequest
A request to the server to transfer a file, either upload or download.
RequestFileTransferResponse
Response to a RequestFileTransferRequest from the server
ResetType
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
RoutineControlSubFunction
What type of routine control to perform for a RoutineControlRequest.
SecurityAccessType
Security Access Type allows for multiple different security challenges within an ECU.
UDSIdentifier
C.1 DID - Diagnostic Data Identifier specified in ISO 14229-1
UDSRoutineIdentifier
Standard UDS Routine Identifier for the RoutineControl (0x31, 0x71) service
UdsServiceType

Constants§

CLEAR_ALL_DTCS
Use to clear all DTCs in a crate::ClearDiagnosticInfoRequest
PENDING
SUCCESS

Traits§

DiagnosticDefinition
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)
IterableWireFormat
RoutineIdentifier
SingleValueWireFormat
WireFormat
A trait for types that can be deserialized from a Reader and serialized to a Writer.

Functions§

param_length_u16
param_length_u32
param_length_u64
param_length_u128

Type Aliases§

ProtocolRequest
Type alias for a UDS Request type that only implements the messages explicitly defined by the UDS specification.
ProtocolResponse
Type alias for a UDS Response type that only implements the messages explicitly defined by the UDS specification.
UserDefDTCSnapshotRecordNumber
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