|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectecologylab.generic.Debug
ecologylab.sensor.gps.GPS
public class GPS
Buffers data from a GPS device for use in a Java application. Can produce instances of GPSData, which encapsulate the sensor data at some time. Uses GPSDeviceProfiles to handle multiple different types of GPS equipment, based on the type of data it produces.
| Field Summary | |
|---|---|
protected java.lang.StringBuilder |
incomingDataBuffer
|
| Constructor Summary | |
|---|---|
protected |
GPS()
No-argument, do-nothing constructor for simulator subclass that will not use a port. |
|
GPS(gnu.io.CommPortIdentifier portId,
int baud)
|
|
GPS(java.lang.String portName,
int baud)
Instantiate a GPS device on a given port and baud rate. |
| Method Summary | |
|---|---|
void |
addGPSDataListener(GPSDataListener l)
|
boolean |
connect()
Connects to the GPS device based on the portName, baud, and device profile and activates the connection. |
boolean |
connected()
|
void |
disconnect()
Deactivates the current GPS device and closes out the port. |
int |
getBaudRate()
Gets the baud rate of the port. |
java.lang.String |
getPortName()
|
protected void |
handleIncomingChars()
|
void |
removeGPSDataListener(GPSDataListener l)
|
void |
serialEvent(gnu.io.SerialPortEvent event)
|
| Methods inherited from class ecologylab.generic.Debug |
|---|
classSimpleName, closeLoggingFile, debug, debug, debug, debug, debugA, debugA, debugA, debugI, debugI, debugI, error, error, getClassName, getClassName, getInteractive, getPackageName, getPackageName, getPackageName, initialize, level, level, level, logToFile, print, print, println, println, println, println, println, println, printlnA, printlnA, printlnA, printlnI, printlnI, printlnI, printlnI, setLoggingFile, show, show, superString, toggleInteractive, toString, toString, warning, warning, weird, weird |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.StringBuilder incomingDataBuffer
| Constructor Detail |
|---|
public GPS(java.lang.String portName,
int baud)
throws gnu.io.NoSuchPortException,
java.io.IOException
devProfile - portName - baud -
gnu.io.NoSuchPortException - the port does not exist on this system.
java.io.IOException - the specified port is a parallel port.
public GPS(gnu.io.CommPortIdentifier portId,
int baud)
throws gnu.io.NoSuchPortException,
java.io.IOException
gnu.io.NoSuchPortException
java.io.IOExceptionprotected GPS()
| Method Detail |
|---|
public boolean connect()
throws gnu.io.PortInUseException,
gnu.io.UnsupportedCommOperationException,
java.io.IOException,
java.util.TooManyListenersException
gnu.io.PortInUseException
java.io.IOException
gnu.io.UnsupportedCommOperationException
java.util.TooManyListenersExceptionpublic boolean connected()
public void disconnect()
public void serialEvent(gnu.io.SerialPortEvent event)
serialEvent in interface gnu.io.SerialPortEventListenerprotected void handleIncomingChars()
bytesRead -
java.nio.charset.CharacterCodingExceptionpublic void addGPSDataListener(GPSDataListener l)
public void removeGPSDataListener(GPSDataListener l)
public java.lang.String getPortName()
public int getBaudRate()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||