Class SCPRequest<T extends SCPResponse>
java.lang.Object
uk.ac.manchester.spinnaker.messages.sdp.SpinnakerRequest
uk.ac.manchester.spinnaker.messages.scp.SCPRequest<T>
- Type Parameters:
T
- The type of response expected to the request, if any.
- All Implemented Interfaces:
SerializableMessage
- Direct Known Subclasses:
ApplicationRun
,ApplicationStop
,BMPRequest
,CountState
,FECRequest
,FillRequest
,FixedRouteInitialise
,FixedRouteRead
,FloodFillData
,FloodFillEnd
,FloodFillStart
,GetChipInfo
,GetVersion
,IPTagClear
,IPTagGet
,IPTagGetInfo
,IPTagSet
,IPTagSetTTO
,ReadLink
,ReadMemory
,ReinjectorRequest
,ReverseIPTagSet
,RouterAlloc
,RouterClear
,RouterInit
,RouterTableRequest
,SDRAMAlloc
,SDRAMDeAlloc
,SendSignal
,SetLED
,WriteLink
,WriteMemory
public abstract class SCPRequest<T extends SCPResponse> extends SpinnakerRequest
Represents an Abstract SCP Request.
-
Field Summary
Fields Modifier and Type Field Description int
argument1
The first argument.int
argument2
The second argument.int
argument3
The third argument.static ChipLocation
BOOT_CHIP
The pseudo-location of the default chip.static CoreLocation
BOOT_MONITOR_CORE
The location of the default SCAMP.ByteBuffer
data
The payload data as a buffer, ornull
if no payload data.protected static ByteBuffer
NO_DATA
The constant value used to indicate that no payload data is in the message.SCPRequestHeader
scpRequestHeader
The SCP request header of the message. -
Constructor Summary
Constructors Modifier Constructor Description protected
SCPRequest(HasCoreLocation core, SCPCommand command)
Create a new request that goes to the default port and needs a reply.protected
SCPRequest(HasCoreLocation core, SCPCommand command, int argument1)
Create a new request that goes to the default port and needs a reply.protected
SCPRequest(HasCoreLocation core, SCPCommand command, int argument1, int argument2)
Create a new request that goes to the default port and needs a reply.protected
SCPRequest(HasCoreLocation core, SCPCommand command, int argument1, int argument2, int argument3)
Create a new request that goes to the default port and needs a reply.protected
SCPRequest(HasCoreLocation core, SCPCommand command, int argument1, int argument2, int argument3, ByteBuffer data)
Create a new request that goes to the default port and needs a reply.protected
SCPRequest(SDPHeader sdpHeader, CommandCode command, int argument1, int argument2, int argument3, ByteBuffer data)
Create a new request. -
Method Summary
Modifier and Type Method Description void
addToBuffer(ByteBuffer buffer)
Writes this message into the given buffer as a contiguous range of bytes.abstract T
getSCPResponse(ByteBuffer buffer)
Parse the response to this message.Methods inherited from class uk.ac.manchester.spinnaker.messages.sdp.SpinnakerRequest
getMessageData
-
Field Details
-
BOOT_MONITOR_CORE
The location of the default SCAMP. -
BOOT_CHIP
The pseudo-location of the default chip. -
argument1
public final int argument1The first argument. -
argument2
public final int argument2The second argument. -
argument3
public final int argument3The third argument. -
data
The payload data as a buffer, ornull
if no payload data. -
scpRequestHeader
The SCP request header of the message. -
NO_DATA
The constant value used to indicate that no payload data is in the message.
-
-
Constructor Details
-
SCPRequest
Create a new request that goes to the default port and needs a reply.- Parameters:
core
- The core to send the request to.command
- The command ID.
-
SCPRequest
Create a new request that goes to the default port and needs a reply.- Parameters:
core
- The core to send the request to.command
- The command ID.argument1
- The first argument.
-
SCPRequest
Create a new request that goes to the default port and needs a reply.- Parameters:
core
- The core to send the request to.command
- The command ID.argument1
- The first argument.argument2
- The second argument.
-
SCPRequest
protected SCPRequest(HasCoreLocation core, SCPCommand command, int argument1, int argument2, int argument3)Create a new request that goes to the default port and needs a reply.- Parameters:
core
- The core to send the request to.command
- The command ID.argument1
- The first argument.argument2
- The second argument.argument3
- The third argument.
-
SCPRequest
protected SCPRequest(HasCoreLocation core, SCPCommand command, int argument1, int argument2, int argument3, ByteBuffer data)Create a new request that goes to the default port and needs a reply.- Parameters:
core
- The core to send the request to.command
- The command ID.argument1
- The first argument.argument2
- The second argument.argument3
- The third argument.data
- The additional data. Starts at the position and goes to the limit. The position and limit of the buffer will not be updated by this constructor.
-
SCPRequest
protected SCPRequest(SDPHeader sdpHeader, CommandCode command, int argument1, int argument2, int argument3, ByteBuffer data)Create a new request.- Parameters:
sdpHeader
- The header.command
- The command ID.argument1
- The first argument.argument2
- The second argument.argument3
- The third argument.data
- The additional data. Starts at the position and goes to the limit. The position and limit of the buffer will not be updated by this constructor.
-
-
Method Details
-
addToBuffer
Description copied from interface:SerializableMessage
Writes this message into the given buffer as a contiguous range of bytes. This is so that a message can be sent. Implementors may assume that the buffer has been configured to be little-endian and that its position is at the point where they should begin writing. Once it has finished, the position should be immediately after the last byte written by this method.Calling this method should not update the internal state of the message. It should be possible to add the message to multiple buffers without special precautions by the caller.
- Parameters:
buffer
- The buffer to write into.
-
getSCPResponse
Parse the response to this message.- Parameters:
buffer
- The buffer to parse.- Returns:
- The message response.
- Throws:
Exception
- If anything goes wrong with parsing.
-