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.

Module Contents

Classes

UdsMessage

Definition of a diagnostic message.

UdsMessageRecord

Storage for historic information about a diagnostic message that was either received or transmitted.

class uds.message.uds_message.UdsMessage(payload, addressing_type)[source]

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.RawBytes) – Raw bytes of payload that this diagnostic message carries.

  • addressing_type (uds.transmission_attributes.AddressingTypeAlias) – Addressing type for which this message is relevant.

__eq__(self, other)[source]

Compare with other diagnostic message.

Parameters

other (object) – Diagnostic message to compare.

Returns

True if both messages carry the same Payload and uses the same Addressing Type, otherwise False.

Return type

bool

property payload(self)

Raw bytes of payload that this diagnostic message carries.

Return type

uds.utilities.RawBytesTuple

property addressing_type(self)

Addressing type for which this message is relevant.

Return type

uds.transmission_attributes.AddressingTypeAlias

class uds.message.uds_message.UdsMessageRecord(packets_records)[source]

Storage for historic information about a diagnostic message that was either received or transmitted.

Create a record of a historic information about a diagnostic message that was either received or transmitted.

Parameters

packets_records (uds.packet.PacketsRecordsSequence) – Sequence (in transmission order) of UDS packets records that carried this diagnostic message.

__eq__(self, other)[source]

Compare with other diagnostic message record.

Parameters

other (object) – Diagnostic message record to compare.

Returns

True if both messages records carry the same Payload and uses the same Addressing Type and Direction, otherwise False.

Return type

bool

static __validate_packets_records(value)

Validate whether the argument contains UDS Packets records.

Parameters

value (Any) – Value to validate.

Raises
  • TypeError – UDS Packet Records sequence is not list or tuple type.

  • ValueError – At least one of UDS Packet Records sequence elements is not an object of AbstractUdsPacketRecord class.

Return type

None

property packets_records(self)

Sequence (in transmission order) of UDS packets records that carried this diagnostic message.

UDS packets sequence is a complete sequence of packets that was exchanged during this diagnostic message transmission.

Return type

uds.packet.PacketsRecordsTuple

property payload(self)

Raw bytes of payload that this diagnostic message carried.

Return type

uds.utilities.RawBytesTuple

property addressing_type(self)

Addressing type which was used to transmit this message.

Return type

uds.transmission_attributes.AddressingTypeAlias

property direction(self)

Information whether this message was received or sent by the code.

Return type

uds.transmission_attributes.TransmissionDirectionAlias

property transmission_start(self)

Time stamp when transmission of this message was initiated.

It is determined by a moment of time when the first packet (that carried this message) was published to a bus (either received or transmitted).

Returns

Time stamp when transmission of this message was initiated.

Return type

uds.utilities.TimeStamp

property transmission_end(self)

Time stamp when transmission of this message was completed.

It is determined by a moment of time when the last packet (that carried this message) was published to a bus (either received or transmitted).

Returns

Time stamp when transmission of this message was completed.

Return type

uds.utilities.TimeStamp