APRS-IS: allow long callsigns, error on KISS/AFSK

mapsforge^2
Georg Lukas 2018-11-18 11:37:57 +01:00
rodzic 67c45019a0
commit e17ff6db92
8 zmienionych plików z 21 dodań i 4 usunięć

Wyświetl plik

@ -12,6 +12,7 @@
<!-- APRSdroid activity -->
<string name="firstrun">You need to configure APRSdroid with your callsign and passcode!</string>
<string name="wrongpasscode">Your passcode does not match your callsign!</string>
<string name="e_toolong_callsign">Your callsign is too long for Packet Radio!</string>
<string name="anon_warning">Without a passcode, your reports will not be propagated!</string>
<string name="mininterval">Minimum update time is 1 minute!</string>
<string name="singlelog">Send Position</string>

Wyświetl plik

@ -9,7 +9,7 @@
android:key="callsign"
android:inputType="textCapCharacters"
android:digits="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
android:maxLength="6"
android:maxLength="9"
android:title="@string/p_callsign_nossid"
android:summary="@string/p_callsign_summary"
android:hint="@string/p_callsign_nossid"

Wyświetl plik

@ -23,7 +23,7 @@ class PrefsWrapper(val context : Context) {
}
// return commonly used prefs
def getCallsign() = prefs.getString("callsign", "").trim().slice(0, 6).toUpperCase()
def getCallsign() = prefs.getString("callsign", "").trim().toUpperCase()
def getPasscode() = prefs.getString("passcode", "") match {
case "" => "-1"

Wyświetl plik

@ -40,7 +40,11 @@ class AfskUploader(service : AprsService, prefs : PrefsWrapper) extends AprsBack
}
}
def start() = {
def start() : Boolean = {
if (prefs.getCallsign().length() > 6) {
service.postAbort(service.getString(R.string.e_toolong_callsign))
return false
}
if (use_bt) {
log(service.getString(R.string.afsk_info_sco_req))
service.getSystemService(Context.AUDIO_SERVICE)

Wyświetl plik

@ -107,6 +107,7 @@ class BluetoothTnc(service : AprsService, prefs : PrefsWrapper) extends AprsBack
init_socket()
service.postPosterStarted()
} catch {
case e : IllegalArgumentException => service.postAbort(e.getMessage()); running = false
case e : Exception => {
e.printStackTrace();
val name = if (tnc.getName() != null) tnc.getName() else tncmac

Wyświetl plik

@ -136,6 +136,7 @@ class TcpUploader(service : AprsService, prefs : PrefsWrapper) extends AprsBacke
service.postLinkOn(R.string.p_aprsis_tcp)
service.postPosterStarted()
} catch {
case e : IllegalArgumentException => service.postAbort(e.getMessage()); running = false
case e : Exception => service.postAbort(e.toString()); running = false
}
while (running) {

Wyświetl plik

@ -163,7 +163,13 @@ class UsbTnc(service : AprsService, prefs : PrefsWrapper) extends AprsBackend(pr
log("Opened " + ser.getClass().getSimpleName() + " at " + baudrate + "bd")
sis = new SerialInputStream(ser)
proto = AprsBackend.instanciateProto(service, sis, new SerialOutputStream(ser))
try {
proto = AprsBackend.instanciateProto(service, sis, new SerialOutputStream(ser))
} catch {
case e : IllegalArgumentException =>
service.postAbort(e.getMessage()); running = false
return
}
service.postPosterStarted()
while (running) {
try {

Wyświetl plik

@ -32,6 +32,10 @@ class KissProto(service : AprsService, is : InputStream, os : OutputStream) exte
}
}
if (service.prefs.getCallsign().length() > 6) {
throw new IllegalArgumentException(service.getString(R.string.e_toolong_callsign))
}
def readPacket() : String = {
import Kiss._
val buf = scala.collection.mutable.ListBuffer[Byte]()