j5.backends.backend module

The base classes for backends.

class j5.backends.backend.Backend[source]

Bases: object

The base class for a backend.

A backend is an implementation of a specific board for an environment.

It can hold data about the actual board it is controlling. There should be a ratio of one instance of a Backend to one instance of a Board. The Backend object should not hold any references to the Board, instead having it’s methods executed by the code for the individual Board.

A Backend usually also implements a number of ComponentInterfaces which thus allow a physical component to be controlled by the abstract Component representation.

board

Type of board this backend implements.

classmethod discover() → Set[Board][source]

Discover boards that this backend can control.

firmware_version

The firmware version of the board.

class j5.backends.backend.BackendMeta[source]

Bases: abc.ABCMeta

The metaclass for a backend.

Ensures that the backend implements the correct interfaces when instantiated. It does this by checking that the class inherits from the interface classes defined on the Components in backend.board.supported_components.

exception j5.backends.backend.CommunicationError[source]

Bases: Exception

A communication error occurred.

This error is thrown when there is an error communicating with a board, if a more specific exception is available, then that may be thrown instead, but it should inherit from this one.