Skip to content

Commit 9671c34

Browse files
authored
Merge pull request #547 from LeeLeahy2/vct-fix-atc-complete
VCT: BUG FIX - Only complete the ATC command when the VC is connected
2 parents fe0cbd4 + 3656708 commit 9671c34

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Firmware/Tools/VcServerTest.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,12 +571,13 @@ void radioToPcLinkStatus(VC_SERIAL_MESSAGE_HEADER * header, uint8_t * data, uint
571571
case VC_STATE_CONNECTED:
572572
if (DEBUG_PC_CMD_ISSUE)
573573
printf("VC %d CONNECTED\n", srcVc);
574-
if (myVc == VC_SERVER)
574+
if (COMMAND_PENDING(pcCommandQueue, CMD_ATC)
575+
&& (pcActiveCommand == CMD_ATC) && (srcVc == pcCommandVc))
575576
{
576577
if (virtualCircuitList[srcVc].activeCommand == CMD_ATC)
577578
COMMAND_COMPLETE(virtualCircuitList[srcVc].commandQueue, virtualCircuitList[srcVc].activeCommand);
579+
COMMAND_COMPLETE(pcCommandQueue, pcActiveCommand);
578580
}
579-
COMMAND_COMPLETE(pcCommandQueue, pcActiveCommand);
580581
if (DISPLAY_VC_STATE)
581582
printf("======= VC %d CONNECTED ======\n", srcVc);
582583
if (srcVc != myVc)

0 commit comments

Comments
 (0)