gps.connection
Class GPSRxTxPort

java.lang.Object
  extended by gps.connection.GPSPort
      extended by gps.connection.GPSRxTxPort

public final class GPSRxTxPort
extends GPSPort

This class implements the serial port for rxtx (on Linux).

Author:
Mario De Weerd

Field Summary
static java.lang.String os_name
           
 
Constructor Summary
GPSRxTxPort()
           
 
Method Summary
 void closePort()
          Close the connection.
 int error()
          getter to retrieve the last error report by the serial port driver.
 java.lang.String getFreeTextPort()
           
 boolean isConnected()
          Indicates if the device is connected or not.
 int openPort()
          Open a connection.
 int readBytes(byte[] b, int start, int max)
           
 int readCheck()
           
 void setBlueTooth()
          Set a bluetooth connection.
 void setFreeTextPort(java.lang.String s)
          Set the "Free text port" - does not open it.
 void setUSB()
          Set an USB connection.
 void write(byte[] b)
           
 void write(java.lang.String s)
           
 
Methods inherited from class gps.connection.GPSPort
debugActive, endDebug, getDebugFileName, getPort, getSpeed, setDebugFileName, setPort, setSpeed, startDebug, writeDebug, writeDebug
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

os_name

public static final java.lang.String os_name
Constructor Detail

GPSRxTxPort

public GPSRxTxPort()
Method Detail

isConnected

public final boolean isConnected()
Indicates if the device is connected or not.

Overrides:
isConnected in class GPSPort
Returns:
true if the device is connected.

closePort

public final void closePort()
Close the connection.

Overrides:
closePort in class GPSPort

openPort

public final int openPort()
Open a connection.

Overrides:
openPort in class GPSPort
Returns:
status result of the opening of the serial port.

setBlueTooth

public final void setBlueTooth()
Set a bluetooth connection.

Overrides:
setBlueTooth in class GPSPort

setUSB

public final void setUSB()
Set an USB connection.

Overrides:
setUSB in class GPSPort

setFreeTextPort

public final void setFreeTextPort(java.lang.String s)
Description copied from class: GPSPort
Set the "Free text port" - does not open it.

Overrides:
setFreeTextPort in class GPSPort

getFreeTextPort

public final java.lang.String getFreeTextPort()
Overrides:
getFreeTextPort in class GPSPort

error

public final int error()
getter to retrieve the last error report by the serial port driver.

Returns:
last error from the SerialPort driver

write

public final void write(byte[] b)
Specified by:
write in class GPSPort

write

public final void write(java.lang.String s)
Specified by:
write in class GPSPort

readCheck

public final int readCheck()
Overrides:
readCheck in class GPSPort

readBytes

public final int readBytes(byte[] b,
                           int start,
                           int max)
Overrides:
readBytes in class GPSPort