org.ka2ddo.aprs
Class MaidenheadLocatorBeacon

java.lang.Object
  extended by org.ka2ddo.ax25.AX25Message
      extended by org.ka2ddo.aprs.Message
          extended by org.ka2ddo.aprs.PositionMessage
              extended by org.ka2ddo.aprs.MaidenheadLocatorBeacon
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<AX25Message>, CommentedMessage, SendableMessage

public class MaidenheadLocatorBeacon
extends PositionMessage
implements SendableMessage

This class decodes the (obsolete) Maidenhead Locator Beacon message (APRS protocol specification chapter 6).

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.ka2ddo.ax25.AX25Message
AX25Message.Precedence
 
Field Summary
 
Fields inherited from class org.ka2ddo.aprs.PositionMessage
abc, altitude, altitudeUnit, COMPRESSED_LAT_SCALING, CONV_MPH_TO_METERS_PER_SEC, DHM, fLatitude, fLatPrecision, fLongitude, fmtMonitorFreq, HMS, isCustom, latitude, LN_BASE1_08, longitude, MDHM
 
Fields inherited from class org.ka2ddo.aprs.Message
comment, extensions, msgType, S_PERMANENT, S_PERMANENT_UC, symbolCode, symTableId, USASCII
 
Fields inherited from class org.ka2ddo.ax25.AX25Message
ax25Frame, invalid, ISO_8859_1, originatingCallsign, PERMANENT, rcptTime, thirdParty, timestamp, UTC, UTF8
 
Constructor Summary
MaidenheadLocatorBeacon(byte[] body, int offset, java.lang.String tp, long rcvTimestamp)
           
MaidenheadLocatorBeacon(long now, byte msgType, double latitude, double longitude, java.lang.String comment)
          Alternate constructor for making a transmittable MaidenheadLocatorBeacon message (including one that looks like a StatusMessage with Maidenhead location).
 
Method Summary
static java.lang.String encodeMaidenheadIdentifier(double latitude, double longitude)
          Convert a lat/lon pair in decimal degrees North/East into a Maidenhead location.
 byte[] getBody(boolean countTransmission, byte protocolId, AX25Frame frame)
          Get an instance of this message, suitable for transmitting.
static boolean testIfMaidenheadIdentifier(byte[] body, int offset)
          Test if the specified message body contains a string that looks like a Maidenhead location identifier.
 
Methods inherited from class org.ka2ddo.aprs.PositionMessage
appendAreaParameters, appendRepeaterParameters, appendSignpostParameters, bodyEquals, createObjectFromThisPosition, decodeDataExtension, decodeLatitude, decodeLongitude, decodeOnlyLatitude, decodeOnlyLongitude, encodeLatitudeCompressed, encodeLatitudePlainText, encodeLongitudeCompressed, encodeLongitudePlainText, extractCompressedLatitude, extractCompressedLongitude, extractLatitude, extractLongitude, getAbc, getAltitude, getAltitudeUnit, getCustom, getLatitude, getLatitudeAccuracy, getLongitude, hasPosition, isEnabled, isShowDate, isUsingCompressedFormat, looksLikeFrequency, looksLikeFrequency, paramString, setAbc, setLatitude, setLocation, setLongitude, setShowDate, testIfValidCompressedLocation
 
Methods inherited from class org.ka2ddo.aprs.Message
compareTo, decodeDatestamp, decodeHurricaneParams, decodeTimestamp, decodeWeatherParams, decodeWeatherParams, dup, encodeTimestamp, extractComment, extractComment, extractSymbol, formatBody, getComment, getExtension, getExtensionString, getMsgType, getReadOnlyExtensionMap, getSymbolCode, getSymTableId, hasWeather, inferSymbol, isSymbolInferred, looksLikeLongFormatLatitude, setComment, setSymbolCode, setSymTableId, storeExtension, toString
 
Methods inherited from class org.ka2ddo.ax25.AX25Message
equals, extractSource, getAx25Frame, getFirstDigipeat, getLastDigipeat, getOriginalDestination, getOriginalSource, getOriginatingCallsign, getPrecedence, getRcptTime, getTimestamp, hashCode, hasThisFirstDigi, indexOf, indexOf, isInvalid, onlyDigits, onlyDigits, onlyDigitsOrPeriod, onlyDigitsOrSpace, onlyDigitsPlus, onlyPeriods, setAx25Frame, setInvalid, setOriginatingCallsign, setRcptTime, setTimestamp, split
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ka2ddo.ax25.SendableMessage
dup, isEnabled
 

Constructor Detail

MaidenheadLocatorBeacon

public MaidenheadLocatorBeacon(byte[] body,
                               int offset,
                               java.lang.String tp,
                               long rcvTimestamp)

MaidenheadLocatorBeacon

public MaidenheadLocatorBeacon(long now,
                               byte msgType,
                               double latitude,
                               double longitude,
                               java.lang.String comment)
Alternate constructor for making a transmittable MaidenheadLocatorBeacon message (including one that looks like a StatusMessage with Maidenhead location).

Parameters:
now - current time in Java milliseconds since midnight Jan 1 1970 UTC
msgType - APRS message type character (either '[' or '>')
latitude - latitude in fractional degrees North
longitude - longitude in fractional degrees East
comment - free-text comment String
See Also:
StatusMessage
Method Detail

testIfMaidenheadIdentifier

public static boolean testIfMaidenheadIdentifier(byte[] body,
                                                 int offset)
Test if the specified message body contains a string that looks like a Maidenhead location identifier.

Parameters:
body - byte array presumably containing an ASCII APRS message
offset - position in the byte array where a Maidenhead identifier might start
Returns:
boolean true if there is a Maidenhead identifier in the body at the specified offset

encodeMaidenheadIdentifier

public static java.lang.String encodeMaidenheadIdentifier(double latitude,
                                                          double longitude)
Convert a lat/lon pair in decimal degrees North/East into a Maidenhead location.

Parameters:
latitude - latitude in decimal degrees North
longitude - longitude in decimal degrees East
Returns:
6 character Maidenhead locator

getBody

public byte[] getBody(boolean countTransmission,
                      byte protocolId,
                      AX25Frame frame)
Get an instance of this message, suitable for transmitting.

Specified by:
getBody in interface SendableMessage
Parameters:
countTransmission - 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.parsedAX25Msg
Returns:
byte array of message, or null if message body cannot be generated in specified protocol, or retransmission count has been exceeded.
See Also:
AX25Frame.parsedAX25Msg