public class BeaconData extends java.lang.Object implements AX25FrameSource, GpsDataListener, java.lang.Cloneable, SendableMessage, java.io.Serializable, SetBeaconRatesIfc
Modifier and Type | Class and Description |
---|---|
static class |
BeaconData.BeaconType
Enum defining the APRS message formats that YAAC can use for position beacons.
|
static class |
BeaconData.PositionType
Enum specifying the specific APRS Position Report message type code used for BeaconType.POSITION
and BeaconType.COMPRESSED beacon messages in APRS.
|
Modifier and Type | Field and Description |
---|---|
float |
ambiguity
The desired ambiguity of reported location data, in fractions of a degree.
|
java.lang.String |
beaconName
The human-readable identifier for this particular BeaconData object
|
XmitEncoding |
ctcss
Specification of tone or digital squelch used by this repeater.
|
int |
decayRatio
Decay ratio when slowing down the beacon; should be 2 or 3.
|
static double |
DEFAULT_FIXED_LATITUDE
The default latitude for new deployments is somewhere in the middle of the USA.
|
static double |
DEFAULT_FIXED_LONGITUDE
The default longitude for new deployments is somewhere in the middle of the USA.
|
java.lang.String[] |
digipeaters
Digipeater alias combinations to be used for transmitting this beacon, in proportional pathing preference order.
|
byte |
directionality
PHG for compass octant of antenna directionality.
|
static java.lang.String[] |
DIRECTIVITY
Display directionality octant strings for the PHG directionality value.
|
boolean |
enabled
Indicate whether this particular beacon should be transmitted.
|
float |
fixedAltitudeM
The fixed altitude of this station in meters above mean sea level.
|
java.lang.String |
freeText
Free-text comment to be appended after all standard-formatted beacon fields.
|
byte |
gain
PHG code for antenna gain in dB.
|
byte |
height
PHG code for antenna height about average terrain elevation.
|
int |
initialRateSecs
Initial transmit interval for this beacon in seconds.
|
double |
latitude
Fixed position latitude in fractional degrees North.
|
double |
longitude
Fixed position longitude in fractional degrees East.
|
double |
monitorFreq
The frequency in megaHertz on which this station is doing audio monitoring (zero if no audio monitor).
|
static java.lang.String |
MYCALL
Name for default BeaconData record.
|
static java.lang.String |
NOCALL
Reserved "callsign" for not-yet-specified callsign.
|
short |
offset
The repeater shift direction and magnitude for the repeater input frequency of this station (+1 or -1
for default shift, + or - with an actual number in kiloHertz for non-standard shift).
|
BeaconData.PositionType |
positionType
The sub-variant of human-readable position report message format to use.
|
byte |
power
PHG code for power level.
|
boolean |
reportAltitude
Specify whether altitude (fixed or GPS-reported) should be reported in position reports.
|
boolean |
reportSpeed
Specify whether local GPS speed should be reported in position reports.
|
boolean |
showDFS
Specifies whether DFS (direction finding signal) information should be reported in the position report's free-text comment.
|
boolean |
showPHG
Specify whether PHG (power-height-gain) should be reported in the position report's free-text comment.
|
int |
slowRateSecs
Slow stable transmit rate for non-changing station, in seconds.
|
short |
status
MicE status to report when generating MicE format position reports.
|
char |
symbolCode
The APRS symbol code for this station's symbol.
|
char |
symTableId
The APRS symbol table ID for this station's symbol; this may be an overlay character.
|
BeaconData.BeaconType |
type
APRS format to use for encoding position beacon packet.
|
boolean |
useGpsForPosition
Specifies whether this beacon should ignore its fixed latitude and longitude and use the current
position reported by the local GPS receiver.
|
boolean |
useWeather
Specify whether local weather data should be transmitted in the beacon.
|
NO_FRAMES
Constructor and Description |
---|
BeaconData() |
Modifier and Type | Method and Description |
---|---|
void |
addBeaconChangeListener(BeaconChangeListener l)
Register to be informed when the beacon parameters are changed.
|
void |
cancelTransmission()
Cancel all upcoming transmissions of the beacon.
|
java.lang.Object |
clone()
Creates and returns a copy of this object.
|
void |
copyInto(BeaconData bd,
java.util.prefs.Preferences root,
java.lang.String beaconName)
Copy the contents of this BeaconData object into the specified one, and tell the other one that
it was changed if any changes occur.
|
static void |
deleteFromPreferences(java.util.prefs.Preferences root,
java.lang.String beaconName)
Delete the current beacon settings from Java Preferences.
|
void |
disableForTransmit()
Specify that message should no longer be transmitted.
|
AX25Message |
dup()
Creates and returns a copy of this Message.
|
byte[] |
getBody(boolean countTransmission,
ProtocolFamily protocolId,
AX25Frame frame)
Get an instance of this message, suitable for transmitting.
|
Connector |
getConnector()
Specify the PortConnector this message should be transmitted through.
|
int |
getDecayRatio()
Get the scaling factor by which the message repeat interval is enlarged
(until the default slow send rate is reached).
|
AX25Frame |
getFrame(boolean incrementXmtCount,
BeaconData.BeaconType overrideType,
ProtocolFamily protocolId)
Get the AX25Frame of the data to transmit.
|
AX25Frame[] |
getFrames(boolean incrementXmtCount,
ProtocolFamily protocolId,
java.lang.String senderCallsign)
Get one or more AX25Frames of the data to transmit.
|
int |
getInitialSendRate()
Get the time interval between retransmissions when a message is newly
introduced into the system.
|
long |
getLastSendTime()
Get the last time this BeaconData was transmitted.
|
int |
getNumTransmitsBeforeDecay()
Get the number of cycles for a complete iteration over the proportional pathing digipeat path set.
|
int |
getSlowSendRate()
The slowest rate a message should be sent.
|
void |
gpsDataUpdated(GPSDistributor distributor,
GpsFix currentFix,
boolean isLocal,
java.lang.String source)
Do not call.
|
boolean |
isEnabled()
Test if message should still be transmitted.
|
boolean |
isEquivalent(BeaconData bd)
Compare the contents of this BeaconData object against the specified one, and report if they have the same values
(excluding the beacon name).
|
boolean |
isMatchingBeacon(java.lang.String[] allowedBeacons)
Test whether or not this particular beacon is on the approved list for a given APRS or OpenTRAC transmit port.
|
boolean |
isUseGpsForPosition()
Indicate whether beacon data source can dynamically change its position (latitude/longitude),
such as for a mobile station with a GPS.
|
void |
queueForTransmission()
Queue the beacon for transmission after the next transmission interval.
|
void |
queueNow()
Queue the beacon for immediate transmission.
|
static BeaconData |
readFromPreferences(java.util.prefs.Preferences root,
java.lang.String beaconName)
Load the beacon settings from Java Preferences.
|
void |
removeBeaconChangeListener(BeaconChangeListener l)
Unregister from being informed when the beacon parameters are changed.
|
void |
requeue()
Reschedule the beacon based on its last transmission time and any changes in
retransmit interval.
|
void |
resetTransmitCount()
Reinitialize the transmission and backoff counters as if the station was newly on the air.
|
void |
satDataUpdated(GPSDistributor distributor,
SatelliteCatalog satCatalog,
boolean isLocal,
java.lang.String source)
Do not call.
|
void |
setDecayRatio(int decayRatio)
Set the scaling factor by which the message repeat interval is enlarged
(until the default slow send rate is reached).
|
void |
setInitialSendRate(int initialSendRate)
Set the time interval between retransmissions when a message is newly
introduced into the system.
|
void |
setSlowSendRate(int slowSendRate)
Set the slowest rate a message should be sent.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
void |
writeToPreferences(java.util.prefs.Preferences root,
java.lang.String beaconName)
Store the current beacon settings in Java Preferences.
|
public static final java.lang.String MYCALL
public static final java.lang.String NOCALL
public static final double DEFAULT_FIXED_LATITUDE
public static final double DEFAULT_FIXED_LONGITUDE
public java.lang.String beaconName
public BeaconData.BeaconType type
public BeaconData.PositionType positionType
BeaconData.BeaconType.POSITION
public boolean enabled
public boolean useGpsForPosition
GpsFix
,
GPSDistributor
public double latitude
public double longitude
public float ambiguity
public boolean reportSpeed
useGpsForPosition
public boolean reportAltitude
fixedAltitudeM
,
useGpsForPosition
public float fixedAltitudeM
reportAltitude
public char symTableId
public char symbolCode
public double monitorFreq
public short offset
public XmitEncoding ctcss
public short status
public boolean showPHG
public boolean showDFS
public byte power
public byte height
public byte gain
public byte directionality
public java.lang.String freeText
public boolean useWeather
public int initialRateSecs
public int decayRatio
public int slowRateSecs
public java.lang.String[] digipeaters
public static final java.lang.String[] DIRECTIVITY
directionality
public byte[] getBody(boolean countTransmission, ProtocolFamily protocolId, AX25Frame frame)
getBody
in interface SendableMessage
countTransmission
- number of times the message has been transmitted.protocolId
- ProtocolFamily to generate the message inframe
- AX25Frame into which the message will be placed; the decoded message (as opposed to the byte
array encoding) should be stored into the field frame.parsedAX25MsgAX25Frame.parsedAX25Msg
public AX25Frame[] getFrames(boolean incrementXmtCount, ProtocolFamily protocolId, java.lang.String senderCallsign)
getFrames
in interface AX25FrameSource
incrementXmtCount
- indicate whether the transmit counter (used to cycle through
proportional pathing) should be incrementedprotocolId
- indicate the protocol to generate this frame for (not relevant for
digipeated frames)senderCallsign
- String of local callsign sending this message (may be ignored if digipeating
a message from another station)public AX25Frame getFrame(boolean incrementXmtCount, BeaconData.BeaconType overrideType, ProtocolFamily protocolId)
incrementXmtCount
- indicate whether the transmit counter (used to cycle through
proportional pathing) should be incrementedoverrideType
- BeaconType to use to encode this beacon position report, or null to use configured formatprotocolId
- indicate the protocol to generate this frame for (not relevant for
digipeated frames)public int getNumTransmitsBeforeDecay()
getNumTransmitsBeforeDecay
in interface AX25FrameSource
public void resetTransmitCount()
public Connector getConnector()
getConnector
in interface AX25FrameSource
Connector.CAP_XMT_PACKET_DATA
public boolean isUseGpsForPosition()
isUseGpsForPosition
in interface SetBeaconRatesIfc
public void gpsDataUpdated(GPSDistributor distributor, GpsFix currentFix, boolean isLocal, java.lang.String source)
gpsDataUpdated
in interface GpsDataListener
distributor
- instance of the GPSDistributorcurrentFix
- current position data reported by the local GPSisLocal
- boolean true if this is GPS data for the local station, false if for a remote GPS receiversource
- String name assigned to remote GPS receiver, or null if for the local receiverpublic void satDataUpdated(GPSDistributor distributor, SatelliteCatalog satCatalog, boolean isLocal, java.lang.String source)
satDataUpdated
in interface GpsDataListener
distributor
- instance of the GPSDistributorsatCatalog
- updated SatelliteCatalog instanceisLocal
- boolean true if this is GPS data for the local station, false if for a remote GPS receiversource
- String name assigned to remote GPS receiver, or null if for the local receiverpublic void addBeaconChangeListener(BeaconChangeListener l)
l
- BeaconChangeListener to registerpublic void removeBeaconChangeListener(BeaconChangeListener l)
l
- BeaconChangeListener to unregisterpublic void writeToPreferences(java.util.prefs.Preferences root, java.lang.String beaconName) throws java.util.prefs.BackingStoreException
root
- the Preferences node that is the base for YAAC configuration databeaconName
- String name of this beacon instancejava.util.prefs.BackingStoreException
- if Preferences could not be updatedpublic static BeaconData readFromPreferences(java.util.prefs.Preferences root, java.lang.String beaconName) throws java.util.prefs.BackingStoreException
root
- the Preferences node that is the base for YAAC configuration databeaconName
- the String name of the beacon instance to loadjava.util.prefs.BackingStoreException
- if the beacon Preferences could not be readpublic static void deleteFromPreferences(java.util.prefs.Preferences root, java.lang.String beaconName) throws java.util.prefs.BackingStoreException
root
- the Preferences node that is the base for YAAC configuration databeaconName
- String name of this beacon instancejava.util.prefs.BackingStoreException
- if Preferences could not be updatedpublic void queueNow()
public void requeue()
public void queueForTransmission()
public void cancelTransmission()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isEnabled()
isEnabled
in interface SendableMessage
public void disableForTransmit()
disableForTransmit
in interface SendableMessage
public java.lang.Object clone()
clone
in class java.lang.Object
public void copyInto(BeaconData bd, java.util.prefs.Preferences root, java.lang.String beaconName)
bd
- target BeaconData to copy intoroot
- base Preferences object into which updated BeaconData should be saved (or null to not save)beaconName
- String name of the target BeaconData instancepublic boolean isEquivalent(BeaconData bd)
bd
- target BeaconData to copy intopublic AX25Message dup()
dup
in interface SendableMessage
public boolean isMatchingBeacon(java.lang.String[] allowedBeacons)
allowedBeacons
- String array of acceptable beacon names for the portpublic int getDecayRatio()
getDecayRatio
in interface SetBeaconRatesIfc
public void setDecayRatio(int decayRatio)
setDecayRatio
in interface SetBeaconRatesIfc
decayRatio
- int decay ratio (should be 2 or 3)public int getInitialSendRate()
getInitialSendRate
in interface SetBeaconRatesIfc
public void setInitialSendRate(int initialSendRate)
setInitialSendRate
in interface SetBeaconRatesIfc
initialSendRate
- send interval in secondspublic int getSlowSendRate()
getSlowSendRate
in interface SetBeaconRatesIfc
public void setSlowSendRate(int slowSendRate)
setSlowSendRate
in interface SetBeaconRatesIfc
slowSendRate
- transmission interval in secondspublic long getLastSendTime()