|
SunSPOT API V4.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()
|
DataInputStream |
getDataInputStream()
Answer a data input stream for getting information from the host. |
DataOutputStream |
getDataOutputStream()
Answer a data output stream for sending information to the host. |
boolean |
isRemote()
|
boolean |
isSuiteInUse(String suiteUri)
Check whether a particular suite is in use |
void |
makeObsolete(String filename)
If there is a flash file with the given name, make it obsolete by renaming it and setting its obsolete flag. |
void |
receiveFile(long dataSize,
OutputStream outputStream)
Receive bulk data. |
void |
replaceSuiteFile(DataInputStream params,
String filename,
int virtualAddress)
Replace a suite file. |
void |
sendData(byte[] data,
int offset,
int length)
Send data to the host. |
void |
sendDataWithCRC(byte[] data,
int offset,
int length)
Deprecated. use sendData(byte[], int, int) instead |
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
IOExceptionDataOutputStream getDataOutputStream()
DataOutputStreamDataInputStream getDataInputStream()
DataInputStream
void receiveFile(long dataSize,
OutputStream outputStream)
throws IOException
dataSize - outputStream -
IOExceptionboolean isRemote()
void replaceSuiteFile(DataInputStream params,
String filename,
int virtualAddress)
throws IOException
params - the params supplied with the IOTACommandfilename - the name of the FlashFile to replacevirtualAddress - the virtual address at which the FlashFile should be mapped after restart, or 0 if an
unused virtual address should be allocated to the suite
IOException
void doDefaultCommand(String cmd,
DataInputStream params)
throws IOException
cmd - the name of the commandparams - the parameters that were supplied with the IOTACommand
IOExceptionString getBootloaderIdentificationString()
void sendDataWithCRC(byte[] data,
int offset,
int length)
throws IOException
sendData(byte[], int, int) instead
data - byte array of data to sendoffset - offset into data at which to start sendinglength - number of bytes from data to send
IOException
void sendData(byte[] data,
int offset,
int length)
throws IOException
data - byte array of data to sendoffset - offset into data at which to start sendinglength - number of bytes from data to send
IOExceptionboolean isSuiteInUse(String suiteUri)
suiteUri - the URI of the suite to check
void makeObsolete(String filename)
throws IOException
filename - the name of the file to make obsolete
IOException
|
SunSPOT API V4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||