uds.can.packet.can_packet_record

CAN bus specific implementation of packets records.

Attributes

CanFrameAlias

Alias of supported CAN frames objects.

Classes

CanPacketRecord

Definition of a CAN packet record.

Module Contents

uds.can.packet.can_packet_record.CanFrameAlias

Alias of supported CAN frames objects.

class uds.can.packet.can_packet_record.CanPacketRecord(*, frame, addressing_format, addressing_type, direction, transmission_time, transmission_timestamp)[source]

Bases: uds.can.packet.abstract_container.AbstractCanPacketContainer, uds.packet.AbstractPacketRecord

Inheritance diagram of uds.can.packet.can_packet_record.CanPacketRecord

Definition of a CAN packet record.

Objects of this class act as a storage for historic information about transmitted or received CAN packet.

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

Parameters:
  • frame (CanFrameAlias) – Either received or transmitted CAN frame that carried this CAN Packet.

  • addressing_format (uds.can.addressing.CanAddressingFormat) – CAN Addressing Format used.

  • addressing_type (uds.addressing.AddressingType) – Addressing type for which this CAN packet is relevant.

  • direction (uds.addressing.TransmissionDirection) – Information whether this packet was transmitted or received.

  • transmission_time (datetime.datetime) – Time stamp when this packet was fully transmitted on a CAN bus.

  • transmission_timestamp (float)

property addressing_format: uds.can.addressing.CanAddressingFormat

CAN Addressing Format used by this CAN packet record.

Return type:

uds.can.addressing.CanAddressingFormat

property addressing_type: uds.addressing.AddressingType

Addressing type over which this CAN packet was transmitted.

Return type:

uds.addressing.AddressingType

__str__()[source]

Present object in string format.

Return type:

str

property can_id: int

CAN Identifier (CAN ID) of a CAN Frame that carries this CAN packet.

Raises:

NotImplementedError – There is missing implementation for the stored CAN Frame object type.

Return type:

int

property raw_frame_data: bytes

Raw data bytes of a CAN frame that carried this CAN packet.

Raises:

NotImplementedError – There is missing implementation for the stored CAN Frame object type.

Return type:

bytes

static _validate_frame(value)[source]

Validate a CAN frame argument.

Parameters:

value (Any) – Value to validate.

Raises:

TypeError – Provided frame object has unsupported type.

Return type:

None

_validate_attributes()[source]

Validate whether attributes that were set are a valid for a CAN Packet record.

Return type:

None