kopia lustrzana https://github.com/sh123/codec2_talkie
Merge branch 'master' into legacy
commit
ac589da82c
|
@ -447,13 +447,13 @@ public class MainActivity extends AppCompatActivity implements ServiceConnection
|
|||
status += getString(R.string.aprs_label);
|
||||
|
||||
// VoAX25
|
||||
boolean voax25Enabled = _sharedPreferences.getBoolean(PreferenceKeys.APRS_VOAX25_ENABLE, false);
|
||||
boolean voax25Enabled = _sharedPreferences.getBoolean(PreferenceKeys.AX25_VOAX25_ENABLE, false);
|
||||
if (voax25Enabled) {
|
||||
status += getString(R.string.voax25_label);
|
||||
}
|
||||
|
||||
// Digirepeater
|
||||
boolean isDigirepeaterEnabled = _sharedPreferences.getBoolean(PreferenceKeys.APRS_DIGIREPEATER_ENABLED, false);
|
||||
boolean isDigirepeaterEnabled = _sharedPreferences.getBoolean(PreferenceKeys.AX25_DIGIREPEATER_ENABLED, false);
|
||||
if (isDigirepeaterEnabled) {
|
||||
status += getString(R.string.digirepeater_label);
|
||||
}
|
||||
|
|
|
@ -16,8 +16,6 @@ import com.radio.codec2talkie.protocol.ax25.AX25Callsign;
|
|||
import com.radio.codec2talkie.settings.PreferenceKeys;
|
||||
import com.radio.codec2talkie.transport.Transport;
|
||||
|
||||
import org.w3c.dom.Text;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class Aprs implements Protocol {
|
||||
|
@ -51,11 +49,11 @@ public class Aprs implements Protocol {
|
|||
_childProtocol.initialize(transport, context, _protocolCallback);
|
||||
|
||||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
_isVoax25Enabled = sharedPreferences.getBoolean(PreferenceKeys.APRS_VOAX25_ENABLE, false);
|
||||
_isVoax25Enabled = sharedPreferences.getBoolean(PreferenceKeys.AX25_VOAX25_ENABLE, false);
|
||||
|
||||
_srcCallsign = AX25Callsign.formatCallsign(
|
||||
sharedPreferences.getString(PreferenceKeys.APRS_CALLSIGN, "NOCALL").toUpperCase(),
|
||||
sharedPreferences.getString(PreferenceKeys.APRS_SSID, "0"));
|
||||
sharedPreferences.getString(PreferenceKeys.AX25_CALLSIGN, "NOCALL").toUpperCase(),
|
||||
sharedPreferences.getString(PreferenceKeys.AX25_SSID, "0"));
|
||||
_dstCallsign = "APZMDM";
|
||||
|
||||
_symbolCode = sharedPreferences.getString(PreferenceKeys.APRS_SYMBOL, "/[");
|
||||
|
|
|
@ -6,6 +6,7 @@ import android.util.Log;
|
|||
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import com.radio.codec2talkie.protocol.ax25.AX25Callsign;
|
||||
import com.radio.codec2talkie.protocol.ax25.AX25Packet;
|
||||
import com.radio.codec2talkie.protocol.message.TextMessage;
|
||||
import com.radio.codec2talkie.protocol.position.Position;
|
||||
|
@ -19,6 +20,8 @@ public class Ax25 implements Protocol {
|
|||
private static final String TAG = Ax25.class.getSimpleName();
|
||||
|
||||
final Protocol _childProtocol;
|
||||
|
||||
private String _myCallsign;
|
||||
private String _digipath;
|
||||
private boolean _isVoax25Enabled;
|
||||
private boolean _isDigiRepeaterEnabled;
|
||||
|
@ -34,10 +37,13 @@ public class Ax25 implements Protocol {
|
|||
_parentProtocolCallback = protocolCallback;
|
||||
_childProtocol.initialize(transport, context, _protocolCallback);
|
||||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
_myCallsign = AX25Callsign.formatCallsign(
|
||||
sharedPreferences.getString(PreferenceKeys.AX25_CALLSIGN, "NOCALL").toUpperCase(),
|
||||
sharedPreferences.getString(PreferenceKeys.AX25_SSID, "0"));
|
||||
// NOTE, may need to pass through sendData/sendAudio
|
||||
_digipath = sharedPreferences.getString(PreferenceKeys.APRS_DIGIPATH, "").toUpperCase();
|
||||
_isVoax25Enabled = sharedPreferences.getBoolean(PreferenceKeys.APRS_VOAX25_ENABLE, false);
|
||||
_isDigiRepeaterEnabled = sharedPreferences.getBoolean(PreferenceKeys.APRS_DIGIREPEATER_ENABLED, false);
|
||||
_digipath = sharedPreferences.getString(PreferenceKeys.AX25_DIGIPATH, "").toUpperCase();
|
||||
_isVoax25Enabled = sharedPreferences.getBoolean(PreferenceKeys.AX25_VOAX25_ENABLE, false);
|
||||
_isDigiRepeaterEnabled = sharedPreferences.getBoolean(PreferenceKeys.AX25_DIGIREPEATER_ENABLED, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -202,6 +208,7 @@ public class Ax25 implements Protocol {
|
|||
}
|
||||
|
||||
private void digiRepeat(AX25Packet ax25Packet) {
|
||||
if (ax25Packet.src.equals(_myCallsign)) return;
|
||||
if (!ax25Packet.digiRepeat()) return;
|
||||
byte[] ax25Frame = ax25Packet.toBinary();
|
||||
if (ax25Frame == null) {
|
||||
|
|
|
@ -52,11 +52,13 @@ public final class PreferenceKeys {
|
|||
public static String APP_NOTIFICATIONS_VOICE = "app_notifications_voice";
|
||||
public static String APP_NO_CPU_SLEEP = "app_no_cpu_sleep";
|
||||
|
||||
public static String AX25_VOAX25_ENABLE = "aprs_voax25_enable";
|
||||
public static String AX25_CALLSIGN = "aprs_callsign";
|
||||
public static String AX25_SSID = "aprs_ssid";
|
||||
public static String AX25_DIGIPATH = "aprs_digipath";
|
||||
public static String AX25_DIGIREPEATER_ENABLED = "aprs_digirepeater_enable";
|
||||
|
||||
public static String APRS_ENABLED = "aprs_enable";
|
||||
public static String APRS_VOAX25_ENABLE = "aprs_voax25_enable";
|
||||
public static String APRS_CALLSIGN = "aprs_callsign";
|
||||
public static String APRS_SSID = "aprs_ssid";
|
||||
public static String APRS_DIGIPATH = "aprs_digipath";
|
||||
public static String APRS_SYMBOL = "aprs_symbol";
|
||||
public static String APRS_COMMENT = "aprs_comment";
|
||||
public static String APRS_LOCATION_PACKET_FORMAT = "aprs_location_packet_format";
|
||||
|
@ -72,7 +74,6 @@ public final class PreferenceKeys {
|
|||
public static String APRS_PRIVACY_POSITION_AMBIGUITY = "aprs_privacy_position_ambiguity";
|
||||
public static String APRS_PRIVACY_SPEED_ENABLED = "aprs_privacy_speed_enable";
|
||||
public static String APRS_PRIVACY_ALTITUDE_ENABLED = "aprs_privacy_altitude_enable";
|
||||
public static String APRS_DIGIREPEATER_ENABLED = "aprs_digirepeater_enable";
|
||||
|
||||
public static String APRS_LOCATION_SOURCE_SMART_FAST_SPEED = "aprs_location_source_smart_fast_speed";
|
||||
public static String APRS_LOCATION_SOURCE_SMART_FAST_RATE = "aprs_location_source_smart_fast_rate";
|
||||
|
|
Ładowanie…
Reference in New Issue