wonderly.jeaprs.aprs.data
Class APRS

java.lang.Object
  |
  +--wonderly.jeaprs.aprs.data.APRS

public class APRS
extends java.lang.Object

This class represents all of the parameters that are part of the JeAPRS application environment. However, these properties are also common to most types of APRS applications. This class is thus a properties management class that has setters and getters for all the properties. What JeAPRS modules do is get a reference to the single instance of this class for themselves to use. The getPropertiesInstance() method is a static method that allows the rest of the modules in the system to get a reference to the single instance. Many clien apps in JeAPRS refer to their reference as 'APRS'. Note that this is a class local variable in their context, not a static reference to this class! Thus there are declarions of the form APRS APRS in these classes.

Applications using the JeAPRS library may find that there are other types of global data properties that need to be used between modules. This clas can be subclassed in those applications to provide the extra parameters. This class may also be extended over time to contain other properties as experience indicates the need.

Version:
2.0
Author:
Gregg Wonderly - The information contained in this document is Copyright 2001-2003, Gregg Wonderly, all rights reserved.

Field Summary
 int beaconSecs
           
static int POSIT_INFO_CSESPD
          Send the course and speed extra data with a posit
static int POSIT_INFO_DF
          Send direction finding extra data with a posit
static int POSIT_INFO_NONE
          Send no extra data with a posit
static int POSIT_INFO_PHG
          Send power, height and gain extra data with a posit
static int POSIT_INFO_RADIORNG
          Send radio range extra data with a posit
 boolean traceInPkt
           
 boolean traceOutPkt
           
 
Method Summary
 void addBadPacketListener(wonderly.jeaprs.aprs.BadPacketListener lis)
           
 void addDirectStation(java.lang.String call)
           
 void addHeardStation(java.lang.String call)
          Used to add a station's call to the set of calls heard by this station.
 void addPropertyChangeListener(java.beans.PropertyChangeListener lis)
          Adds a property Change listener to be notified when properties in this object are changed
 int getAltitude()
           
 int getBeaconInterval()
           
 java.lang.String getBeaconMessage()
           
 java.lang.String getCommPort()
          Set the name of the Serial communications port to use for TNC access
 java.lang.String getConfigFile()
          Gets the name of the application configuration file.
 int getCourse()
           
 java.lang.String getCurrentCall()
          Returns the currently refered to call sign based on the user selecting call signs from maps, tables or otherwise.
 java.lang.String getDefaultMap()
           
 int getDFPower()
           
 int getDirectivity()
           
 int getDirectStationCount()
           
 java.util.Enumeration getDirectStations()
           
 java.util.Date getDirectStationTime(java.lang.String call)
           
 int getGain()
           
 wonderly.jeaprs.aprs.packet.APRSGps getLastGPS()
          Returns the last valid NMEA sentence data.
 java.lang.String getMaidenHead()
          Returns the Maiden Head grid square string for this station
 long getMapLat()
           
 long getMapLon()
           
 int getMaxHeardStations()
           
 java.lang.String getMyCall()
          Get the call sign to use for this station
 long getMyLat()
           
 long getMyLon()
           
 boolean getOpenDefaultMap()
           
 java.lang.String getPath()
          Get the UNPROTO path to use for this station
 int getPositInfoType()
           
 int getPower()
           
static wonderly.jeaprs.aprs.data.APRS getPropertiesInstance()
           
 int getRadioRange()
           
 boolean getSendMaidenHeadInStatus()
           
 boolean getSendPosits()
           
 boolean getSendStatus()
           
 int getSpeed()
           
 int getStatInterval()
          Minutes interval between stat transmissions
 int getStationHeight()
           
 java.lang.String getStatusMessage()
           
 int getStrength()
           
 char getSymChar()
           
 char getSymTable()
           
 wonderly.jeaprs.aprs.data.APRSUI getUI()
          Gets the current APRSUI object used by this application
 java.lang.String getUnProto()
           
 boolean getUseRelativeDirection()
          For mobile ops, the direction indication of other stations can either be relative to the course of the mobile, or relative to north.
 java.util.Enumeration heardStations()
          Enumerations the stations heard by this station either direct or via a digipeater.
 boolean isBeaconMessaging()
           
 boolean isCheckMemory()
          If some features are memory intensive, they should check this return value to see if the user wants them to consider their memory use.
 boolean isDigipeating()
           
 boolean isDirty()
           
 boolean isKissMode()
           
 boolean isLowMemory()
           
 boolean isMessagingAvailable()
          Does this station has APRS text messaging facilities.
 boolean isSendingCseSpd()
           
 boolean isSendingDF()
           
 boolean isSendingPHP()
           
 boolean isSendingRange()
           
 boolean isSendTimeStatus()
           
 boolean isStartup()
          Is the JeAPRS system starting up.
 boolean isStatusMessaging()
           
 boolean isTimeInPosit()
           
 boolean isTraceInPackets()
           
 boolean isTraceOutPackets()
           
 void logBadPacket(byte[] arr, java.lang.Throwable ex)
           
 void notifyPropertyChange(java.beans.PropertyChangeEvent ev)
          Used to notify all listeners when a property change occurs.
 void removeBadPacketListener(wonderly.jeaprs.aprs.BadPacketListener lis)
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener lis)
          Removes a property change listener
 void setAltitude(int feet)
           
 void setBeaconInterval(int secs)
           
 void setBeaconMessage(java.lang.String str)
          Sets the posit beacon message string to use
 void setBeaconMessaging(boolean how)
          Set whether or not a message is sent when a posit beacon is sent.
 void setCheckMemory(boolean how)
          Used to control whether low memory conditions should control memory intensive features
 void setCommPort(java.lang.String port)
          Get the name of the Serial communications port to use for TNC access
 void setConfigFile(java.lang.String name)
          Set the name of the config file to use for this application
 void setCourse(int course)
          Sets the current course of the station.
 void setCurrentCall(java.lang.String call)
          Sets currently selected call sign being referred to.
 void setDefaultMap(java.lang.String name)
           
 void setDFPower(int rng)
           
 void setDigipeating(boolean how)
           
 void setDirectivity(int dir)
          Sets the encoded directivity of the station's antenna
 void setDirty(boolean how)
          sets the modified/dirty state of this object so that the application will know to save its contents
 void setGain(int gain)
          Sets the encoded gain associated with the stations antenna
 void setKissMode(boolean how)
          Configures whether JeAPRS is operating in Kiss mode.
 void setLastGPS(wonderly.jeaprs.aprs.packet.APRSGps gps)
          Sets the current GPS information pertaining to this station.
 void setLowMemory(boolean how)
          This method is used by code in the application which can determine whether the application is running in a low memory environment.
 void setMaidenHead(java.lang.String str)
          Sets the MaidenHead grid string used for the location of this station.
 void setMapLat(long lat)
          Set last map latitude in seconds (include fractions of a second)
 void setMapLon(long lon)
          Set last map longitude in seconds (include fractions of a second)
 void setMaxHeardStations(int max)
          Sets the maximum number of heard stations that should be tracked by the application.
 void setMessagingAvailable(boolean how)
          set whether this station has APRS text messaging facilities
 void setMyCall(java.lang.String newCall)
          Sets the call sign to use for this station
 void setMyLat(long lat)
          Set latitude in seconds (include fractions of a second)
 void setMyLon(long lon)
          Set longitude in seconds (include fractions of a second)
 void setOpenDefaultMap(boolean how)
           
 void setPath(java.lang.String newPath)
          Sets the UNPROTO path to use for packet transmissions from this station.
 void setPositInfoType(int how)
           
 void setPower(int power)
          Sets the APRS power value.
 void setRadioFrequency(wonderly.jeaprs.aprs.data.RadioFrequency freq)
          This method is used to set radios to particular frequencies.
 void setRadioRange(int rng)
           
 void setSendingCseSpd(boolean how)
           
 void setSendingDF(boolean how)
           
 void setSendingPHP(boolean how)
           
 void setSendingRange(boolean how)
           
 void setSendMaidenHeadInStatus(boolean how)
           
 void setSendPosits(boolean how)
          Set whether this station sends out position reports
 void setSendStatus(boolean how)
          Set whether this station sends out status reports
 void setSendTimeStatus(boolean how)
           
 void setSpeed(int speed)
          Sets the current speed of the station.
 void setStartup(boolean how)
          Set the startup state of the system
 void setStatInterval(int val)
          Returns minute interval for status messages
 void setStationHeight(int height)
          Sets the encoded station's antenna height
 void setStatusMessage(java.lang.String str)
          Sets the status message to use for the status for this station.
 void setStatusMessaging(boolean how)
          Set whether or not status messages/packets are sent for this station
 void setStrength(int strength)
          Sets the encoded signal strength
 void setSymChar(char sym)
          Sets the symbol to use for this stations icon.
 void setSymTable(char tab)
          Sets the symbol table character to use either '/' or '\\' for denoting the symbol table to use for the symbol associated with this station, or one of the letters, 'A'-'Z' or numbers '0'-'9' to overlay a symbol from the alternate symbol table with such a character.
 void setTimeInPosit(boolean how)
           
 void setTraceInPackets(boolean how)
           
 void setTraceOutPackets(boolean how)
           
 void setUI(wonderly.jeaprs.aprs.data.APRSUI ui)
          Sets the APRSUI object to be used by this application
 void setUnProto(java.lang.String val)
          Set the UnProto string used for TNC initialization.
 void setUseRelativeDirection(boolean how)
          Sets whether directions to other stations should be indicated as relative to the course of this station or relative to north.
 void writeProperties()
          Called to notify the application that the properties should be saved on exit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

POSIT_INFO_NONE

public static final int POSIT_INFO_NONE
Send no extra data with a posit

See Also:
Constant Field Values

POSIT_INFO_CSESPD

public static final int POSIT_INFO_CSESPD
Send the course and speed extra data with a posit

See Also:
Constant Field Values

POSIT_INFO_PHG

public static final int POSIT_INFO_PHG
Send power, height and gain extra data with a posit

See Also:
Constant Field Values

POSIT_INFO_RADIORNG

public static final int POSIT_INFO_RADIORNG
Send radio range extra data with a posit

See Also:
Constant Field Values

POSIT_INFO_DF

public static final int POSIT_INFO_DF
Send direction finding extra data with a posit

See Also:
Constant Field Values

beaconSecs

public int beaconSecs

traceInPkt

public boolean traceInPkt

traceOutPkt

public boolean traceOutPkt
Method Detail

isTraceInPackets

public boolean isTraceInPackets()

setTraceInPackets

public void setTraceInPackets(boolean how)

isTraceOutPackets

public boolean isTraceOutPackets()

setTraceOutPackets

public void setTraceOutPackets(boolean how)

isStartup

public boolean isStartup()
Is the JeAPRS system starting up. This is property, when set to 'false' signals the end of system initialization indicating that all modules are ready for operation


setStartup

public void setStartup(boolean how)
Set the startup state of the system

See Also:
isStartup()

setRadioFrequency

public void setRadioFrequency(wonderly.jeaprs.aprs.data.RadioFrequency freq)
This method is used to set radios to particular frequencies. PropertyChangeListeners will get these events and can configure/QSY radios based on the information in the event and how they have been configured.


setUnProto

public void setUnProto(java.lang.String val)
Set the UnProto string used for TNC initialization.


getUnProto

public java.lang.String getUnProto()

addDirectStation

public void addDirectStation(java.lang.String call)

getDirectStations

public java.util.Enumeration getDirectStations()

getDirectStationCount

public int getDirectStationCount()

getDirectStationTime

public java.util.Date getDirectStationTime(java.lang.String call)

addBadPacketListener

public void addBadPacketListener(wonderly.jeaprs.aprs.BadPacketListener lis)

removeBadPacketListener

public void removeBadPacketListener(wonderly.jeaprs.aprs.BadPacketListener lis)

logBadPacket

public void logBadPacket(byte[] arr,
                         java.lang.Throwable ex)

getPropertiesInstance

public static wonderly.jeaprs.aprs.data.APRS getPropertiesInstance()

getDefaultMap

public java.lang.String getDefaultMap()

setDefaultMap

public void setDefaultMap(java.lang.String name)

getOpenDefaultMap

public boolean getOpenDefaultMap()

setOpenDefaultMap

public void setOpenDefaultMap(boolean how)

isKissMode

public boolean isKissMode()

setKissMode

public void setKissMode(boolean how)
Configures whether JeAPRS is operating in Kiss mode. TNC implementation should listen to changes in this property and change their behavior where applicable. When this property is false, parts of JeAPRS may be unable to function correctly if they are doing anything that requires explicit control of the AX.25 packet contents. In particular, digipeating can not take place with call sign substitution and the path must be truncated on the left of the last digipeating station so that the next digi just sees the remaining path. This path truncation is a horrible sitution, but alas...

See Also:
APRS

isSendTimeStatus

public boolean isSendTimeStatus()

isMessagingAvailable

public boolean isMessagingAvailable()
Does this station has APRS text messaging facilities. This setting is used to set the message decoration type used for the POSIT message to tell remote stations whether or not messaging is available at this station so they won't just be talking to a black hole.

Returns:
true if messaging is available, false if not.

setMessagingAvailable

public void setMessagingAvailable(boolean how)
set whether this station has APRS text messaging facilities


isTimeInPosit

public boolean isTimeInPosit()

setTimeInPosit

public void setTimeInPosit(boolean how)

setSendTimeStatus

public void setSendTimeStatus(boolean how)

getPositInfoType

public int getPositInfoType()

setPositInfoType

public void setPositInfoType(int how)

getRadioRange

public int getRadioRange()

getAltitude

public int getAltitude()

setAltitude

public void setAltitude(int feet)

setDigipeating

public void setDigipeating(boolean how)

isDigipeating

public boolean isDigipeating()

isSendingPHP

public boolean isSendingPHP()

isSendingCseSpd

public boolean isSendingCseSpd()

isSendingRange

public boolean isSendingRange()

isSendingDF

public boolean isSendingDF()

setSendingPHP

public void setSendingPHP(boolean how)

setSendingCseSpd

public void setSendingCseSpd(boolean how)

setSendingRange

public void setSendingRange(boolean how)

setSendingDF

public void setSendingDF(boolean how)

setRadioRange

public void setRadioRange(int rng)

getDFPower

public int getDFPower()

setDFPower

public void setDFPower(int rng)

heardStations

public java.util.Enumeration heardStations()
Enumerations the stations heard by this station either direct or via a digipeater.


addHeardStation

public void addHeardStation(java.lang.String call)
Used to add a station's call to the set of calls heard by this station. Duplicates are ignored. The "heardStations" property will have a changed event fired with the "oldValue" being all the stations known, and the "newValue" being the string value of the new call added. This method is synchronized to avoid sending a property change event twice for adding the same station.


getMaxHeardStations

public int getMaxHeardStations()
Returns:
the maximum number of stations that should be tracked and displayed to the user in application displays

setMaxHeardStations

public void setMaxHeardStations(int max)
Sets the maximum number of heard stations that should be tracked by the application. heardStations() will always track all heard stations so that such information is available. But the application should use getMaxHeardStations() to control how many total stations that it shows the user in displays.


addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener lis)
Adds a property Change listener to be notified when properties in this object are changed


removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener lis)
Removes a property change listener


notifyPropertyChange

public void notifyPropertyChange(java.beans.PropertyChangeEvent ev)
Used to notify all listeners when a property change occurs.


setUI

public void setUI(wonderly.jeaprs.aprs.data.APRSUI ui)
Sets the APRSUI object to be used by this application


getUI

public wonderly.jeaprs.aprs.data.APRSUI getUI()
Gets the current APRSUI object used by this application


getUseRelativeDirection

public boolean getUseRelativeDirection()
For mobile ops, the direction indication of other stations can either be relative to the course of the mobile, or relative to north. This method tells which the user has selected

Returns:
true if the user wants directions relative to their course, false for directions relative to compass north

setUseRelativeDirection

public void setUseRelativeDirection(boolean how)
Sets whether directions to other stations should be indicated as relative to the course of this station or relative to north.

Parameters:
how - true for course relative direction to others, false for relative to north.
See Also:
getUseRelativeDirection()

isCheckMemory

public boolean isCheckMemory()
If some features are memory intensive, they should check this return value to see if the user wants them to consider their memory use. If this method returns true, then they should honor the return of isLowMemory() to limit their memory use as much as possible.


setCheckMemory

public void setCheckMemory(boolean how)
Used to control whether low memory conditions should control memory intensive features

Parameters:
how - true to cause memory availability to be checked.

isLowMemory

public boolean isLowMemory()
Returns:
true if we are in a 32M or less physical memory environment

setLowMemory

public void setLowMemory(boolean how)
This method is used by code in the application which can determine whether the application is running in a low memory environment. The user can also set this value directly without the application needing to worry about it via the lowMemory property's value.

Parameters:
how - true if memory is scarce and features should be limited because of this
See Also:
setCheckMemory(boolean)

getConfigFile

public java.lang.String getConfigFile()
Gets the name of the application configuration file. This file's format is defined by the application.


setConfigFile

public void setConfigFile(java.lang.String name)
Set the name of the config file to use for this application


getCommPort

public java.lang.String getCommPort()
Set the name of the Serial communications port to use for TNC access


setCommPort

public void setCommPort(java.lang.String port)
Get the name of the Serial communications port to use for TNC access

Parameters:
port - the name of the port as in COM1, COM2 or even /dev/ttyS1 in linux

setCurrentCall

public void setCurrentCall(java.lang.String call)
Sets currently selected call sign being referred to. Modules should call this method to set the call sign if the user selects a packet or other entity that has an associated "from" call sign. This allows other actions within JeAPRS to refer to this call sign.


getCurrentCall

public java.lang.String getCurrentCall()
Returns the currently refered to call sign based on the user selecting call signs from maps, tables or otherwise.

See Also:
setCurrentCall(String)

getLastGPS

public wonderly.jeaprs.aprs.packet.APRSGps getLastGPS()
Returns the last valid NMEA sentence data. Note that if the last was $GPRMC, then altitude is not available. Similarly if the last was $GPGGA, then heading and course is not available.


setLastGPS

public void setLastGPS(wonderly.jeaprs.aprs.packet.APRSGps gps)
Sets the current GPS information pertaining to this station. The APRSData instance passed will pertain to some NMEA sentence such as $GPRMC or $GPGGA. Some of the fields will be zero because they do not occur in the sentence.


getMyCall

public java.lang.String getMyCall()
Get the call sign to use for this station


getPath

public java.lang.String getPath()
Get the UNPROTO path to use for this station


setPath

public void setPath(java.lang.String newPath)
Sets the UNPROTO path to use for packet transmissions from this station.


setMyCall

public void setMyCall(java.lang.String newCall)
Sets the call sign to use for this station

See Also:
getMyCall()

setMaidenHead

public void setMaidenHead(java.lang.String str)
Sets the MaidenHead grid string used for the location of this station.


getMaidenHead

public java.lang.String getMaidenHead()
Returns the Maiden Head grid square string for this station


getSendMaidenHeadInStatus

public boolean getSendMaidenHeadInStatus()

setSendMaidenHeadInStatus

public void setSendMaidenHeadInStatus(boolean how)

setPower

public void setPower(int power)
Sets the APRS power value. This is NOT the watts output, but rather the precomputed encoding value, 0-9 for PHG.


getPower

public int getPower()
Returns:
the current, encoded power value for this station for PHG encoding

setStrength

public void setStrength(int strength)
Sets the encoded signal strength


getStrength

public int getStrength()
Returns:
the encoded signal strength

setStationHeight

public void setStationHeight(int height)
Sets the encoded station's antenna height


getStationHeight

public int getStationHeight()
Returns:
the encoded station's antenna height

setCourse

public void setCourse(int course)
Sets the current course of the station. Should be set to 0 when the station is not mobile.


getCourse

public int getCourse()
Returns:
the current course of the station. Should be 0 when the station is not mobile.

setSpeed

public void setSpeed(int speed)
Sets the current speed of the station. When zero, course should be set to zero as well.

See Also:
setCourse(int)

getSpeed

public int getSpeed()
Returns:
the speed of the station

setGain

public void setGain(int gain)
Sets the encoded gain associated with the stations antenna


getGain

public int getGain()
Returns:
the encoded gain of the stations antenna

setDirectivity

public void setDirectivity(int dir)
Sets the encoded directivity of the station's antenna


getDirectivity

public int getDirectivity()
Returns:
the encoded directivity of the station's antenna

setSymTable

public void setSymTable(char tab)
Sets the symbol table character to use either '/' or '\\' for denoting the symbol table to use for the symbol associated with this station, or one of the letters, 'A'-'Z' or numbers '0'-'9' to overlay a symbol from the alternate symbol table with such a character.


setSymChar

public void setSymChar(char sym)
Sets the symbol to use for this stations icon. The symTable property also affects what is used.

See Also:
setSymTable(char)

getSymTable

public char getSymTable()
Returns:
the symbol table to use for symbol selection, or the overlay character to use on top of an alternate symbol table symbol.

getSymChar

public char getSymChar()
Returns:
the current symbol to use for this station

getStatusMessage

public java.lang.String getStatusMessage()
Returns:
the text of the status message to use for status packets from this station

setStatusMessage

public void setStatusMessage(java.lang.String str)
Sets the status message to use for the status for this station.


isStatusMessaging

public boolean isStatusMessaging()
Returns:
true if status messages should be sent, false if not

setStatusMessaging

public void setStatusMessaging(boolean how)
Set whether or not status messages/packets are sent for this station


isBeaconMessaging

public boolean isBeaconMessaging()
Returns:
true if position beaconing should include a message for this station

setBeaconMessaging

public void setBeaconMessaging(boolean how)
Set whether or not a message is sent when a posit beacon is sent.


getBeaconMessage

public java.lang.String getBeaconMessage()
Returns:
the message to be sent with the posit beacon

setBeaconMessage

public void setBeaconMessage(java.lang.String str)
Sets the posit beacon message string to use


setSendPosits

public void setSendPosits(boolean how)
Set whether this station sends out position reports


getSendPosits

public boolean getSendPosits()
Returns:
true if the station should send out position reports, false if not

setSendStatus

public void setSendStatus(boolean how)
Set whether this station sends out status reports


getSendStatus

public boolean getSendStatus()
Returns:
true if the station should send out status reports, false if not

setMyLon

public void setMyLon(long lon)
Set longitude in seconds (include fractions of a second)


getMyLon

public long getMyLon()
Returns:
longitudes in seconds (including fractions of a second)

setBeaconInterval

public void setBeaconInterval(int secs)

getBeaconInterval

public int getBeaconInterval()

setMyLat

public void setMyLat(long lat)
Set latitude in seconds (include fractions of a second)


getMyLat

public long getMyLat()
Returns:
latitudes in seconds (including fractions of a second)

setMapLon

public void setMapLon(long lon)
Set last map longitude in seconds (include fractions of a second)


getMapLon

public long getMapLon()
Returns:
last map longitude in seconds (including fractions of a second)

setMapLat

public void setMapLat(long lat)
Set last map latitude in seconds (include fractions of a second)


getMapLat

public long getMapLat()
Returns:
last map latitude in seconds (including fractions of a second)

getStatInterval

public int getStatInterval()
Minutes interval between stat transmissions


setStatInterval

public void setStatInterval(int val)
Returns minute interval for status messages


isDirty

public boolean isDirty()
Returns:
true if this object has been updated since last time setDirty(false) was called, false if not

setDirty

public void setDirty(boolean how)
sets the modified/dirty state of this object so that the application will know to save its contents


writeProperties

public void writeProperties()
Called to notify the application that the properties should be saved on exit. Equivalent to setDirty(true).