uds.transport_interface.abstract_transport_interface

Abstract definition of UDS Transport Interface.

Classes

AbstractTransportInterface

Abstract definition of Transport Interface.

Module Contents

class uds.transport_interface.abstract_transport_interface.AbstractTransportInterface(network_manager)[source]

Bases: abc.ABC

Inheritance diagram of uds.transport_interface.abstract_transport_interface.AbstractTransportInterface

Abstract definition of Transport Interface.

Transport Interfaces are meant to handle middle layers (Transport and Network) of UDS OSI Model.

Create Transport Interface (an object for handling UDS Transport and Network layers).

Parameters:

network_manager (Any) – An object that handles the network (Physical and Data layers of OSI Model).

property network_manager: Any

Get network manager used by this Transport Interface.

Network manager handles Physical and Data layers (OSI Model) of the bus/network.

Return type:

Any

__time_sync: uds.utilities.TimeSync
property time_sync: uds.utilities.TimeSync

Get time and timestamp synchronizer.

Return type:

uds.utilities.TimeSync

property segmenter: uds.segmentation.AbstractSegmenter
Abstractmethod:

Return type:

uds.segmentation.AbstractSegmenter

Value of the segmenter used by this Transport Interface.

Warning

Do not change any segmenter attributes during the communication as it might introduce faults to Transport Interface.

property addressing_information: uds.addressing.AbstractAddressingInformation

Get Addressing Information of UDS Entity simulated by this Transport Interface.

Return type:

uds.addressing.AbstractAddressingInformation

static is_supported_network_manager(bus_manager)[source]
Abstractmethod:

Parameters:

bus_manager (Any)

Return type:

bool

Check whether provided value is a bus/network manager that is supported by this Transport Interface.

Parameters:

bus_manager (Any) – Value to check.

Returns:

True if provided object is compatible with this Transport Interface, False otherwise.

Return type:

bool

abstractmethod send_packet(packet)[source]

Transmit packet.

Parameters:

packet (uds.packet.AbstractPacket) – A packet to send.

Returns:

Record with historic information about transmitted packet.

Return type:

uds.packet.AbstractPacketRecord

abstractmethod async_send_packet(packet, loop=None)[source]
Async:

Parameters:
Return type:

uds.packet.AbstractPacketRecord

Transmit packet asynchronously.

Parameters:
  • packet (uds.packet.AbstractPacket) – A packet to send.

  • loop (Optional[asyncio.AbstractEventLoop]) – An asyncio event loop to use for scheduling this task.

Returns:

Record with historic information about transmitted packet.

Return type:

uds.packet.AbstractPacketRecord

abstractmethod receive_packet(timeout=None)[source]

Receive packet.

Parameters:

timeout (Optional[uds.utilities.TimeMillisecondsAlias]) – Maximal time (in milliseconds) to wait. Leave None to wait forever.

Raises:

TimeoutError – Timeout was reached.

Returns:

Record with historic information about received packet.

Return type:

uds.packet.AbstractPacketRecord

abstractmethod async_receive_packet(timeout=None, loop=None)[source]
Async:

Parameters:
Return type:

uds.packet.AbstractPacketRecord

Receive packet asynchronously.

Parameters:
  • timeout (Optional[uds.utilities.TimeMillisecondsAlias]) – Maximal time (in milliseconds) to wait. Leave None to wait forever.

  • loop (Optional[asyncio.AbstractEventLoop]) – An asyncio event loop to use for scheduling this task.

Raises:
Returns:

Record with historic information about received packet.

Return type:

uds.packet.AbstractPacketRecord

abstractmethod send_message(message)[source]

Transmit UDS message.

Parameters:

message (uds.message.UdsMessage) – A message to send.

Returns:

Record with historic information about transmitted UDS message.

Return type:

uds.message.UdsMessageRecord

abstractmethod async_send_message(message, loop=None)[source]
Async:

Parameters:
Return type:

uds.message.UdsMessageRecord

Transmit asynchronously UDS message.

Parameters:
  • message (uds.message.UdsMessage) – A message to send.

  • loop (Optional[asyncio.AbstractEventLoop]) – An asyncio event loop to use for scheduling this task.

Returns:

Record with historic information about transmitted UDS message.

Return type:

uds.message.UdsMessageRecord

abstractmethod receive_message(start_timeout=None, end_timeout=None)[source]

Receive UDS message.

Warning

Value of end_timeout must not be less than the value of start_timeout.

Parameters:
  • start_timeout (Optional[uds.utilities.TimeMillisecondsAlias]) – Maximal time (in milliseconds) to wait for the start of a message transmission. Leave None to wait forever.

  • end_timeout (Optional[uds.utilities.TimeMillisecondsAlias]) – Maximal time (in milliseconds) to wait for a message transmission to finish. Leave None to wait forever.

Raises:
Returns:

Record with historic information about received UDS message.

Return type:

uds.message.UdsMessageRecord

abstractmethod async_receive_message(start_timeout=None, end_timeout=None, loop=None)[source]
Async:

Parameters:
  • start_timeout (Optional[uds.utilities.TimeMillisecondsAlias])

  • end_timeout (Optional[uds.utilities.TimeMillisecondsAlias])

  • loop (Optional[asyncio.AbstractEventLoop])

Return type:

uds.message.UdsMessageRecord

Receive asynchronously UDS message.

Warning

Value of end_timeout must not be less than the value of start_timeout.

Parameters:
  • start_timeout (Optional[uds.utilities.TimeMillisecondsAlias]) – Maximal time (in milliseconds) to wait for the start of a message transmission. Leave None to wait forever.

  • end_timeout (Optional[uds.utilities.TimeMillisecondsAlias]) – Maximal time (in milliseconds) to wait for a message transmission to finish. Leave None to wait forever.

  • loop (Optional[asyncio.AbstractEventLoop]) – An asyncio event loop to use for scheduling this task.

Raises:
Returns:

Record with historic information about received UDS message.

Return type:

uds.message.UdsMessageRecord