Add option to specify APRS-IS port

master
sh123 2023-11-12 16:42:08 +02:00
rodzic 854bd629da
commit 64e6b7f265
6 zmienionych plików z 18 dodań i 5 usunięć

Wyświetl plik

@ -10,8 +10,8 @@ android {
applicationId "com.radio.codec2talkie"
minSdkVersion 23
targetSdkVersion 30
versionCode 163
versionName "1.63"
versionCode 164
versionName "1.64"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Wyświetl plik

@ -61,6 +61,7 @@ public class AprsIs implements Protocol, Runnable {
private String _ssid;
private int _filterRadius;
private String _filter;
private int _defaultPort;
private final ByteBuffer _fromAprsIsQueue;
private final ByteBuffer _toAprsIsQueue;
@ -96,6 +97,7 @@ public class AprsIs implements Protocol, Runnable {
_filterRadius = Integer.parseInt(sharedPreferences.getString(PreferenceKeys.APRS_IS_RADIUS, "10"));
_filter = sharedPreferences.getString(PreferenceKeys.APRS_IS_FILTER, "");
_isLoopbackTransport = SettingsWrapper.isLoopbackTransport(sharedPreferences);
_defaultPort = Integer.parseInt(sharedPreferences.getString(PreferenceKeys.APRS_IS_TCPIP_SERVER_PORT, "14580"));
Log.i(TAG, "AprsIs RX gate: " + _isTxGateEnabled + ", TX gate: " + _isTxGateEnabled + ", server: " + _server);
@ -329,7 +331,7 @@ public class AprsIs implements Protocol, Runnable {
private TcpIp runConnect() {
Socket socket = new Socket();
try {
socket.connect(new InetSocketAddress(_server, APRSIS_DEFAULT_PORT));
socket.connect(new InetSocketAddress(_server, _defaultPort));
TcpIp tcpIp = new TcpIp(socket, "aprsis");
String loginCmd = getLoginCommand();
Log.i(TAG, "Login command " + loginCmd);

Wyświetl plik

@ -101,6 +101,7 @@ public final class PreferenceKeys {
public static String APRS_IS_ENABLE="aprs_is_enable";
public static String APRS_IS_CODE = "aprs_is_code";
public static String APRS_IS_TCPIP_SERVER = "aprs_is_tcpip_server";
public static String APRS_IS_TCPIP_SERVER_PORT = "aprs_is_tcpip_server_port";
public static String APRS_IS_ENABLE_RX_GATE = "aprs_is_enable_rx_gate";
public static String APRS_IS_ENABLE_TX_GATE = "aprs_is_enable_tx_gate";
public static String APRS_IS_ENABLE_SELF = "aprs_is_enable_self";

Wyświetl plik

@ -38,7 +38,8 @@ public class SettingsActivity extends AppCompatActivity
"ports_tcp_ip_retry_count",
"ports_tcp_ip_retry_delay",
"ports_sound_modem_preamble",
"ports_sound_modem_ptt_off_delay_ms"
"ports_sound_modem_ptt_off_delay_ms",
"aprs_is_tcpip_server_port"
};
private static final String[] _signedDecimalSettings = {

Wyświetl plik

@ -338,7 +338,9 @@
<string name="aprs_is_settings_title">Internet APRS-IS</string>
<string name="aprs_is_settings_summary">Configure internet APRS-IS server connectivity</string>
<string name="aprs_is_tcpip_server_title">Server</string>
<string name="aprs_is_tcpip_server_summary">APRS-IS TCP server (port 14580) to connect</string>
<string name="aprs_is_tcpip_server_summary">APRS-IS TCP server to connect</string>
<string name="aprs_is_tcpip_server_port_title">Server port</string>
<string name="aprs_is_tcpip_server_port_summary">APRS-IS TCP server port to use</string>
<string name="aprs_is_enable_rx_gate_title">Enable APRS-IS RX gate</string>
<string name="aprs_is_enable_tx_gate_title">Enable APRS-IS TX gate</string>
<string name="aprs_is_enable_rx_gate_summary">Radio packets will be forwarded to APRS-IS</string>

Wyświetl plik

@ -18,6 +18,13 @@
app:defaultValue="euro.aprs2.net">
</EditTextPreference>
<EditTextPreference
app:key="aprs_is_tcpip_server_port"
app:title="@string/aprs_is_tcpip_server_port_title"
app:summary="@string/aprs_is_tcpip_server_port_summary"
app:defaultValue="14580">
</EditTextPreference>
<SwitchPreference
app:key="aprs_is_enable_rx_gate"
app:title="@string/aprs_is_enable_rx_gate_title"