uds.packet.abstract_packet
Abstract definition of packets that is common for all bus/network types.
Attributes
Alias for a sequence filled with packet or packet record objects. |
|
Alias for a packet objects tuple. |
|
Alias for a packet record objects tuple. |
|
Alias for a packet record objects sequence. |
Classes
Abstract definition of a container with packet information. |
|
Abstract definition of a packet (Network Protocol Data Unit - N_PDU). |
|
Abstract container for historical information about transmitted or received packets. |
Module Contents
- class uds.packet.abstract_packet.AbstractPacketContainer[source]
Bases:
abc.ABC
Abstract definition of a container with packet information.
- property raw_frame_data: bytes
- Abstractmethod:
- Return type:
Raw data bytes of a frame that carries this packet.
- property packet_type: uds.packet.abstract_packet_type.AbstractPacketType
- Abstractmethod:
- Return type:
Type (N_PCI value) of this packet.
- property data_length: int | None
- Abstractmethod:
- Return type:
int | None
Payload bytes number of a diagnostic message.
- property addressing_type: uds.addressing.AddressingType
- Abstractmethod:
- Return type:
uds.addressing.AddressingType
Addressing for which this packet is relevant.
- class uds.packet.abstract_packet.AbstractPacket[source]
Bases:
AbstractPacketContainer,abc.ABC
Abstract definition of a packet (Network Protocol Data Unit - N_PDU).
- class uds.packet.abstract_packet.AbstractPacketRecord(frame, direction, transmission_time, transmission_timestamp, transmission_native_timestamp)[source]
Bases:
AbstractPacketContainer,abc.ABC
Abstract container for historical information about transmitted or received packets.
Create a record of historic information about a packet.
- Parameters:
frame (Any) – Frame that carried this packet.
direction (uds.addressing.TransmissionDirection) – Information whether this packet was transmitted or received.
transmission_time (datetime.datetime) – Wall-clock time at which the packet was transmitted or received
transmission_timestamp (float) – Monotonic timestamp associated with the packet transmission or reception.
transmission_native_timestamp (float | None) – Timestamp provided by the underlying network manager.
- property frame: Any
Frame that carried this packet.
- Return type:
Any
- property direction: uds.addressing.TransmissionDirection
Information whether this packet was transmitted or received.
- Return type:
uds.addressing.TransmissionDirection
- property transmission_time: datetime.datetime
Get the approximate wall-clock time at which the packet was transmitted or received.
Warning
This value is approximate. The most precise available timestamp is provided by
transmission_native_timestamp.- Return type:
- property transmission_timestamp: float
Get the approximate monotonic timestamp associated with the packet transmission or reception.
This value is obtained from
perf_counter()and is suitable for measuring elapsed time relative to other timestamps obtained from the same clock.Warning
This value is approximate. The most precise available timestamp is provided by
transmission_native_timestamp.- Return type:
- property transmission_native_timestamp: float | None
Get the timestamp provided by the underlying Transport Interface.
Note
This value represents the timestamp natively reported by the network manager (attribute
network_managerin Transport Interface) that transmitted or received the packet.- Return type:
float | None
- uds.packet.abstract_packet.PacketsContainersSequenceAlias
Alias for a sequence filled with packet or packet record objects.
- uds.packet.abstract_packet.PacketsTupleAlias
Alias for a packet objects tuple.
- uds.packet.abstract_packet.PacketsRecordsTupleAlias
Alias for a packet record objects tuple.
- uds.packet.abstract_packet.PacketsRecordsSequenceAlias
Alias for a packet record objects sequence.