kopia lustrzana https://github.com/sh123/codec2_talkie
rodzic
8ecc9bafe5
commit
837dcc2e4c
|
@ -10,8 +10,8 @@ android {
|
|||
applicationId "com.radio.codec2talkie"
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 30
|
||||
versionCode 158
|
||||
versionName "1.58"
|
||||
versionCode 159
|
||||
versionName "1.59"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
|
|
@ -135,7 +135,8 @@ public class AprsIs implements Protocol, Runnable {
|
|||
AprsIsData aprsIsData = AprsIsData.fromString(line);
|
||||
if (aprsIsData != null) {
|
||||
_parentProtocolCallback.onReceiveData(aprsIsData.src, aprsIsData.dst, aprsIsData.rawDigipath, aprsIsData.data.getBytes());
|
||||
if (_isTxGateEnabled && new AprsCallsign(aprsIsData.src).isValid && !_isLoopbackTransport) {
|
||||
AprsCallsign aprsCallsign = new AprsCallsign(aprsIsData.src);
|
||||
if (_isTxGateEnabled && aprsCallsign.isValid && !_isLoopbackTransport && aprsIsData.isEligibleForTxGate()) {
|
||||
// TODO, add tx aprs filter https://aprs-is.net/IGating.aspx
|
||||
_childProtocol.sendData(aprsIsData.src, aprsIsData.dst, aprsIsData.digipath, aprsIsData.data.getBytes());
|
||||
}
|
||||
|
@ -171,8 +172,10 @@ public class AprsIs implements Protocol, Runnable {
|
|||
if (_isRxGateEnabled && !_isLoopbackTransport) {
|
||||
// TODO, additional RX filter https://aprs-is.net/IGateDetails.aspx
|
||||
AprsIsData aprsIsData = new AprsIsData(src, dst, path, new String(data));
|
||||
synchronized (_txQueue) {
|
||||
_txQueue.put(aprsIsData.toString().getBytes());
|
||||
if (aprsIsData.isEligibleForRxGate()) {
|
||||
synchronized (_txQueue) {
|
||||
_txQueue.put(aprsIsData.toString().getBytes());
|
||||
}
|
||||
}
|
||||
}
|
||||
_parentProtocolCallback.onReceiveData(src, dst, path, data);
|
||||
|
|
|
@ -33,6 +33,22 @@ public class AprsIsData {
|
|||
return result;
|
||||
}
|
||||
|
||||
public boolean isEligibleForRxGate() {
|
||||
boolean hasNoGate = rawDigipath.contains("TCPIP") ||
|
||||
rawDigipath.contains("TCPXX") ||
|
||||
rawDigipath.contains("NOGATE") ||
|
||||
rawDigipath.contains("RFONLY");
|
||||
|
||||
// do not gate TCPIP/NOGATE and queries
|
||||
return !hasNoGate && !data.startsWith("?");
|
||||
}
|
||||
|
||||
public boolean isEligibleForTxGate() {
|
||||
return !(rawDigipath.contains("TCPXX") ||
|
||||
rawDigipath.contains("NOGATE") ||
|
||||
rawDigipath.contains("RFONLY"));
|
||||
}
|
||||
|
||||
public static AprsIsData fromString(String textData) {
|
||||
AprsIsData aprsIsData = new AprsIsData();
|
||||
// N0CALL>PATH:DATA
|
||||
|
|
Ładowanie…
Reference in New Issue