kopia lustrzana https://github.com/ge0rg/aprsdroid
service: always use digi_path, even on APRS-IS
rodzic
19cc48f2e7
commit
748bf01853
|
@ -202,8 +202,9 @@ class AprsService extends Service {
|
|||
}
|
||||
|
||||
def newPacket(payload : InformationField) = {
|
||||
// TODO: obtain digi path from prefs
|
||||
new APRSPacket(prefs.getCallSsid(), APP_VERSION, null, payload)
|
||||
val digipath = prefs.getString("digi_path", "WIDE1-1")
|
||||
new APRSPacket(prefs.getCallSsid(), APP_VERSION,
|
||||
Digipeater.parseList(digipath, true), payload)
|
||||
}
|
||||
|
||||
def formatLoc(symbol : String, status : String, location : Location) = {
|
||||
|
|
|
@ -18,7 +18,6 @@ class BluetoothTnc(service : AprsService, prefs : PrefsWrapper) extends AprsBack
|
|||
val bt_client = prefs.getBoolean("bt.client", true)
|
||||
val tncmac = prefs.getString("bt.mac", null)
|
||||
val tncchannel = prefs.getStringInt("bt.channel", -1)
|
||||
var digipath = prefs.getString("digi_path", "WIDE1-1")
|
||||
var conn : BtSocketThread = null
|
||||
|
||||
def start() = {
|
||||
|
@ -28,7 +27,7 @@ class BluetoothTnc(service : AprsService, prefs : PrefsWrapper) extends AprsBack
|
|||
}
|
||||
|
||||
def createTncProto(is : InputStream, os : OutputStream) : TncProto =
|
||||
new KissProto(is, os, digipath)
|
||||
new KissProto(is, os)
|
||||
|
||||
def createConnection() {
|
||||
Log.d(TAG, "BluetoothTnc.createConnection: " + tncmac)
|
||||
|
@ -52,8 +51,6 @@ class BluetoothTnc(service : AprsService, prefs : PrefsWrapper) extends AprsBack
|
|||
}
|
||||
|
||||
def update(packet : APRSPacket) : String = {
|
||||
// the digipeater setting here is a duplicate just for log purpose
|
||||
packet.setDigipeaters(Digipeater.parseList(digipath, true))
|
||||
Log.d(TAG, "BluetoothTnc.update: " + packet)
|
||||
conn.update(packet)
|
||||
}
|
||||
|
|
|
@ -4,9 +4,8 @@ import _root_.java.io.{InputStream, OutputStream}
|
|||
|
||||
class TcpTnc(service : AprsService, prefs : PrefsWrapper) extends TcpUploader(service, prefs) {
|
||||
override val TAG = "APRSdroid.TcpTnc"
|
||||
val digipath = prefs.getString("digi_path", "WIDE1-1")
|
||||
|
||||
override def createTncProto(is : InputStream, os : OutputStream) : TncProto =
|
||||
new KissProto(is, os, digipath)
|
||||
new KissProto(is, os)
|
||||
|
||||
}
|
||||
|
|
|
@ -23,8 +23,6 @@ class UsbTnc(service : AprsService, prefs : PrefsWrapper) extends AprsBackend(pr
|
|||
val ACTION_USB_ATTACHED = "android.hardware.usb.action.USB_DEVICE_ATTACHED"
|
||||
val ACTION_USB_DETACHED = "android.hardware.usb.action.USB_DEVICE_DETACHED"
|
||||
|
||||
var digipath = prefs.getString("digi_path", "WIDE1-1")
|
||||
|
||||
val usbManager = service.getSystemService(Context.USB_SERVICE).asInstanceOf[UsbManager];
|
||||
var thread : UsbThread = null
|
||||
var dev : UsbDevice = null
|
||||
|
@ -92,10 +90,6 @@ class UsbTnc(service : AprsService, prefs : PrefsWrapper) extends AprsBackend(pr
|
|||
}
|
||||
|
||||
def update(packet : APRSPacket) : String = {
|
||||
// the digipeater setting here is a duplicate just for log purpose
|
||||
packet.setDigipeaters(Digipeater.parseList(digipath, true))
|
||||
Log.d(TAG, "UsbTnc.update: " + packet)
|
||||
//TODO
|
||||
proto.writePacket(packet)
|
||||
"USB OK"
|
||||
}
|
||||
|
@ -156,7 +150,7 @@ class UsbTnc(service : AprsService, prefs : PrefsWrapper) extends AprsBackend(pr
|
|||
Thread.sleep(initdelay)
|
||||
}
|
||||
}
|
||||
proto = new KissProto(new SerialInputStream(ser), os, digipath)
|
||||
proto = new KissProto(new SerialInputStream(ser), os)
|
||||
service.postPosterStarted()
|
||||
while (running) {
|
||||
val line = proto.readPacket()
|
||||
|
|
|
@ -5,7 +5,7 @@ import _root_.java.io.{InputStream, OutputStream}
|
|||
|
||||
import _root_.net.ab0oo.aprs.parser._
|
||||
|
||||
class KissProto(is : InputStream, os : OutputStream, digipath : String) extends TncProto(is, os) {
|
||||
class KissProto(is : InputStream, os : OutputStream) extends TncProto(is, os) {
|
||||
val TAG = "APRSdroid.KissProto"
|
||||
|
||||
object Kiss {
|
||||
|
@ -63,7 +63,6 @@ class KissProto(is : InputStream, os : OutputStream, digipath : String) extends
|
|||
}
|
||||
|
||||
def writePacket(p : APRSPacket) {
|
||||
p.setDigipeaters(Digipeater.parseList(digipath, true))
|
||||
Log.d(TAG, "writePacket: " + p)
|
||||
os.write(Kiss.FEND)
|
||||
os.write(Kiss.CMD_DATA)
|
||||
|
|
Ładowanie…
Reference in New Issue