|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfrog.plugin.spot.SpotPlugin
public class SpotPlugin
Plugin for the FROG system allowing the use of Sun Microsystem's SPOTs as a
device.
Please see http://brazos.cs.tcu.edu
for more documentation.
SpotConnection| Field Summary | |
|---|---|
static String[] |
availFilters
Filters that the SPOT is capable of performing. |
protected static HashSet<Short> |
availPorts
A HashSet allows constant time look-up and addition. |
protected static Hashtable<String,SpotConnection> |
connections
SpotConnections are Sun SPOTs that are connected and have DeviceListeners attached to them. |
static String |
type
Applied to any Device object we create. |
| Fields inherited from interface frog.plugin.spot.Frog_Spot_Constants |
|---|
CORRUPT_DATA, END_OF_DATA, INT_CORRUPT_DATA, INT_END_OF_DATA, MSG_ACK, MSG_ADD_FILTER, MSG_ALIVE, MSG_DISCONNECT, MSG_DISCOVER, MSG_END_OF_DATA, MSG_ERROR, MSG_GESTURE, MSG_REMOVE_FILTERS, MSG_RESEND, MSG_SAMPLE_RATE, PORT_BCAST, PORT_MAX, PORT_REPLY, PORT_START, SPOT1, SPOT1_PORT, SPOT2, SPOT2_PORT, SPOT3, SPOT3_PORT, SPOT4, SPOT4_PORT, SPOT5, SPOT5_PORT, SPOT6, SPOT6_PORT, SPOT7, SPOT7_PORT, SPOT8, SPOT8_PORT, SPOTB1, SPOTB1_PORT, SPOTB2, SPOTB2_PORT, SPOTB3, SPOTB3_PORT, SPOTB4, SPOTB4_PORT |
| Constructor Summary | |
|---|---|
SpotPlugin()
Creates a single SpotPlugin object. |
|
| Method Summary | |
|---|---|
void |
addFilter(Device device,
int id,
String arg)
\ |*** ***| |*** Inherited Methods ***| |*** ***| \ |
void |
calibrate(Device device)
Calibrates the accelerometers of the target device. |
void |
connect(Device device)
Formally connect to a specified device. |
void |
disconnect(Device device)
Disconnect a connected device. |
void |
disconnectAll()
Disconnect from all devices known to this Plugin. |
void |
discover(Vector<Device> deviceList)
A non-blocking method for finding nearby discoverable devices. |
String[] |
getActiveFilters(Device device)
Returns a list of filters currently active on the device. |
String[] |
getAvailFilters()
Returns a list of available filters that this device supports. |
static SpotPlugin |
getInstance()
Retrieves the singleton object of SpotPlugin. |
int |
getSampleRate(Device device)
Gets the current sampling rate of this Device in hertz. |
void |
removeFilter(Device device,
int index)
Removes a filter from the list of active filters on the Device. |
void |
resetFilters(Device device)
Removes any filters currently active on the Device. |
void |
setSampleRate(Device device,
int rate)
Instructs this device to sample at a given rate. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String type
protected static final Hashtable<String,SpotConnection> connections
protected static final HashSet<Short> availPorts
public static final String[] availFilters
| Constructor Detail |
|---|
public SpotPlugin()
throws Throwable
Exception.
Throwable| Method Detail |
|---|
public static SpotPlugin getInstance()
public void addFilter(Device device,
int id,
String arg)
throws IOException
addFilter in interface Plugindevice - the device to send the new filter information toid - the filter desired. This should be the index from the array
of filters.arg - the argument String for this filter
IOException - if any communication error occursPlugin.getAvailFilters(),
Device.addFilter(int, String)
public void calibrate(Device device)
throws IOException
Plugin
calibrate in interface Plugindevice - the device to be calibrated
IOException - if any communication error occursDevice.calibrate()
public void connect(Device device)
throws IOException
Plugin
connect in interface Plugindevice - the device to connect to
IOException - if any communication error occurs. It should be
assumed that if this exception is thrown, the
device is NOT connected.Device.connect(DeviceListener)
public void disconnect(Device device)
throws IOException
Plugin
disconnect in interface Plugindevice - the device to disconnect from
IOException - if the device cannot be sent a disconnect signal.
Regardless, a best attempt must be made to tear
down any local resources tied to this device.Device.disconnect()
public void disconnectAll()
throws IOException
Plugin
disconnectAll in interface PluginIOException - if any of the connected devices could not be sent a
disconnect message. Regardless, FROG is probably
shutting down and any local resources should be
freed.
public void discover(Vector<Device> deviceList)
throws IOException
Plugin
discover in interface PluginIOException - any catastrophic errors occur. Should ideally be
thrown if the radio or other hardware is missing.
Communication errors between the plugin and a
device are not a sufficient cause to throw this
exception.
public String[] getActiveFilters(Device device)
throws IOException
Pluginnull or empty array
may be returned.
getActiveFilters in interface PluginIOException - if a list of active filters could not be obtained
from the Device.Device.getActiveFilters()public String[] getAvailFilters()
Plugin
getAvailFilters in interface PluginDevice.getAvailFilters()
public int getSampleRate(Device device)
throws IOException
Plugin
getSampleRate in interface PluginIOException - if the current sample rate could not be obtained
from the DeviceDevice.getSampleRate()
public void removeFilter(Device device,
int index)
throws IOException
Plugin
removeFilter in interface Plugindevice - the Device to delete a filter fromindex - the position on the Device's active filters list to remove
IOException - if the filter on the Device could not be removed
public void resetFilters(Device device)
throws IOException
Plugin
resetFilters in interface Plugindevice - the Device to clear the filters on
IOException - if any communication error occursPlugin.addFilter(Device, int, String),
Device.resetFilters()
public void setSampleRate(Device device,
int rate)
throws IOException
Plugin
setSampleRate in interface Pluginrate - the rate to sample at in hertz
IOException - if any communication error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||