uds.message.uds_message
Module with common implementation of all diagnostic messages (requests and responses).
Diagnostic message are defined on upper layers of UDS OSI Model.
Attributes
Payload length of Negative Response Message. |
Classes
Abstract definition of a container with diagnostic message information. |
|
Definition of a diagnostic message. |
|
Storage for historic information about a diagnostic message that was either received or transmitted. |
Module Contents
- uds.message.uds_message.NEGATIVE_RESPONSE_MESSAGE_LENGTH: int = 3
Payload length of Negative Response Message.
- class uds.message.uds_message.AbstractUdsMessageContainer[source]
Bases:
abc.ABC
Abstract definition of a container with diagnostic message information.
- property addressing_type: uds.addressing.AddressingType
- Abstractmethod:
- Return type:
uds.addressing.AddressingType
Addressing for which this diagnostic message is relevant.
- class uds.message.uds_message.UdsMessage(payload, addressing_type)[source]
Bases:
AbstractUdsMessageContainer
Definition of a diagnostic message.
Objects of this class act as a storage for all relevant attributes of a diagnostic message. Later on, such object might be used in a segmentation process or to transmit the message. Once a message is transmitted, its historic data would be stored in
UdsMessageRecord.Create a storage for a single diagnostic message.
- Parameters:
payload (uds.utilities.RawBytesAlias) – Raw payload bytes carried by this diagnostic message.
addressing_type (uds.addressing.AddressingType) – Addressing for which this diagnostic message is relevant.
- property addressing_type: uds.addressing.AddressingType
Addressing for which this diagnostic message is relevant.
- Return type:
uds.addressing.AddressingType
- class uds.message.uds_message.UdsMessageRecord(packets_records)[source]
Bases:
AbstractUdsMessageContainer
Storage for historic information about a diagnostic message that was either received or transmitted.
Create a record of historic information about a diagnostic message.
- Parameters:
packets_records (uds.packet.PacketsRecordsSequence) – Sequence (in transmission order) of packets records that carried this diagnostic message.
- property packets_records: uds.packet.PacketsRecordsTuple
Sequence (in transmission order) of packets records that carried this diagnostic message.
Packets sequence is a complete sequence of packets that was exchanged during this diagnostic message transmission.
- Return type:
uds.packet.PacketsRecordsTuple
- static __validate_packets_records(value)
Validate whether the argument contains records with packets.
- Parameters:
value (uds.packet.PacketsRecordsSequence) – Value to validate.
- Raises:
TypeError – Provided value is not a sequence.
ValueError – At least one of sequence elements is not an object of
AbstractPacketRecordclass.
- Return type:
None
- property addressing_type: uds.addressing.AddressingType
Addressing which was used to transmit this diagnostic message.
- Return type:
uds.addressing.AddressingType
- property direction: uds.addressing.TransmissionDirection
Information whether this message was received or sent.
- Return type:
uds.addressing.TransmissionDirection
- property transmission_start_time: datetime.datetime
Get time when message was initiated.
- Returns:
Time when transmission of this message was initiated.
- Return type:
- property transmission_end_time: datetime.datetime
Get time when message was sent.
- Returns:
Time when transmission of this message was completed.
- Return type: