spinnman.connections.abstract_classes package¶
Module contents¶
- class spinnman.connections.abstract_classes.AbstractSCPConnection¶
Bases:
Connection
A sender and receiver of SCP messages.
- abstract property chip_x: int¶
The X-coordinate of the chip at which messages sent down this connection will arrive at first.
- Return type:
- abstract property chip_y: int¶
The Y-coordinate of the chip at which messages sent down this connection will arrive at first.
- Return type:
- abstract get_scp_data(scp_request: AbstractSCPRequest) bytes [source]¶
Returns the data of an SCP request as it would be sent down this connection.
- abstract is_ready_to_receive(timeout: float = 0) bool [source]¶
Determines if there is an SCP packet to be read without blocking.
- abstract receive_scp_response(timeout: float | None = 1.0) Tuple[SCPResult, int, bytes, int] [source]¶
Receives an SCP response from this connection. Blocks until a message has been received, or a timeout occurs.
- Parameters:
timeout (int) – The time in seconds to wait for the message to arrive; if None, will wait forever, or until the connection is closed
- Returns:
The SCP result, the sequence number, the data of the response and the offset at which the data starts (i.e., where the SDP header starts).
- Return type:
- Raises:
SpinnmanIOException – If there is an error receiving the message
SpinnmanTimeoutException – If there is a timeout before a message is received
- class spinnman.connections.abstract_classes.Connection¶
Bases:
AbstractContextManager
An abstract connection to the SpiNNaker board over some medium.
- abstract is_connected() bool [source]¶
Determines if the medium is connected at this point in time.
- Returns:
True if the medium is connected, False otherwise
- Return type:
- Raises:
SpinnmanIOException – If there is an error when determining the connectivity of the medium.
- class spinnman.connections.abstract_classes.Listenable¶
Bases:
Generic
[T
]An interface for connections that can listen for incoming messages.
Implementing this interface means that the connection can be used with
ConnectionListener
.