|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Plugin
This interface should be implemented by any developer seeking to write code
that will allow them to use their device with the FROG Recognizer of
Gestures.
The class implementing this interface should create Device objects that have
a unique ID as well as a type. Those Device objects will have a pointer back
to the Plugin that created them to perform their methods. Device objects
have a notifier method for when accelerations are streaming in. It would be
a good idea to create an Object such as "FormalConnection" when a Device is
connected and sending gesture data. This "FormalConnection" object would
be able to call Device.notifyAcceleration(frog.Accel3D) method
to get the acceleration data up to the FROG and GUI levels.
| Method Summary | |
|---|---|
void |
addFilter(Device device,
int id,
String arg)
Instruct the device to add a new filter to its filtering pipeline. |
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. |
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. |
| Method Detail |
|---|
void addFilter(Device device,
int id,
String arg)
throws IOException
device - 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 occursgetAvailFilters(),
Device.addFilter(int, String)
void calibrate(Device device)
throws IOException
device - the device to be calibrated
IOException - if any communication error occursDevice.calibrate()
void connect(Device device)
throws IOException
device - 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)
void disconnect(Device device)
throws IOException
device - 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()
void disconnectAll()
throws IOException
IOException - 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.
void discover(Vector<Device> deviceList)
throws IOException
IOException - 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.
String[] getActiveFilters(Device device)
throws IOException
null or empty array
may be returned.
IOException - if a list of active filters could not be obtained
from the Device.Device.getActiveFilters()String[] getAvailFilters()
Device.getAvailFilters()
int getSampleRate(Device device)
throws IOException
IOException - if the current sample rate could not be obtained
from the DeviceDevice.getSampleRate()
void removeFilter(Device device,
int index)
throws IOException
device - 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
void resetFilters(Device device)
throws IOException
device - the Device to clear the filters on
IOException - if any communication error occursaddFilter(Device, int, String),
Device.resetFilters()
void setSampleRate(Device device,
int rate)
throws IOException
rate - 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 | |||||||||