kopia lustrzana https://github.com/ge0rg/aprsdroid
tcptnc: add TCP/IP KISS TNC
rodzic
5b54f9a0a3
commit
21829b731f
|
|
@ -7,6 +7,7 @@
|
|||
<item>@string/p_conn_afsk</item>
|
||||
<item>@string/p_conn_bt</item>
|
||||
<item>@string/p_conn_kwd</item>
|
||||
<item>@string/p_conn_tcptnc</item>
|
||||
</string-array>
|
||||
<string-array name="p_conntype_ev">
|
||||
<item>tcp</item>
|
||||
|
|
@ -15,6 +16,7 @@
|
|||
<item>afsk</item>
|
||||
<item>bluetooth</item>
|
||||
<item>kenwood</item>
|
||||
<item>tcptnc</item>
|
||||
</string-array>
|
||||
<string-array name="p_afsk_out_ev">
|
||||
<item>0</item>
|
||||
|
|
|
|||
|
|
@ -179,7 +179,8 @@
|
|||
<string name="p_conn_http">HTTP POST (send only)</string>
|
||||
<string name="p_conn_afsk">AFSK via Speaker/Mic</string>
|
||||
<string name="p_conn_bt">Bluetooth TNC</string>
|
||||
<string name="p_conn_kwd">Kenwood PKWDWPL</string>
|
||||
<string name="p_conn_kwd">Kenwood GPS Port</string>
|
||||
<string name="p_conn_tcptnc">TCP/IP TNC</string>
|
||||
<!-- array of location sources -->
|
||||
<string name="p_source_manual">Manual Position</string>
|
||||
<string name="p_source_periodic">Periodic GPS/Network Position</string>
|
||||
|
|
@ -321,4 +322,8 @@
|
|||
|
||||
<string name="afsk_info_sco_req">Requesting bluetooth SCO link...</string>
|
||||
<string name="afsk_info_sco_est">Bluetooth SCO link established.</string>
|
||||
|
||||
<!-- TCP/IP TNC settings -->
|
||||
<string name="p_tcptnc_server_summary">KISS TCP server to contact</string>
|
||||
<string name="p_tcptnc_entry">Enter the KISS server hostname</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,51 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/p_conn_tcptnc">
|
||||
|
||||
<de.duenndns.EditTextPreferenceWithValue
|
||||
android:key="tcp.server"
|
||||
android:inputType="textUri"
|
||||
android:title="@string/p_host"
|
||||
android:summary="@string/p_tcptnc_server_summary"
|
||||
android:hint="@string/p_host_hint"
|
||||
android:defaultValue="euro.aprs2.net"
|
||||
android:dialogTitle="@string/p_tcptnc_entry" />
|
||||
|
||||
<de.duenndns.EditTextPreferenceWithValue
|
||||
android:key="tcp.sotimeout"
|
||||
android:inputType="number"
|
||||
android:title="@string/p_sotimeout"
|
||||
android:summary="@string/p_sotimeout_summary"
|
||||
android:defaultValue="120"
|
||||
android:dialogTitle="@string/p_sotimeout_entry" />
|
||||
|
||||
<de.duenndns.EditTextPreferenceWithValue
|
||||
android:key="bt.init"
|
||||
android:defaultValue=""
|
||||
android:singleLine="false"
|
||||
android:title="@string/p_bt_tnc_init"
|
||||
android:summary="@string/p_bt_tnc_init_summary"
|
||||
android:dialogTitle="@string/p_bt_tnc_init" />
|
||||
<de.duenndns.EditTextPreferenceWithValue
|
||||
android:key="bt.delay"
|
||||
android:inputType="number"
|
||||
android:hint="300"
|
||||
android:defaultValue="300"
|
||||
android:title="@string/p_bt_tnc_delay"
|
||||
android:summary="@string/p_bt_tnc_delay_summary"
|
||||
android:dialogTitle="@string/p_bt_tnc_delay_entry" />
|
||||
<de.duenndns.EditTextPreferenceWithValue
|
||||
android:key="digi_path"
|
||||
android:hint="hop1,hop2,.."
|
||||
android:defaultValue="WIDE1-1"
|
||||
android:title="@string/p_aprs_path"
|
||||
android:summary="@string/p_aprs_path_summary"
|
||||
android:dialogTitle="@string/p_aprs_path_entry" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
</PreferenceScreen>
|
||||
|
||||
|
|
@ -52,6 +52,11 @@ object AprsIsUploader {
|
|||
(s, p) => new KenwoodTnc(s, p),
|
||||
R.xml.backend_kenwood,
|
||||
CAN_RECEIVE,
|
||||
PASSCODE_NONE),
|
||||
"tcptnc" -> new BackendInfo(
|
||||
(s, p) => new TcpTnc(s, p),
|
||||
R.xml.backend_tcptnc,
|
||||
CAN_DUPLEX,
|
||||
PASSCODE_NONE)
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
package org.aprsdroid.app
|
||||
|
||||
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)
|
||||
|
||||
}
|
||||
Ładowanie…
Reference in New Issue