public class OpenTracMessage extends AX25Message implements AX25FrameSource, SendableMessage, java.lang.Iterable<OpenTracEntity>
AX25Message.Precedence
Modifier and Type | Field and Description |
---|---|
java.util.ArrayList<OpenTracEntity> |
entities
List of OpenTracEntity objects wrapped in this OpenTracMessage.
|
APRS_AND_OPENTRAC, ax25Frame, extensions, invalid, originatingCallsign, originatingDest, PERMANENT, rcptTime, thirdParty, timestamp, UTC
NO_FRAMES
Constructor and Description |
---|
OpenTracMessage() |
Modifier and Type | Method and Description |
---|---|
void |
appendEntity(OpenTracEntity entity)
Add another entity of data to this message.
|
protected boolean |
bodyEquals(AX25Message other)
Compare the contents of the body of the message, reporting if they match.
|
int |
computeBody(byte[] buf,
int offset)
Convert an OpenTRAC message into a properly encoded byte array..
|
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.
|
Connector |
getConnector()
Specify the Connector this message should be transmitted through.
|
OpenTracEntity |
getEntity(java.lang.String callsign,
int ssid,
short extensionId)
Find the OpenTracEntity within this OpenTracMessage matching the specified identification.
|
AX25Frame[] |
getFrames(boolean incrementXmtCount,
ProtocolFamily protocolId,
java.lang.String senderCallsign)
Get an AX25Frame of the data to transmit.
|
OpenTracElement |
getMatchingElement(int type)
Get the first element of the specified OpenTrac element ID on any entity in this message.
|
int |
getNumTransmitsBeforeDecay()
Get the number of cycles for a complete iteration over the proportional pathing digipeat path set.
|
OpenTracPosition |
getPosition()
Extract the position information from this OpenTracMessage.
|
AX25Message.Precedence |
getPrecedence()
Report the traffic-handling precedence for this message instance.
|
java.util.Set<ProtocolFamily> |
getProtocols()
Get the protocol family or families that this message corresponds to, so
ports that don't support all protocols will not forward inappropriate packets.
|
boolean |
hasPosition()
Report if this AX25Message contains position data.
|
boolean |
hasWeather()
Report if this OpenTracMessage contains weather information.
|
boolean |
isEnabled()
Test if message should still be transmitted.
|
boolean |
isEveryEntityAddressed()
Test if every entity in this message has been properly addressed.
|
java.util.Iterator<OpenTracEntity> |
iterator()
Returns an iterator over a set of elements of type OpenTracEntity.
|
java.lang.String |
paramString()
Descriptive text about this message, to be included in the toString() method's response.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
compareTo, dup, 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, setTimestamp, split, storeExtension
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
dup
public java.util.ArrayList<OpenTracEntity> entities
public int computeBody(byte[] buf, int offset)
buf
- byte array containing a transmission-format OpenTRAC messageoffset
- starting position in array that the message begins atpublic java.lang.String paramString()
paramString
in class AX25Message
toString()
public java.lang.String toString()
toString
in class AX25Message
public OpenTracElement getMatchingElement(int type)
type
- OpenTRAC element IDpublic void appendEntity(OpenTracEntity entity)
entity
- OpenTracEntity to append to this messagepublic 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
- AX.25 protocol to format message insenderCallsign
- String of local callsign sending this message (may be ignored if digipeating
a message from another station)public byte[] getBody(boolean countTransmission, ProtocolFamily protocolId, AX25Frame frame)
getBody
in interface SendableMessage
countTransmission
- number of times the message has been transmittedprotocolId
- ProtocolFamily to generate the message inframe
- AX25Frame into which the message will be placed, so any alternate AX25Message can be linked to itAX25Frame.parsedAX25Msg
public boolean isEnabled()
isEnabled
in interface SendableMessage
public void disableForTransmit()
disableForTransmit
in interface SendableMessage
public boolean hasWeather()
hasWeather
in class AX25Message
public boolean isEveryEntityAddressed()
public boolean hasPosition()
hasPosition
in class AX25Message
public OpenTracPosition getPosition()
public AX25Message.Precedence getPrecedence()
getPrecedence
in class AX25Message
public int getNumTransmitsBeforeDecay()
getNumTransmitsBeforeDecay
in interface AX25FrameSource
public Connector getConnector()
getConnector
in interface AX25FrameSource
Connector.CAP_XMT_PACKET_DATA
public java.util.Iterator<OpenTracEntity> iterator()
iterator
in interface java.lang.Iterable<OpenTracEntity>
public OpenTracEntity getEntity(java.lang.String callsign, int ssid, short extensionId)
callsign
- String callsign of entityssid
- int SSID of entityextensionId
- short extension ID of entityprotected boolean bodyEquals(AX25Message other)
bodyEquals
in class AX25Message
other
- another AX25Message to compare againstpublic java.util.Set<ProtocolFamily> getProtocols()
getProtocols
in class AX25Message