|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IOTACommandHelper
IOTACommandHelper
Each IOTACommand
is passed an instance of this interface at execution
to help it communicate with the remote SpotClient.
Field Summary | |
---|---|
static int |
COMMAND_OFFSET
The offset into a command string at which the command-defining character is found |
static int |
DEVICE_SECURITY_LEVEL
When a SPOT's admin command processor is receiving commands from a remote source, sensitive commands are verified using the digital signature of the SDK installation to which the SPOT is tied, and a timestamp to protect against replay attacks. |
static int |
PARAMETER_OFFSET
The offset into a command string at which the parameters start |
Method Summary | |
---|---|
void |
doDefaultCommand(String cmd,
DataInputStream params)
Invoke the default behaviour for one of the built-in commands. |
String |
getBootloaderIdentificationString()
|
DataOutputStream |
getDataOutputStream()
Answer a data output stream for sending information to the host. |
boolean |
isRemote()
|
void |
receiveDataWithFlowControl(long dataSize,
OutputStream outputStream)
Receive bulk data with flow control. |
void |
replaceSuiteFile(DataInputStream params,
String filename,
int virtualAddress)
Replace a suite file. |
void |
sendDataWithCRC(byte[] data,
int offset,
int length)
Send data to the host with a CRC checksum appended. |
void |
sendErrorDetails(String msg)
Notify the host that an error has occurred. |
void |
sendPrompt()
Send a bootloader prompt to a remote SpotClient. |
Field Detail |
---|
static final int DEVICE_SECURITY_LEVEL
DEVICE_SECURITY_LEVEL
defaults to 2, so that commands
with a security level of 2 or lower are verified. You can rebuild
the library with different values to change the security level.
static final int COMMAND_OFFSET
static final int PARAMETER_OFFSET
Method Detail |
---|
void sendPrompt() throws IOException
sendErrorDetails(String)
if
an error occurs.
IOException
void sendErrorDetails(String msg) throws IOException
sendPrompt()
.
msg
- the error message for the host
IOException
DataOutputStream getDataOutputStream()
DataOutputStream
void receiveDataWithFlowControl(long dataSize, OutputStream outputStream) throws IOException
dataSize
- outputStream
-
IOException
boolean isRemote()
void replaceSuiteFile(DataInputStream params, String filename, int virtualAddress) throws IOException
params
- the params supplied with the IOTACommand
filename
- the name of the FlashFile to replace (currently either "app" or "lib")virtualAddress
- the virtual address at which the FlashFile should be mapped after restart (currently
either ConfigPage.APP_VIRTUAL_ADDRESS
or ConfigPage.LIBRARY_VIRTUAL_ADDRESS
)
IOException
void doDefaultCommand(String cmd, DataInputStream params) throws IOException
cmd
- the name of the commandparams
- the parameters that were supplied with the IOTACommand
IOException
String getBootloaderIdentificationString()
void sendDataWithCRC(byte[] data, int offset, int length) throws IOException
Utils.putDataWithCRC(DataOutputStream, byte[], int, int)
and Utils.getDataWithCRC(DataInputStream)
.
data
- byte array of data to sendoffset
- offset into data at which to start sendinglength
- number of bytes from data to send
IOException
|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |