aprs
sh123 2022-08-19 21:00:10 +03:00
rodzic ffc2b0b800
commit fd9847f621
5 zmienionych plików z 17 dodań i 2 usunięć

Wyświetl plik

@ -489,6 +489,11 @@ public class MainActivity extends AppCompatActivity implements ServiceConnection
if (isDigirepeaterEnabled) {
status += getString(R.string.digirepeater_label);
}
boolean aprsisEnabled = SettingsWrapper.isAprsIsEnabled(_sharedPreferences);
if (aprsisEnabled) {
status += getString(R.string.aprsis_label);
}
}
if (_appService != null) {

Wyświetl plik

@ -23,6 +23,7 @@ public class AprsIs implements Protocol {
private String _passcode;
private String _server;
private boolean _isSelfEnabled;
private boolean _isRxGateEnabled;
private boolean _isTxGateEnabled;
@ -41,6 +42,7 @@ public class AprsIs implements Protocol {
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
_isRxGateEnabled = sharedPreferences.getBoolean(PreferenceKeys.APRS_IS_ENABLE_RX_GATE, false);
_isTxGateEnabled = sharedPreferences.getBoolean(PreferenceKeys.APRS_IS_ENABLE_TX_GATE, false);
_isSelfEnabled = sharedPreferences.getBoolean(PreferenceKeys.APRS_IS_ENABLE_SELF, false);
_passcode = sharedPreferences.getString(PreferenceKeys.APRS_IS_CODE, "");
_server = sharedPreferences.getString(PreferenceKeys.APRS_IS_TCPIP_SERVER, "euro.aprs2.net");
_filterRadius = Integer.parseInt(sharedPreferences.getString(PreferenceKeys.APRS_IS_RADIUS, "10"));
@ -71,6 +73,9 @@ public class AprsIs implements Protocol {
@Override
public void sendData(String src, String dst, String path, byte[] dataPacket) throws IOException {
if (_isSelfEnabled) {
// TODO, forward own data to APRS-IS
}
_childProtocol.sendData(src, dst, path, dataPacket);
}
@ -102,6 +107,9 @@ public class AprsIs implements Protocol {
@Override
protected void onReceiveData(String src, String dst, String path, byte[] data) {
if (_isRxGateEnabled) {
// TODO, forward radio data to APRS-IS
}
_parentProtocolCallback.onReceiveData(src, dst, path, data);
}

Wyświetl plik

@ -90,7 +90,7 @@ public class Ax25 implements Protocol {
AX25Packet ax25Packet = new AX25Packet();
ax25Packet.src = src;
ax25Packet.dst = dst;
ax25Packet.digipath = _digipath;
ax25Packet.digipath = path == null ? _digipath : path;
ax25Packet.isAudio = false;
ax25Packet.rawData = dataPacket;
byte[] ax25Frame = ax25Packet.toBinary();
@ -98,7 +98,7 @@ public class Ax25 implements Protocol {
Log.e(TAG, "Cannot convert AX.25 data packet to binary");
_parentProtocolCallback.onProtocolTxError();
} else {
_childProtocol.sendData(src, dst, _digipath, ax25Frame);
_childProtocol.sendData(src, dst, ax25Packet.digipath, ax25Frame);
_parentProtocolCallback.onTransmitLog(ax25Packet.toString());
}
}

Wyświetl plik

@ -101,6 +101,7 @@ public final class PreferenceKeys {
public static String APRS_IS_TCPIP_SERVER = "aprs_is_tcpip_server";
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";
public static String APRS_IS_RADIUS = "aprs_is_radius";
public static String APRS_IS_FILTER = "aprs_is_filter";
}

Wyświetl plik

@ -224,6 +224,7 @@
<string name="aprs_privacy_altitude_summary">Include altitude in position reports</string>
<string name="aprs_label">&#127757;</string>
<string name="aprsis_label">&#128682;</string>
<string name="menu_messages">Messages</string>
<string name="menu_start_tracking">Start tracking</string>