From 0c963ecc3063db7f9cc4d3cf604add3aab4af272 Mon Sep 17 00:00:00 2001 From: skarg Date: Sat, 13 Apr 2013 16:18:07 +0000 Subject: [PATCH] Fixed MS/TP where double messages were send on Data-expecting-reply frames. Thank you, Simone Tolotti. --- bacnet-stack/ports/at91sam7s/dlmstp.c | 2 ++ bacnet-stack/ports/stm32f10x/dlmstp.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/bacnet-stack/ports/at91sam7s/dlmstp.c b/bacnet-stack/ports/at91sam7s/dlmstp.c index 2b3d5a70..0cd79461 100644 --- a/bacnet-stack/ports/at91sam7s/dlmstp.c +++ b/bacnet-stack/ports/at91sam7s/dlmstp.c @@ -1122,6 +1122,8 @@ static bool MSTP_Master_Node_FSM( Master_State = MSTP_MASTER_STATE_IDLE; /* clear our flag we were holding for comparison */ MSTP_Flag.ReceivedValidFrame = false; + /* clear the queue */ + (void) Ringbuf_Pop(&PDU_Queue, NULL); } else if ((Timer_Silence() > Treply_delay) || (pkt != NULL)) { /* DeferredReply */ /* If no reply will be available from the higher layers */ diff --git a/bacnet-stack/ports/stm32f10x/dlmstp.c b/bacnet-stack/ports/stm32f10x/dlmstp.c index a8811273..8b212ec4 100644 --- a/bacnet-stack/ports/stm32f10x/dlmstp.c +++ b/bacnet-stack/ports/stm32f10x/dlmstp.c @@ -1236,6 +1236,8 @@ static bool MSTP_Master_Node_FSM( Master_State = MSTP_MASTER_STATE_IDLE; /* clear our flag we were holding for comparison */ MSTP_Flag.ReceivedValidFrame = false; + /* clear the queue */ + (void) Ringbuf_Pop(&PDU_Queue, NULL); } else if (rs485_silence_elapsed(Treply_delay) || (pkt != NULL)) { /* DeferredReply */ /* If no reply will be available from the higher layers */