Previous topic

spinnman.connections.listeners.port_listener module

Next topic

spinnman.connections.udp_packet_connections package

This Page

spinnman.connections.listeners.scp_listener module

class spinnman.connections.listeners.scp_listener.SCPListener(scp_receiver, response_class, callback, error_callback=None)[source]

Bases: threading.Thread

Listens for SCP packets received from a connection, calling a callback function with received packets

Parameters:
  • scp_receiver (spinnman.connections.abstract_scp_receiver.AbstractSCPReceiver) – The SCP Receiver to receive packets from
  • response_class (class of implementation of spinnman.messages.scp.abstract_scp_response.AbstractSCPResponse) – The SCP response
  • callback (function( spinnman.messages.scp.abstract_scp_response.AbstractSCPResponse)) – The callback function to call on reception of each packet; the function should take one parameter, which is the SCP packet received
  • error_callback (function(Exception, str)) – The callback function to call if there is an error receiving a packet; the function should take two parameters: * The exception received * A message indicating what the problem was
Raises spinnman.exceptions.SpinnmanInvalidParameterException:
 

If the callback or the error_callback do not take the expected number of arguments

Attributes

daemon A boolean value indicating whether this thread is a daemon thread (True) or not (False).
ident Thread identifier of this thread or None if it has not been started.
name A string used for identification purposes only.

Methods

run() Overridden method of Thread that runs this listener
start() Starts listening and sending callbacks
stop() Stops the reception of packets

Detailed Methods

run()[source]

Overridden method of Thread that runs this listener

start()[source]

Starts listening and sending callbacks

Returns:Nothing is returned
Return type:None
Raises None:No known exceptions are raised
stop()[source]

Stops the reception of packets

Returns:Nothing is returned
Return type:None
Raises None:No known exceptions are raised