uds.transport_interface.abstract_transport_interface

Abstract definition of UDS Transport Interface.

Module Contents

Classes

AbstractTransportInterface

Abstract definition of Transport Interface.

class uds.transport_interface.abstract_transport_interface.AbstractTransportInterface(bus_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:

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

Raises:

ValueError – Provided value of bus manager is not supported by this Transport Interface.

property bus_manager: Any

Value of the bus manager used by this Transport Interface.

Bus manager handles Physical and Data layers (OSI Model) of the bus.

Return type:

Any

abstract property segmenter: uds.segmentation.AbstractSegmenter

Value of the segmenter used by this Transport Interface.

Warning

Do not change any segmenter attributes as it might cause malfunction of the entire Transport Interface.

Return type:

uds.segmentation.AbstractSegmenter

abstract static is_supported_bus_manager(bus_manager)[source]

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

Parameters:

bus_manager (Any) – Value to check.

Returns:

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

Return type:

bool

abstract send_packet(packet)[source]

Transmit UDS packet.

Parameters:

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

Returns:

Record with historic information about transmitted UDS packet.

Return type:

uds.packet.AbstractUdsPacketRecord

abstract receive_packet(timeout=None)[source]

Receive UDS packet.

Parameters:

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

Raises:

TimeoutError – Timeout was reached.

Returns:

Record with historic information about received UDS packet.

Return type:

uds.packet.AbstractUdsPacketRecord

abstract async async_send_packet(packet, loop=None)[source]

Transmit UDS packet asynchronously.

Parameters:
  • packet (uds.packet.AbstractUdsPacket) – 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 UDS packet.

Return type:

uds.packet.AbstractUdsPacketRecord

abstract async async_receive_packet(timeout=None, loop=None)[source]

Receive UDS packet asynchronously.

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

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

Raises:
  • TimeoutError – Timeout was reached.

  • asyncio.TimeoutError – Timeout was reached.

Returns:

Record with historic information about received UDS packet.

Return type:

uds.packet.AbstractUdsPacketRecord