mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-11-24 19:42:21 +01:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6460b4be2a |
No files matched your search
+6
-2
@@ -32,6 +32,7 @@ extern float snr;
|
||||
extern int freqError;
|
||||
extern bool shouldSleepLowVoltage;
|
||||
extern bool saveNewDigiEcoModeConfig;
|
||||
extern bool pendingTxOff;
|
||||
extern String versionNumber;
|
||||
|
||||
|
||||
@@ -123,7 +124,10 @@ namespace QUERY_Utils {
|
||||
default: answer = "DigiEcoMode:OFF/Only Serial Output";
|
||||
}
|
||||
} else if (queryQuestion.startsWith("?TX=ON")) {
|
||||
if (radioTxActive) {
|
||||
if (pendingTxOff) { // cancel a TX=OFF that has not been applied yet
|
||||
pendingTxOff = false;
|
||||
answer = "TX=ON";
|
||||
} else if (radioTxActive) {
|
||||
answer = "TX was ON";
|
||||
} else {
|
||||
Config.loramodule.txActive = true;
|
||||
@@ -133,7 +137,7 @@ namespace QUERY_Utils {
|
||||
if (!radioTxActive) {
|
||||
answer = "TX was OFF";
|
||||
} else {
|
||||
Config.loramodule.txActive = false;
|
||||
pendingTxOff = true; // applied once this answer has been transmitted (see processOutputPacketBuffer)
|
||||
answer = "TX=OFF";
|
||||
}
|
||||
} else if (queryQuestion.startsWith("?TX=?")) {
|
||||
|
||||
@@ -49,6 +49,7 @@ struct Packet25SegBuffer {
|
||||
std::vector<Packet25SegBuffer> packet25SegBuffer;
|
||||
|
||||
bool saveNewDigiEcoModeConfig = false;
|
||||
bool pendingTxOff = false; // ?TX=OFF received: Tx is disabled after the answer has been sent
|
||||
bool packetIsBeacon = false;
|
||||
|
||||
|
||||
@@ -199,6 +200,10 @@ namespace STATION_Utils {
|
||||
currentIndex++;
|
||||
}
|
||||
outputPacketBuffer.clear();
|
||||
if (pendingTxOff) {
|
||||
Config.loramodule.txActive = false;
|
||||
pendingTxOff = false;
|
||||
}
|
||||
//
|
||||
if (saveNewDigiEcoModeConfig) {
|
||||
Config.writeFile();
|
||||
@@ -225,6 +230,10 @@ namespace STATION_Utils {
|
||||
delay(4000);
|
||||
}
|
||||
}
|
||||
if (pendingTxOff && outputPacketBuffer.empty()) { // answer to ?TX=OFF (and any ack) already sent
|
||||
Config.loramodule.txActive = false;
|
||||
pendingTxOff = false;
|
||||
}
|
||||
if (saveNewDigiEcoModeConfig) {
|
||||
Config.writeFile();
|
||||
delay(1000);
|
||||
|
||||
Reference in new issue
Block a user