gps.connection
Class GPSPort

java.lang.Object
  extended by gps.connection.GPSPort
Direct Known Subclasses:
GPSRxTxPort, GPSWabaPort, GPSWabaSocketPort, MyVirtualPort

public abstract class GPSPort
extends java.lang.Object

abstract class defining interface for serial port implementation. Allows differentiation according to platform.

Author:
Mario De Weerd

Field Summary
static java.lang.String os_name
           
 
Constructor Summary
GPSPort()
           
 
Method Summary
 void closePort()
           
 boolean debugActive()
           
 void endDebug()
           
 BT747Path getDebugFileName()
           
 java.lang.String getFreeTextPort()
           
 int getPort()
          Get the port number (getter for spPortNbr)
 int getSpeed()
           
 boolean isConnected()
          Indicates if the device is connected or not.
 int openPort()
           
 int readBytes(byte[] b, int start, int max)
           
 int readCheck()
           
 void setBlueTooth()
           
 void setDebugFileName(java.lang.String debugFileName)
           
 void setFreeTextPort(java.lang.String s)
          Set the "Free text port" - does not open it.
 void setPort(int port)
          Set and open a normal port (giving the port number)
 void setSpeed(int speed)
           
 void setUSB()
           
 void startDebug()
           
abstract  void write(byte[] b)
           
abstract  void write(java.lang.String s)
           
 void writeDebug(byte[] b, int index, int len)
           
 void writeDebug(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

os_name

public static java.lang.String os_name
Constructor Detail

GPSPort

public GPSPort()
Method Detail

isConnected

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

Returns:
true if the device is connected.

setPort

public void setPort(int port)
Set and open a normal port (giving the port number)

Parameters:
port - Port number of the port to open

openPort

public int openPort()

closePort

public void closePort()

setBlueTooth

public void setBlueTooth()

setUSB

public void setUSB()

setFreeTextPort

public void setFreeTextPort(java.lang.String s)
Set the "Free text port" - does not open it.

Parameters:
s -

getFreeTextPort

public java.lang.String getFreeTextPort()

setSpeed

public final void setSpeed(int speed)

getSpeed

public final int getSpeed()

getPort

public final int getPort()
Get the port number (getter for spPortNbr)

Returns:
Port number

write

public abstract void write(java.lang.String s)

write

public abstract void write(byte[] b)

writeDebug

public void writeDebug(java.lang.String s)

writeDebug

public final void writeDebug(byte[] b,
                             int index,
                             int len)

readCheck

public int readCheck()

readBytes

public int readBytes(byte[] b,
                     int start,
                     int max)

debugActive

public final boolean debugActive()

startDebug

public final void startDebug()

endDebug

public final void endDebug()

getDebugFileName

public BT747Path getDebugFileName()
Returns:
Returns the debugFileName.

setDebugFileName

public final void setDebugFileName(java.lang.String debugFileName)
Parameters:
debugFileName - The debugFileName to set.