FrogSpot Class Reference
Main class for FROG interaction using a Sun SPOT. More...
Public Member Functions | |
FrogSpot () throws Throwable | |
FrogSpot is constructed from the main method of the Squawk VM. | |
void | shutdown () |
Silently catches any exceptions from destroyApp(boolean) and reboots the SPOT. | |
void | switchPressed (ISwitch sw2) |
Reboots the Sun SPOT. | |
void | switchReleased (ISwitch sw2) |
Static Public Attributes | |
static final String | SPOT1_PORT = "COM14" |
static final String | SPOT2_PORT = "COM9" |
static final String | SPOT3_PORT = "COM13" |
static final String | SPOT4_PORT = "COM15" |
static final String | SPOT5_PORT = "COM12" |
static final String | SPOT6_PORT = "COM10" |
static final String | SPOT7_PORT = "COM11" |
static final String | SPOT8_PORT = "COM8" |
static final String | SPOTB1_PORT = "COM4" |
static final String | SPOTB2_PORT = "COM7" |
static final String | SPOTB3_PORT = "COM6" |
static final String | SPOTB4_PORT = "COM5" |
static final short | PORT_BCAST = 32 |
static final short | PORT_REPLY = 33 |
static final short | PORT_START = 34 |
static final short | PORT_MAX = 254 |
static final byte | MSG_ADD_FILTER = -1 |
Messages sent between host and SPOT. | |
static final byte | MSG_REMOVE_FILTERS = -2 |
static final byte | MSG_ALIVE = -3 |
static final byte | MSG_GESTURE = -4 |
static final byte | MSG_END_OF_DATA = -5 |
static final byte | MSG_DISCOVER = -6 |
static final byte | MSG_DISCONNECT = -7 |
static final byte | MSG_ERROR = -8 |
static final byte | MSG_RESEND = -9 |
static final byte | MSG_ACK = -10 |
static final byte | MSG_SAMPLE_RATE = -11 |
static final double[] | END_OF_DATA = { 42.0 } |
Special markers for FilterPipeline on the SPOT. | |
static final double[] | CORRUPT_DATA = { 43.0 } |
static final int[] | INT_END_OF_DATA = { 42 } |
static final int[] | INT_CORRUPT_DATA = { 43 } |
Protected Member Functions | |
void | destroyApp (boolean unconditional) throws MIDletStateChangeException |
Called by the Squawk VM when the reset button is pressed. | |
void | pauseApp () |
void | startApp () throws MIDletStateChangeException |
Squawk VM starts execution here. | |
Protected Attributes | |
final AccelManager | accelManager |
final FilterManager | filter |
final ConnectionManager | conn |
Static Package Functions | |
static void | enableLights (byte status) |
Sets the LEDs on the SPOT to a given status code. | |
Static Package Attributes | |
static final EDemoBoard | e = EDemoBoard.getInstance() |
static final LIS3L02AQAccelerometer | accel |
static final ITriColorLED[] | leds = e.getLEDs() |
static final ISpot | spot = Spot.getInstance() |
static final IRadioPolicyManager | rpm = RadioFactory.getRadioPolicyManager() |
static final ISwitch | sw1 = e.getSwitches()[EDemoBoard.SW1] |
static final ISwitch | sw2 = e.getSwitches()[EDemoBoard.SW2] |
static final IAT91_TC | timer = spot.getAT91_TC(0) |
static final byte | TURN_OFF = 0 |
Status light. | |
static final byte | FINDING_HOST = 1 |
static final byte | CONNECTED = 2 |
static final byte | DISCOVER_FAILURE = 3 |
static final byte | ACCEL_FAILURE = 4 |
static final byte | FILTER_FAILURE = 5 |
static final byte | SEND_FAILURE = 6 |
static final byte | RECEIVE_FAILURE = 7 |
static final byte | WATCHER_FAILURE = 8 |
static final String | SPOT1 = "0014.4F01.0000.1BE9" |
static final String | SPOT2 = "0014.4F01.0000.1E37" |
static final String | SPOT3 = "0014.4F01.0000.1E98" |
static final String | SPOT4 = "0014.4F01.0000.2AAE" |
static final String | SPOT5 = "0014.4F01.0000.3B61" |
static final String | SPOT6 = "0014.4F01.0000.3B7D" |
static final String | SPOT7 = "0014.4F01.0000.4118" |
static final String | SPOT8 = "0014.4F01.0000.4213" |
static final String | SPOTB1 = "0014.4F01.0000.2C06" |
static final String | SPOTB2 = "0014.4F01.0000.22F3" |
static final String | SPOTB3 = "0014.4F01.0000.3122" |
static final String | SPOTB4 = "0014.4F01.0000.415E" |
Detailed Description
Main class for FROG interaction using a Sun SPOT.
Provides access to all SunSPOT facilities and sets up all the Managers.
- See also:
- AccelManager
- FilterManager
- ConnectionManager
Constructor & Destructor Documentation
FrogSpot | ( | ) | throws Throwable |
FrogSpot is constructed from the main method of the Squawk VM.
The constructor puts the SPOT into discoverable and goes no farther until a host has requested a connection to the SPOT.
- Exceptions:
-
Throwable if anything goes wrong setting up this MIDlet
Member Function Documentation
void destroyApp | ( | boolean | unconditional | ) | throws MIDletStateChangeException [protected] |
Called by the Squawk VM when the reset button is pressed.
Can also be called by the shutdown() method when an error occurs or switch 2 is pressed.
- Parameters:
-
unconditional unused
static void enableLights | ( | byte | status | ) | [static, package] |
Sets the LEDs on the SPOT to a given status code.
The code must be a number between 0 and 8. 0 Turns all lights off. Any other number lights up its corresponding LED.
- Parameters:
-
status a given status byte such as FINDING_HOST or JOIN_FAILURE
void pauseApp | ( | ) | [protected] |
void shutdown | ( | ) |
Silently catches any exceptions from destroyApp(boolean) and reboots the SPOT.
void startApp | ( | ) | throws MIDletStateChangeException [protected] |
Squawk VM starts execution here.
Sets accelerometers to 6G scale and the timer to the desired sample rate as defined in AccelManager.
void switchPressed | ( | ISwitch | sw2 | ) |
Reboots the Sun SPOT.
- Parameters:
-
sw2 the SPOT's "Switch 2"
void switchReleased | ( | ISwitch | sw2 | ) |
Member Data Documentation
final LIS3L02AQAccelerometer accel [static, package] |
(LIS3L02AQAccelerometer)e.getAccelerometer()
final byte ACCEL_FAILURE = 4 [static, package] |
final AccelManager accelManager [protected] |
final ConnectionManager conn [protected] |
final byte CONNECTED = 2 [static, package] |
final double [] CORRUPT_DATA = { 43.0 } [static, inherited] |
final byte DISCOVER_FAILURE = 3 [static, package] |
final EDemoBoard e = EDemoBoard.getInstance() [static, package] |
final double [] END_OF_DATA = { 42.0 } [static, inherited] |
Special markers for FilterPipeline on the SPOT.
final FilterManager filter [protected] |
final byte FILTER_FAILURE = 5 [static, package] |
final byte FINDING_HOST = 1 [static, package] |
final int [] INT_CORRUPT_DATA = { 43 } [static, inherited] |
final int [] INT_END_OF_DATA = { 42 } [static, inherited] |
final ITriColorLED [] leds = e.getLEDs() [static, package] |
static final byte MSG_ACK = -10 [static, inherited] |
static final byte MSG_ADD_FILTER = -1 [static, inherited] |
Messages sent between host and SPOT.
static final byte MSG_ALIVE = -3 [static, inherited] |
static final byte MSG_DISCONNECT = -7 [static, inherited] |
static final byte MSG_DISCOVER = -6 [static, inherited] |
static final byte MSG_END_OF_DATA = -5 [static, inherited] |
static final byte MSG_ERROR = -8 [static, inherited] |
static final byte MSG_GESTURE = -4 [static, inherited] |
static final byte MSG_REMOVE_FILTERS = -2 [static, inherited] |
static final byte MSG_RESEND = -9 [static, inherited] |
static final byte MSG_SAMPLE_RATE = -11 [static, inherited] |
static final short PORT_BCAST = 32 [static, inherited] |
static final short PORT_MAX = 254 [static, inherited] |
static final short PORT_REPLY = 33 [static, inherited] |
static final short PORT_START = 34 [static, inherited] |
final byte RECEIVE_FAILURE = 7 [static, package] |
final IRadioPolicyManager rpm = RadioFactory.getRadioPolicyManager() [static, package] |
final byte SEND_FAILURE = 6 [static, package] |
final ISpot spot = Spot.getInstance() [static, package] |
static final String SPOT1 = "0014.4F01.0000.1BE9" [static, package, inherited] |
static final String SPOT1_PORT = "COM14" [static, inherited] |
static final String SPOT2 = "0014.4F01.0000.1E37" [static, package, inherited] |
static final String SPOT2_PORT = "COM9" [static, inherited] |
static final String SPOT3 = "0014.4F01.0000.1E98" [static, package, inherited] |
static final String SPOT3_PORT = "COM13" [static, inherited] |
static final String SPOT4 = "0014.4F01.0000.2AAE" [static, package, inherited] |
static final String SPOT4_PORT = "COM15" [static, inherited] |
static final String SPOT5 = "0014.4F01.0000.3B61" [static, package, inherited] |
static final String SPOT5_PORT = "COM12" [static, inherited] |
static final String SPOT6 = "0014.4F01.0000.3B7D" [static, package, inherited] |
static final String SPOT6_PORT = "COM10" [static, inherited] |
static final String SPOT7 = "0014.4F01.0000.4118" [static, package, inherited] |
static final String SPOT7_PORT = "COM11" [static, inherited] |
static final String SPOT8 = "0014.4F01.0000.4213" [static, package, inherited] |
static final String SPOT8_PORT = "COM8" [static, inherited] |
static final String SPOTB1 = "0014.4F01.0000.2C06" [static, package, inherited] |
static final String SPOTB1_PORT = "COM4" [static, inherited] |
static final String SPOTB2 = "0014.4F01.0000.22F3" [static, package, inherited] |
static final String SPOTB2_PORT = "COM7" [static, inherited] |
static final String SPOTB3 = "0014.4F01.0000.3122" [static, package, inherited] |
static final String SPOTB3_PORT = "COM6" [static, inherited] |
static final String SPOTB4 = "0014.4F01.0000.415E" [static, package, inherited] |
static final String SPOTB4_PORT = "COM5" [static, inherited] |
final ISwitch sw1 = e.getSwitches()[EDemoBoard.SW1] [static, package] |
final ISwitch sw2 = e.getSwitches()[EDemoBoard.SW2] [static, package] |
final IAT91_TC timer = spot.getAT91_TC(0) [static, package] |
final byte TURN_OFF = 0 [static, package] |
Status light.
final byte WATCHER_FAILURE = 8 [static, package] |
The documentation for this class was generated from the following file:
- /Users/dev/Documents/SVN brazos.cs.tcu.edu/trunk/FROG SPOT/src/frog/plugin/spot/onspot/FrogSpot.java