Feature/mstp valid frame not for us stats (#1053)

* Fixed ISO C90 forbids mixed declarations and code warning.

* Fixed the MS/TP invalid frame counter that was incremented for valid frames not for us.
This commit is contained in:
Steve Karg
2025-08-01 09:58:45 -05:00
committed by GitHub
parent 1bebd6ac81
commit 4095a7f335
15 changed files with 198 additions and 25 deletions
+5 -1
View File
@@ -210,11 +210,13 @@ static void *dlmstp_receive_fsm_task(void *pArg)
for (;;) {
/* only do receive state machine while we don't have a frame */
if ((mstp_port->ReceivedValidFrame == false) &&
(mstp_port->ReceivedValidFrameNotForUs == false) &&
(mstp_port->ReceivedInvalidFrame == false)) {
do {
RS485_Check_UART_Data(mstp_port);
MSTP_Receive_Frame_FSM((struct mstp_port_struct_t *)pArg);
received_frame = mstp_port->ReceivedValidFrame ||
mstp_port->ReceivedValidFrameNotForUs ||
mstp_port->ReceivedInvalidFrame;
if (received_frame) {
pthread_cond_signal(&poSharedData->Received_Frame_Flag);
@@ -245,11 +247,13 @@ static void *dlmstp_master_fsm_task(void *pArg)
for (;;) {
if (mstp_port->ReceivedValidFrame == false &&
mstp_port->ReceivedValidFrameNotForUs == false &&
mstp_port->ReceivedInvalidFrame == false) {
RS485_Check_UART_Data(mstp_port);
MSTP_Receive_Frame_FSM(mstp_port);
}
if (mstp_port->ReceivedValidFrame || mstp_port->ReceivedInvalidFrame) {
if (mstp_port->ReceivedValidFrame || mstp_port->ReceivedInvalidFrame ||
mstp_port->ReceivedValidFrameNotForUs) {
run_master = true;
} else {
silence = mstp_port->SilenceTimer(NULL);