uds.message.uds_message ======================= .. py:module:: uds.message.uds_message .. autoapi-nested-parse:: Module with common implementation of all diagnostic messages (requests and responses). :ref:`Diagnostic message ` are defined on upper layers of UDS OSI Model. Classes ------- .. autoapisummary:: uds.message.uds_message.AbstractUdsMessageContainer uds.message.uds_message.UdsMessage uds.message.uds_message.UdsMessageRecord Module Contents --------------- .. py:class:: AbstractUdsMessageContainer Bases: :py:obj:`abc.ABC` .. autoapi-inheritance-diagram:: uds.message.uds_message.AbstractUdsMessageContainer :parts: 1 :private-bases: Abstract definition of a container with diagnostic message information. .. py:method:: __str__() Present object in string format. .. py:method:: __eq__(other) :abstractmethod: Compare with other object. :param other: Object to compare. :return: True if other object has the same type and carries the same diagnostic message, otherwise False. .. py:property:: payload :type: Union[bytes, bytearray] :abstractmethod: Raw payload bytes carried by this diagnostic message. .. py:property:: addressing_type :type: uds.addressing.AddressingType :abstractmethod: Addressing for which this diagnostic message is relevant. .. py:class:: UdsMessage(payload, addressing_type) Bases: :py:obj:`AbstractUdsMessageContainer` .. autoapi-inheritance-diagram:: uds.message.uds_message.UdsMessage :parts: 1 :private-bases: Definition of a diagnostic message. Objects of this class act as a storage for all relevant attributes of a :ref:`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 :class:`~uds.message.uds_message.UdsMessageRecord`. Create a storage for a single diagnostic message. :param payload: Raw payload bytes carried by this diagnostic message. :param addressing_type: Addressing for which this diagnostic message is relevant. .. py:property:: payload :type: bytearray Raw payload bytes carried by this diagnostic message. .. py:property:: addressing_type :type: uds.addressing.AddressingType Addressing for which this diagnostic message is relevant. .. py:method:: __eq__(other) Compare with other object. :param other: Object to compare. :raise TypeError: Compared value is not an instance of UdsMessage class. :return: True if other object has the same type and carries the same diagnostic message, otherwise False. .. py:class:: UdsMessageRecord(packets_records) Bases: :py:obj:`AbstractUdsMessageContainer` .. autoapi-inheritance-diagram:: uds.message.uds_message.UdsMessageRecord :parts: 1 :private-bases: Storage for historic information about a diagnostic message that was either received or transmitted. Create a record of historic information about a diagnostic message. :param packets_records: Sequence (in transmission order) of packets records that carried this diagnostic message. .. py:property:: packets_records :type: uds.packet.PacketsRecordsTuple Sequence (in transmission order) of packets records that carried this diagnostic message. :ref:`Packets ` sequence is a complete sequence of packets that was exchanged during this diagnostic message transmission. .. py:method:: __eq__(other) Compare with other object. :param other: Object to compare. :raise TypeError: Compared value is not an instance of UdsMessageRecord class. :return: True if other object has the same type and carries the same diagnostic message, otherwise False. .. py:method:: __str__() Present object in string format. .. py:method:: __validate_packets_records(value) :staticmethod: Validate whether the argument contains records with packets. :param value: Value to validate. :raise TypeError: Provided value is not a sequence. :raise ValueError: At least one of sequence elements is not an object of :class:`~uds.message.uds_packet.AbstractPacketRecord` class. .. py:property:: payload :type: bytes Raw payload bytes carried by this diagnostic message. .. py:property:: addressing_type :type: uds.addressing.AddressingType Addressing which was used to transmit this diagnostic message. .. py:property:: direction :type: uds.addressing.TransmissionDirection Information whether this message was received or sent. .. py:property:: transmission_start_time :type: datetime.datetime Get time when message was initiated. :return: Time when transmission of this message was initiated. .. py:property:: transmission_end_time :type: datetime.datetime Get time when message was sent. :return: Time when transmission of this message was completed. .. py:property:: transmission_start_timestamp :type: float Get timestamp when message was initiated. :return: Timestamp when transmission of this message was initiated. .. py:property:: transmission_end_timestamp :type: float Get timestamp when message was sent. :return: Timestamp when transmission of this message was completed.