public class BeaconData extends java.lang.Object implements AX25FrameSource, GpsDataListener, java.lang.Cloneable, SendableMessage, java.io.Serializable
| 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 |
|---|---|
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.
|
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.
|
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.
|
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.
|
| 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.
|
AX25Message |
dup()
Creates and returns a copy of this Message.
|
byte[] |
getBody(boolean countTransmission,
byte protocolId,
AX25Frame frame)
Get an instance of this message, suitable for transmitting.
|
Connector |
getConnector()
Specify the PortConnector this message should be transmitted through.
|
AX25Frame |
getFrame(boolean incrementXmtCount,
BeaconData.BeaconType overrideType,
byte protocolId)
Get the AX25Frame of the data to transmit.
|
AX25Frame[] |
getFrames(boolean incrementXmtCount,
byte protocolId,
java.lang.String senderCallsign)
Get one or more AX25Frames of the data to transmit.
|
int |
getNumTransmitsBeforeDecay()
Get the number of cycles for a complete iteration over the proportional pathing digipeat path set.
|
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 |
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.
|
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 |
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.
|
java.lang.String |
toString() |
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 java.lang.String beaconName
public BeaconData.BeaconType type
public BeaconData.PositionType positionType
BeaconData.BeaconType.POSITIONpublic boolean enabled
public boolean useGpsForPosition
GpsFix,
GPSDistributorpublic double latitude
public double longitude
public boolean reportSpeed
useGpsForPositionpublic boolean reportAltitude
fixedAltitudeM,
useGpsForPositionpublic float fixedAltitudeM
reportAltitudepublic 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 java.lang.String[] digipeaters
public static final java.lang.String[] DIRECTIVITY
directionalitypublic byte[] getBody(boolean countTransmission,
byte protocolId,
AX25Frame frame)
getBody in interface SendableMessagecountTransmission - number of times the message has been transmitted.protocolId - AX.25 protocol ID to generate the message in, or 0 for default protocol; currently,
only NOLVL3 (APRS) and OPENTRAC are supported.frame - 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.parsedAX25Msgpublic AX25Frame[] getFrames(boolean incrementXmtCount, byte protocolId, java.lang.String senderCallsign)
getFrames in interface AX25FrameSourceincrementXmtCount - 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); zero to indicate current protocolsenderCallsign - 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, byte 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); zero to indicate current protocolpublic int getNumTransmitsBeforeDecay()
getNumTransmitsBeforeDecay in interface AX25FrameSourcepublic void resetTransmitCount()
public Connector getConnector()
getConnector in interface AX25FrameSourceConnector.CAP_XMT_PACKET_DATApublic void gpsDataUpdated(GPSDistributor distributor, GpsFix currentFix, boolean isLocal, java.lang.String source)
gpsDataUpdated in interface GpsDataListenerdistributor - 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 GpsDataListenerdistributor - 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 void queueNow()
public void queueForTransmission()
public void cancelTransmission()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isEnabled()
isEnabled in interface SendableMessagepublic java.lang.Object clone()
clone in class java.lang.Objectpublic 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 AX25Message dup()
dup in interface SendableMessagepublic boolean isMatchingBeacon(java.lang.String[] allowedBeacons)
allowedBeacons - String array of acceptable beacon names for the port