implement APDRxx to-call

storage_ts_index
Georg Lukas 2011-02-19 01:44:27 +01:00
rodzic e1f311319f
commit 66cd3cebfd
2 zmienionych plików z 8 dodań i 3 usunięć

Wyświetl plik

@ -52,9 +52,9 @@ object AprsPacket {
""
}
def formatLoc(callssid : String, symbol : String,
def formatLoc(callssid : String, toCall : String, symbol : String,
status : String, location : Location) : String = {
callssid + ">APAND1,TCPIP*:" + new PositionPacket(
callssid + ">" + toCall + ",TCPIP*:" + new PositionPacket(
new Position(location.getLatitude, location.getLongitude, 0,
symbol(0), symbol(1)),
formatCourseSpeed(location) + formatAltitude(location) +

Wyświetl plik

@ -183,6 +183,11 @@ class AprsService extends Service with LocationListener {
postLocation(location)
}
def appVersion() : String = {
val pi = getPackageManager().getPackageInfo(getPackageName(), 0)
"APDR%s".format(pi.versionName filter (_.isDigit) take 2)
}
def postLocation(location : Location) {
lastLoc = location
@ -195,7 +200,7 @@ class AprsService extends Service with LocationListener {
if (symbol.length != 2)
symbol = getString(R.string.default_symbol)
val status = prefs.getString("status", getString(R.string.default_status))
val packet = AprsPacket.formatLoc(callssid, symbol, status, location)
val packet = AprsPacket.formatLoc(callssid, appVersion(), symbol, status, location)
Log.d(TAG, "packet: " + packet)
val result = try {