uds.packet.abstract_packet

Abstract definition of UDS packets that is common for all bus types.

Module Contents

Classes

AbstractUdsPacketContainer

Abstract definition of a container with UDS Packet information.

AbstractUdsPacket

Abstract definition of UDS Packet (Network Protocol Data Unit - N_PDU).

AbstractUdsPacketRecord

Abstract definition of a storage for historic information about transmitted or received UDS Packet.

Attributes

PacketsContainersSequence

Alias for a sequence filled with packet or packet record object.

PacketsTuple

Alias for a packet objects tuple.

PacketsRecordsTuple

Alias for a packet record objects tuple.

PacketsRecordsSequence

Alias for a packet record objects sequence.

class uds.packet.abstract_packet.AbstractUdsPacketContainer[source]

Bases: abc.ABC

Inheritance diagram of uds.packet.abstract_packet.AbstractUdsPacketContainer

Abstract definition of a container with UDS Packet information.

abstract property raw_frame_data: uds.utilities.RawBytesTupleAlias

Raw data bytes of a frame that carries this packet.

Return type:

uds.utilities.RawBytesTupleAlias

abstract property addressing_type: uds.transmission_attributes.addressing.AddressingType

Addressing for which this packet is relevant.

Return type:

uds.transmission_attributes.addressing.AddressingType

abstract property packet_type: uds.packet.abstract_packet_type.AbstractUdsPacketType

Type (N_PCI value) of this UDS packet.

Return type:

uds.packet.abstract_packet_type.AbstractUdsPacketType

abstract property data_length: int | None

Payload bytes number of a diagnostic message which was carried by this packet.

Return type:

Optional[int]

abstract property payload: uds.utilities.RawBytesTupleAlias | None

Raw payload bytes of a diagnostic message that are carried by this packet.

Return type:

Optional[uds.utilities.RawBytesTupleAlias]

class uds.packet.abstract_packet.AbstractUdsPacket[source]

Bases: AbstractUdsPacketContainer

Inheritance diagram of uds.packet.abstract_packet.AbstractUdsPacket

Abstract definition of UDS Packet (Network Protocol Data Unit - N_PDU).

abstract property raw_frame_data: uds.utilities.RawBytesTupleAlias

Raw data bytes of a frame that carries this packet.

Return type:

uds.utilities.RawBytesTupleAlias

abstract property addressing_type: uds.transmission_attributes.addressing.AddressingType

Addressing for which this packet is relevant.

Return type:

uds.transmission_attributes.addressing.AddressingType

abstract property packet_type: uds.packet.abstract_packet_type.AbstractUdsPacketType

Type (N_PCI value) of this UDS packet.

Return type:

uds.packet.abstract_packet_type.AbstractUdsPacketType

abstract property data_length: int | None

Payload bytes number of a diagnostic message which was carried by this packet.

Return type:

Optional[int]

abstract property payload: uds.utilities.RawBytesTupleAlias | None

Raw payload bytes of a diagnostic message that are carried by this packet.

Return type:

Optional[uds.utilities.RawBytesTupleAlias]

class uds.packet.abstract_packet.AbstractUdsPacketRecord(frame, direction, transmission_time)[source]

Bases: AbstractUdsPacketContainer

Inheritance diagram of uds.packet.abstract_packet.AbstractUdsPacketRecord

Abstract definition of a storage for historic information about transmitted or received UDS Packet.

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

Parameters:
property frame: Any

Frame that carried this packet.

Return type:

Any

property direction: uds.transmission_attributes.transmission_direction.TransmissionDirection

Information whether this packet was transmitted or received.

Return type:

uds.transmission_attributes.transmission_direction.TransmissionDirection

property transmission_time: datetime.datetime

Time when this packet was fully transmitted on a bus.

Return type:

datetime.datetime

abstract property raw_frame_data: uds.utilities.RawBytesTupleAlias

Raw data bytes of a frame that carries this packet.

Return type:

uds.utilities.RawBytesTupleAlias

abstract property addressing_type: uds.transmission_attributes.addressing.AddressingType

Addressing for which this packet is relevant.

Return type:

uds.transmission_attributes.addressing.AddressingType

abstract property packet_type: uds.packet.abstract_packet_type.AbstractUdsPacketType

Type (N_PCI value) of this UDS packet.

Return type:

uds.packet.abstract_packet_type.AbstractUdsPacketType

abstract property data_length: int | None

Payload bytes number of a diagnostic message which was carried by this packet.

Return type:

Optional[int]

abstract property payload: uds.utilities.RawBytesTupleAlias | None

Raw payload bytes of a diagnostic message that are carried by this packet.

Return type:

Optional[uds.utilities.RawBytesTupleAlias]

abstract static _validate_frame(value)[source]

Validate a frame argument.

Parameters:

value (Any) – Value to validate.

Raises:
  • TypeError – The frame argument has unsupported.

  • ValueError – Some attribute of the frame argument is missing or its value is unexpected.

Return type:

None

uds.packet.abstract_packet.PacketsContainersSequence

Alias for a sequence filled with packet or packet record object.

uds.packet.abstract_packet.PacketsTuple

Alias for a packet objects tuple.

uds.packet.abstract_packet.PacketsRecordsTuple

Alias for a packet record objects tuple.

uds.packet.abstract_packet.PacketsRecordsSequence

Alias for a packet record objects sequence.