kopia lustrzana https://github.com/ge0rg/aprsdroid
implement APDRxx to-call
rodzic
e1f311319f
commit
66cd3cebfd
|
@ -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 = {
|
status : String, location : Location) : String = {
|
||||||
callssid + ">APAND1,TCPIP*:" + new PositionPacket(
|
callssid + ">" + toCall + ",TCPIP*:" + new PositionPacket(
|
||||||
new Position(location.getLatitude, location.getLongitude, 0,
|
new Position(location.getLatitude, location.getLongitude, 0,
|
||||||
symbol(0), symbol(1)),
|
symbol(0), symbol(1)),
|
||||||
formatCourseSpeed(location) + formatAltitude(location) +
|
formatCourseSpeed(location) + formatAltitude(location) +
|
||||||
|
|
|
@ -183,6 +183,11 @@ class AprsService extends Service with LocationListener {
|
||||||
postLocation(location)
|
postLocation(location)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def appVersion() : String = {
|
||||||
|
val pi = getPackageManager().getPackageInfo(getPackageName(), 0)
|
||||||
|
"APDR%s".format(pi.versionName filter (_.isDigit) take 2)
|
||||||
|
}
|
||||||
|
|
||||||
def postLocation(location : Location) {
|
def postLocation(location : Location) {
|
||||||
lastLoc = location
|
lastLoc = location
|
||||||
|
|
||||||
|
@ -195,7 +200,7 @@ class AprsService extends Service with LocationListener {
|
||||||
if (symbol.length != 2)
|
if (symbol.length != 2)
|
||||||
symbol = getString(R.string.default_symbol)
|
symbol = getString(R.string.default_symbol)
|
||||||
val status = prefs.getString("status", getString(R.string.default_status))
|
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)
|
Log.d(TAG, "packet: " + packet)
|
||||||
val result = try {
|
val result = try {
|
||||||
|
|
Ładowanie…
Reference in New Issue