Skip to content

Commit 7ed4b78

Browse files
committed
Wait for command response before processing next command
1 parent 497bf60 commit 7ed4b78

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

Firmware/LoRaSerial/Commands.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,7 @@ bool sendRemoteCommand(const char * commandString)
787787
systemPrintln(" from commandBuffer into commandTXBuffer");
788788
}
789789
remoteCommandResponse = false;
790+
waitRemoteCommandResponse = true;
790791
return true;
791792
}
792793

Firmware/LoRaSerial/LoRaSerial.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ const long minEscapeTime_ms = 2000; //Serial traffic must stop this amount befor
230230
bool inCommandMode = false; //Normal data is prevented from entering serial output when in command mode
231231
uint8_t commandLength = 0;
232232
bool remoteCommandResponse;
233+
bool waitRemoteCommandResponse;
233234

234235
bool rtsAsserted; //When RTS is asserted, host says it's ok to send data
235236
bool forceRadioReset = false; //Goes true when a setting requires a link/radio reset to work

Firmware/LoRaSerial/Serial.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ void processSerialInput()
395395
radioHead = radioTxHead;
396396
while (availableRXBytes()
397397
&& (availableRadioTXBytes() < (sizeof(radioTxBuffer) - maxEscapeCharacters))
398+
&& ((!inCommandMode) || (!waitRemoteCommandResponse))
398399
&& (transactionComplete == false))
399400
{
400401
//Take a break if there are ISRs to attend to

Firmware/LoRaSerial/States.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,7 @@ void updateRadioState()
806806
outputSerialData(true);
807807
}
808808
serialBufferOutput(rxData, rxDataBytes);
809+
waitRemoteCommandResponse = false;
809810

810811
//Transmit ACK
811812
P2P_SEND_ACK(TRIGGER_TX_ACK);
@@ -2982,6 +2983,7 @@ void discardPreviousData()
29822983
txTail = txHead;
29832984
commandRXTail = commandRXHead;
29842985
commandTXTail = commandTXHead;
2986+
waitRemoteCommandResponse = false;
29852987
}
29862988

29872989
//Output VC link status

0 commit comments

Comments
 (0)