spinnman.connections.abstract_classes package¶
Module contents¶
- class spinnman.connections.abstract_classes.AbstractSCPConnection[source]¶
Bases:
Connection
A sender and receiver of SCP messages.
- abstract property chip_x¶
The X-coordinate of the chip at which messages sent down this connection will arrive at first.
- Return type:
- abstract property chip_y¶
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)[source]¶
Returns the data of an SCP request as it would be sent down this connection.
- abstract is_ready_to_receive(timeout=0)[source]¶
Determines if there is an SCP packet to be read without blocking.
- abstract receive_scp_response(timeout=1.0)[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 not specified, 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
- abstract send_scp_request(scp_request)[source]¶
Sends an SCP request down this connection.
Messages must have the following properties:
source_port is None or 7
source_cpu is None or 31
source_chip_x is None or 0
source_chip_y is None or 0
tag in the message is optional; if not set, the default set in the constructor will be used. sequence in the message is optional; if not set, (sequence number last assigned + 1) % 65536 will be used
- Parameters:
scp_request (AbstractSCPRequest) – message packet to send
- Raises:
SpinnmanIOException – If there is an error sending the message
- class spinnman.connections.abstract_classes.Connection[source]¶
Bases:
AbstractContextManager
An abstract connection to the SpiNNaker board over some medium.
- abstract is_connected()[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.