Skip to content

Commit 85406d1

Browse files
authored
Merge pull request #564 from LeeLeahy2/vct-display-vc-state
VCT: Display the virtual circuit state transition
2 parents 0cd70fd + 6b8934d commit 85406d1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Firmware/Tools/VcServerTest.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,12 @@ void radioToPcLinkStatus(VC_SERIAL_MESSAGE_HEADER * header, uint8_t * data, uint
505505
newState = vcMsg->vcState;
506506
virtualCircuitList[srcVc].vcState = newState;
507507

508+
//Display the state if requested
509+
if (DISPLAY_STATE_TRANSITION || (newState == VC_STATE_LINK_DOWN)
510+
|| (previousState == VC_STATE_LINK_DOWN)
511+
|| ((newState != previousState) && (virtualCircuitList[srcVc].activeCommand < CMD_LIST_SIZE)))
512+
printf("VC%d: %s --> %s\n", srcVc, vcStateNames[previousState], vcStateNames[newState]);
513+
508514
//Save the LoRaSerial radio's unique ID
509515
//Determine if the PC's value is valid
510516
memset(uniqueId, UNIQUE_ID_ERASE_VALUE, sizeof(uniqueId));
@@ -546,9 +552,6 @@ void radioToPcLinkStatus(VC_SERIAL_MESSAGE_HEADER * header, uint8_t * data, uint
546552
}
547553
}
548554

549-
//Display the state if requested
550-
if (DISPLAY_STATE_TRANSITION)
551-
printf("VC%d: %s --> %s\n", srcVc, vcStateNames[previousState], vcStateNames[newState]);
552555
switch (newState)
553556
{
554557
default:

0 commit comments

Comments
 (0)