|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread com.sun.spot.peripheral.ota.OTACommandServer
public class OTACommandServer
This class monitors radiogram communications on port number
8, and responds to commands received. These commands allow flashing the
Spot's config page and/or applications remotely, retrieving the config page
contents, and restarting the Spot.
Applications should never need to create an OTACommandServer explicitly.
OTA is enabled or disabled for a SPOT using the ant command line facility.
To get access to the OTACommandServer use Spot.getInstance().getOTACommandServer()
See IOTACommandServerListener
if you want to run an application in a
separate thread concurrently with OTACommandServer, and you need to respond
(for example, suspending) when flash operations start.
Field Summary | |
---|---|
static int |
HARDWARE_MAJOR_REV_ESPOT
Major version of the eSPOT hardware to report in response to HELLO_CMD |
static String |
HELLO_CMD
Command to respond information about the SPOT |
static int |
HELLO_COMMAND_MINOR_VERSION
Starting with (major) version 2, we support major/minor version numbering. |
static int |
HELLO_COMMAND_VERSION
Version of the HELLO_CMD that we support |
static int |
PORT
The radiostream port on which to listen for hosts connecting |
static String |
START_OTA_SESSION_CMD
Command that we recognise to start a new session |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Method Summary | |
---|---|
void |
addListener(IOTACommandServerListener sml)
Attach a listener to be notified of the start and stop of flash operations. |
String |
getBaseStationAddress()
Answer the IEEE address of the sender of the last command received. |
static OTACommandServer |
getInstance()
|
boolean |
isSuspended()
|
static void |
main(String[] args)
Startup the OTACommandServer on a SPOT listening for OTA connections. |
void |
run()
Should not be invoked from user code - call initialize() instead. |
void |
setSuspended(boolean suspended)
|
Date |
timeOfLastMessageFromHost()
|
Methods inherited from class java.lang.Thread |
---|
activeCount, currentThread, getName, getPriority, interrupt, isAlive, join, setPriority, sleep, start, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int PORT
public static final String START_OTA_SESSION_CMD
public static final String HELLO_CMD
public static final int HELLO_COMMAND_VERSION
HELLO_CMD
that we support
public static final int HELLO_COMMAND_MINOR_VERSION
public static final int HARDWARE_MAJOR_REV_ESPOT
HELLO_CMD
Method Detail |
---|
public static void main(String[] args)
args
- ignoredpublic static OTACommandServer getInstance() throws IOException
IOException
public void addListener(IOTACommandServerListener sml)
sml
- the listenerpublic String getBaseStationAddress()
public boolean isSuspended()
public void setSuspended(boolean suspended)
suspended
- Suspends or resumes the server (it is initially running).public Date timeOfLastMessageFromHost()
public void run()
initialize()
instead.
run
in interface Runnable
run
in class Thread
Runnable.run()
|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |