uds.packet.can_packet_record

CAN bus specific implementation of UDS packets records.

Module Contents

Classes

CanPacketRecord

Definition of a CAN packet Record.

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

Bases: uds.packet.abstract_packet.AbstractUdsPacketRecord

Inheritance diagram of uds.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 a 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.

  • direction (uds.transmission_attributes.TransmissionDirectionAlias) – Information whether this packet was transmitted or received.

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

  • addressing_format (uds.can.CanAddressingFormatAlias) – CAN addressing format that this CAN packet used.

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

property raw_frame_data(self)

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

Return type

uds.utilities.RawBytesTuple

property addressing_type(self)

Addressing type over which this CAN packet was transmitted.

Return type

uds.transmission_attributes.AddressingTypeAlias

property addressing_format(self)

CAN addressing format used by this CAN packet.

Return type

uds.can.CanAddressingFormatAlias

property packet_type(self)

CAN packet type value - N_PCI value of this N_PDU.

Return type

uds.packet.can_packet_type.CanPacketTypeAlias

property payload(self)

Payload bytes of a diagnostic message carried by this CAN packet.

Return type

Optional[uds.utilities.RawBytesTuple]

property data_length(self)

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

Return type

Optional[int]

property can_id(self)

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

Return type

int

property dlc(self)

Value of Data Length Code (DLC) of a CAN Frame that carries this CAN packet.

Return type

int

property target_address(self)

Target Address (TA) value of this CAN Packet.

Target Address value is used with following addressing formats:

None in other cases.

Return type

Optional[uds.utilities.RawByte]

property source_address(self)

Source Address (SA) value of this CAN Packet.

Source Address value is used with following addressing formats:

None in other cases.

Return type

Optional[uds.utilities.RawByte]

property address_extension(self)

Address Extension (AE) value of this CAN Packet.

Address Extension is used with following addressing formats:

None in other cases.

Return type

Optional[uds.utilities.RawByte]

property sequence_number(self)

Sequence Number carried by this CAN packet.

Sequence Number is only provided by packets of following types:

None in other cases.

Return type

Optional[int]

property flow_status(self)

Flow Status carried by this CAN packet.

Flow Status is only provided by packets of following types:

None in other cases.

Return type

Optional[uds.can.CanFlowStatusAlias]

property block_size(self)

Block Size value carried by this CAN packet.

Block Size is only provided by packets of following types:

None in other cases.

Return type

Optional[uds.utilities.RawByte]

property st_min(self)

Separation Time minimum (STmin) value carried by this CAN packet.

STmin is only provided by packets of following types:

None in other cases.

Return type

Optional[uds.utilities.RawByte]

static _validate_frame(value)[source]

Validate a CAN 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

__assess_packet_type(self)

Assess and set value of Packet Type attribute.

Return type

None

__assess_ai_attributes(self)

Assess and set values of attributes with Addressing Information.

Raises

InconsistentArgumentsError – Value of Addressing Type that is already set does not match decoded one.

Return type

None