public class ObjectReport extends PositionMessage implements ScopeableMessage, SetBeaconRatesIfc
AX25Message.Precedence
Modifier and Type | Field and Description |
---|---|
int |
decayRatio
The ratio of expansion of the transmission interval as the rate slows from the fast rate to
the slow rate.
|
java.lang.String[] |
digipeatPaths
Digipeating paths (in proportional pathing order) for transmitting locally-originated Objects.
|
int |
fastSendRate
The transmission rate to initially use for this Object.
|
char |
life
Flag indicating whether Object is still active (alive) or has been decommissioned (dead).
|
static int |
NUM_KILLED_TRANSMISSIONS
The number of times a "killed" Object/Item should be transmitted so
everyone knows it is killed.
|
java.lang.String |
objectName
Name of Object or Item.
|
java.lang.String |
qruCategory
QRU category to associate with locally-originated Item, or null for no QRU group.
|
java.lang.String |
savedTimestamp
Timestamp in Object message (null for Items).
|
Scope |
scope
Scope for the transmission of locally-originated Objects.
|
int |
slowSendRate
The transmission rate to decay to for this Object.
|
abc, altitude, altitudeUnit, COMPRESSED_LAT_SCALING, CONV_MPH_TO_METERS_PER_SEC, DHM, enabledForTransmit, fLatitude, fLatPrecision, fLongitude, fmtMonitorFreq, HMS, HUNDREDTH_MINUTE_F, isCustom, latitude, LN_BASE1_08, longitude, ONE_DEGREE_F, ONE_MINUTE_F, TEN_MINUTES_F, TENTH_MINUTE_F
appendCR, APRS_AND_OPENTRAC_AND_RAW, APRS_AND_RAW, comment, msgType, S_PERMANENT, S_PERMANENT_UC, symbolCode, symTableId
APRS_AND_OPENTRAC, ax25Frame, extensions, invalid, originatingCallsign, originatingDest, PERMANENT, rcptTime, thirdParty, timestamp, UTC
Constructor and Description |
---|
ObjectReport(boolean isItem,
java.lang.String objectName,
boolean alive,
java.util.Date date,
char symTableId,
char symbolCode)
Create an ObjectReport suitable for transmission with the basic parameters filled in (some fields
will still have to be filled before the message is safe to transmit).
|
ObjectReport(byte[] body,
int offset,
java.lang.String tp,
AX25Callsign[] digipeaters,
long rcvTimestamp)
Constructor for Object or Item message when decoding a binary AX.25 frame.
|
ObjectReport(byte[] body,
int offset,
java.lang.String tp,
long rcvTimestamp)
Constructor for Object or Item message when decoding a binary AX.25 frame.
|
ObjectReport(java.lang.String strBody,
long rcvTimestamp)
Constructor for Item reports embedded in a Message (the Item-in-Msg encapsulation)
|
Modifier and Type | Method and Description |
---|---|
boolean |
bodyEquals(AX25Message o)
Compare the contents of the body of the message, reporting if they match.
|
ObjectReport |
createObjectFromThisPosition()
Create an ObjectReport from this PositionMessage.
|
void |
disableForTransmit()
Specify that message should no longer be transmitted.
|
byte[] |
getBody(boolean countTransmission,
ProtocolFamily protocolId,
AX25Frame frame)
Get an instance of this message, suitable for transmitting.
|
int |
getDecayRatio()
Get the scaling factor by which the message repeat interval is enlarged
(until the default slow send rate is reached).
|
int |
getInitialSendRate()
Get the time interval between retransmissions when a message is newly
introduced into the system.
|
java.lang.String |
getObjectName()
Report the name of the Object or Item.
|
Scope |
getScope()
Get the transmission scope for this message (so the digipeat path can be derived).
|
int |
getSlowSendRate()
The slowest rate a message should be sent.
|
java.lang.String |
getStringAPRSBody(boolean countTransmission)
Build the transmittable body of a APRS Object or Item message from this data structure,
|
boolean |
isAlive()
Test if Object/Item is still alive.
|
boolean |
isEnabled()
Test if message should still be transmitted.
|
boolean |
isSetEnabled()
Report whether the enable flag is set for this message (independent of expiration or limited
scope).
|
boolean |
isUseGpsForPosition()
Indicate whether beacon data source can dynamically change its position (latitude/longitude),
such as for a mobile station with a GPS.
|
java.lang.String |
paramString()
Descriptive text about this message, to be included in the toString() method's response.
|
static ObjectReport |
readFromPreferences(java.util.prefs.Preferences prefs,
java.lang.String objectName)
Restore a new instance of an Object or Item from its backing store in Java Preferences.
|
void |
removeFromPreferences(java.util.prefs.Preferences prefs)
Clear this Object/Item from Java Preferences,
|
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 |
setEnabled(boolean enabled)
Specify whether this message should be transmitted.
|
void |
setInitialSendRate(int initialSendRate)
Set the time interval between retransmissions when a message is newly
introduced into the system.
|
void |
setScope(Scope scope)
Set the transmission scope for this message (so the digipeat path can be derived).
|
void |
setSlowSendRate(int slowSendRate)
Set the slowest rate a message should be sent.
|
void |
setTimestamp(long when)
Change the timestamp associated with this Object (should only be done on retransmitted
locally-originated Objects).
|
void |
writeToPreferences(java.util.prefs.Preferences prefs)
Persist this Object/Item in Java Preferences.
|
appendAreaParameters, appendRepeaterParameters, appendSignpostParameters, decodeDataExtension, decodeLatitude, decodeLongitude, decodeOnlyLatitude, decodeOnlyLongitude, encodeLatitudeCompressed, encodeLatitudePlainText, encodeLongitudeCompressed, encodeLongitudePlainText, extractCompressedLatitude, extractCompressedLongitude, extractLatitude, extractLongitude, getAbc, getAltitude, getAltitudeUnit, getHorizontalAccuracy, getLatitude, getLatitudeAccuracy, getLongitude, getPositionAltitude, getPositionLatitude, getPositionLongitude, getPositionTime, hasPosition, isCustom, isShowDate, isUsingCompressedFormat, looksLikeFrequency, looksLikeFrequency, setAbc, setAmbiguity, setCustom, setLatitude, setLocation, setLongitude, setShowDate, testIfValidCompressedLocation
compareTo, decodeDatestamp, decodeHurricaneParams, decodeTimestamp, decodeWeatherParams, decodeWeatherParams, dup, encodeTimestamp, extractComment, extractComment, extractSymbol, formatBody, getComment, getExtensionString, getMsgType, getPrecedence, getProtocols, getSymbolCode, getSymTableId, hasWeather, inferSymbol, isAppendCR, isSymbolInferred, looksLikeLongFormatLatitude, setAppendCR, setComment, setSymbolCode, setSymTableId, toString
equals, extractSource, getAx25Frame, getExtension, getFirstDigipeat, getLastDigipeat, getNthDigipeat, getOriginalDestination, getOriginalSource, getOriginatingCallsign, getOriginatingDest, getRcptTime, getReadOnlyExtensionMap, getTimestamp, hashCode, hasThisFirstDigi, indexOf, indexOf, isDirect, isInvalid, isRf, onlyDigits, onlyDigits, onlyDigitsOrMinus, onlyDigitsOrPeriod, onlyDigitsOrSpace, onlyDigitsPlus, onlyPeriods, setAx25Frame, setInvalid, setOriginatingCallsign, setRcptTime, split, storeExtension
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
dup
public static final int NUM_KILLED_TRANSMISSIONS
public java.lang.String objectName
public char life
public java.lang.String savedTimestamp
public Scope scope
public java.lang.String[] digipeatPaths
public java.lang.String qruCategory
public int fastSendRate
public int decayRatio
public int slowSendRate
public ObjectReport(byte[] body, int offset, java.lang.String tp, long rcvTimestamp)
body
- byte array of frame bodyoffset
- int array index offset for start of message (non-zero for encapsulated messages)tp
- third-party relay String for encapsulated messages, or null for no third-party wrapperrcvTimestamp
- Unix time when message was actually received by YAACpublic ObjectReport(byte[] body, int offset, java.lang.String tp, AX25Callsign[] digipeaters, long rcvTimestamp)
body
- byte array of frame bodyoffset
- int array index offset for start of message (non-zero for encapsulated messages)tp
- third-party relay String for encapsulated messages, or null for no third-party wrapperdigipeaters
- array of digipeater AX25Callsigns from the original frame, or null to indicate no digipeatersrcvTimestamp
- Unix time when message was actually received by YAACpublic ObjectReport(java.lang.String strBody, long rcvTimestamp)
strBody
- the Message comment containing the Item reportrcvTimestamp
- Unix time when this message was received by YAACpublic ObjectReport(boolean isItem, java.lang.String objectName, boolean alive, java.util.Date date, char symTableId, char symbolCode)
isItem
- boolean true if message is for a non-timestamped Item instead of an ObjectobjectName
- the String name of the Object or Item (truncated to 9 characters if needed)alive
- boolean true if the Object/Item is alivedate
- Date when this Object was created (meaningless but required for Items)symTableId
- APRS symbol table ID (or overlay character) for this Object/ItemsymbolCode
- APRS symbol code for this Object/Itempublic java.lang.String paramString()
paramString
in class PositionMessage
Message.toString()
public byte[] getBody(boolean countTransmission, ProtocolFamily protocolId, AX25Frame frame)
getBody
in interface SendableMessage
countTransmission
- number of times this message has been transmittedprotocolId
- AX.25 protocol ID to format this message inframe
- AX25Frame into which the message will be placed, so any alternate AX25Message can be linked to itAX25Frame.parsedAX25Msg
public java.lang.String getStringAPRSBody(boolean countTransmission)
countTransmission
- boolean true if this should update the transmission counterspublic boolean isEnabled()
isEnabled
in interface SendableMessage
isEnabled
in class PositionMessage
public void setEnabled(boolean enabled)
enabled
- boolean true if Object can be transmittedpublic void disableForTransmit()
disableForTransmit
in interface SendableMessage
public boolean isSetEnabled()
public boolean isAlive()
public java.lang.String getObjectName()
public Scope getScope()
getScope
in interface ScopeableMessage
public void setScope(Scope scope)
scope
- Scope of this messagepublic void setTimestamp(long when)
setTimestamp
in class AX25Message
when
- time in Java milliseconds since 1 Jan 1970 UTC for this Objectpublic void writeToPreferences(java.util.prefs.Preferences prefs)
prefs
- the Preferences object to contain the record of this Object/Itempublic void removeFromPreferences(java.util.prefs.Preferences prefs)
prefs
- the Preferences object that contained the record of this Object/Itempublic static ObjectReport readFromPreferences(java.util.prefs.Preferences prefs, java.lang.String objectName)
prefs
- the Preferences object containing the record of this Object/ItemobjectName
- the name of the particular Object/Item to be restoredpublic ObjectReport createObjectFromThisPosition()
createObjectFromThisPosition
in class PositionMessage
public boolean bodyEquals(AX25Message o)
bodyEquals
in class PositionMessage
o
- another AX25Message to compare againstpublic 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 boolean isUseGpsForPosition()
isUseGpsForPosition
in interface SetBeaconRatesIfc