Class Utils
java.lang.Object
uk.ac.manchester.spinnaker.transceiver.Utils
public abstract class Utils extends Object
Support utilities.
-
Method Summary
Modifier and Type Method Description static BMPConnectionData
defaultBMPforMachine(InetAddress host, Integer numberOfBoards)
Work out the BMP connection IP address given the machine details.static MemoryLocation
getVcpuAddress(int p)
Get the address of thevcpu_t
structure for the given core.static MemoryLocation
getVcpuAddress(HasCoreLocation core)
Get the address of thevcpu_t
structure for the given core.static ByteBuffer
newMessageBuffer()
static void
sendPortTriggerMessage(UDPConnection<?> connection, InetAddress host)
Deprecated, for removal: This API element is subject to removal in a future version.CallUDPConnection.sendPortTriggerMessage(InetAddress)
directly instead.
-
Method Details
-
defaultBMPforMachine
public static BMPConnectionData defaultBMPforMachine(InetAddress host, Integer numberOfBoards) throws UnknownHostExceptionWork out the BMP connection IP address given the machine details. This is assumed to be the IP address of the machine, with 1 subtracted from the final part e.g. if the machine IP address is 192.168.0.5, the BMP IP address is assumed to be 192.168.0.4- Parameters:
host
- the SpiNNaker machine main hostnumberOfBoards
- the number of boards in the machine- Returns:
- The BMP connection data
- Throws:
UnknownHostException
- If the IP address computations fail.
-
getVcpuAddress
Get the address of thevcpu_t
structure for the given core.- Parameters:
p
- The core number- Returns:
- the address
-
getVcpuAddress
Get the address of thevcpu_t
structure for the given core.- Parameters:
core
- The core- Returns:
- the address
-
sendPortTriggerMessage
@Deprecated(forRemoval=true) @InlineMe(replacement="connection.sendPortTriggerMessage(host)") public static void sendPortTriggerMessage(UDPConnection<?> connection, InetAddress host) throws IOExceptionDeprecated, for removal: This API element is subject to removal in a future version.CallUDPConnection.sendPortTriggerMessage(InetAddress)
directly instead.Sends a port trigger message using a connection to (hopefully) open a port in a NAT and/or firewall to allow incoming packets to be received.- Parameters:
connection
- The UDP connection down which the trigger message should be senthost
- The address of the SpiNNaker board to which the message should be sent- Throws:
IOException
- If anything goes wrong
-
newMessageBuffer
- Returns:
- Get a new little-endian buffer sized suitably for SpiNNaker messages.
-