Skip to content

Commit

Permalink
Add option to specify APRS-IS port
Browse files Browse the repository at this point in the history
  • Loading branch information
sh123 committed Nov 12, 2023
1 parent 854bd62 commit 64e6b7f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 5 deletions.
4 changes: 2 additions & 2 deletions codec2talkie/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -96,6 +97,7 @@ public void initialize(Transport transport, Context context, ProtocolCallback pr
_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);

Expand Down Expand Up @@ -329,7 +331,7 @@ private String getLoginCommand() {
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
4 changes: 3 additions & 1 deletion codec2talkie/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
7 changes: 7 additions & 0 deletions codec2talkie/src/main/res/xml/preferences_aprs_is.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 64e6b7f

Please sign in to comment.