From ba20c1cc03b922aca0b5677484ad1d3b8d0310d1 Mon Sep 17 00:00:00 2001 From: skarg Date: Fri, 28 Sep 2007 23:38:54 +0000 Subject: [PATCH] Corrected problem in MS/TP state machine where device was sending PFM frames to itself (destination address same as source address) when solemaster is true (Thank you to John Stachler!). --- bacnet-stack/mstp.c | 2 +- bacnet-stack/ports/at91sam7s/dlmstp.c | 2 +- bacnet-stack/ports/atmega168/dlmstp.c | 2 +- bacnet-stack/ports/pic18f6720/mstp.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bacnet-stack/mstp.c b/bacnet-stack/mstp.c index a1341c8e..bead82e6 100644 --- a/bacnet-stack/mstp.c +++ b/bacnet-stack/mstp.c @@ -845,7 +845,7 @@ bool MSTP_Master_Node_FSM(volatile struct mstp_port_struct_t * mstp_port) } else if (next_poll_station == mstp_port->Next_Station) { if (mstp_port->SoleMaster == true) { /* SoleMasterRestartMaintenancePFM */ - mstp_port->Poll_Station = next_poll_station; + mstp_port->Poll_Station = next_next_station; MSTP_Create_And_Send_Frame(mstp_port, FRAME_TYPE_POLL_FOR_MASTER, mstp_port->Poll_Station, mstp_port->This_Station, NULL, 0); diff --git a/bacnet-stack/ports/at91sam7s/dlmstp.c b/bacnet-stack/ports/at91sam7s/dlmstp.c index 954fbfa4..851a4ddf 100644 --- a/bacnet-stack/ports/at91sam7s/dlmstp.c +++ b/bacnet-stack/ports/at91sam7s/dlmstp.c @@ -925,7 +925,7 @@ static bool MSTP_Master_Node_FSM(void) } else if (next_poll_station == Next_Station) { if (MSTP_Flag.SoleMaster == true) { /* SoleMasterRestartMaintenancePFM */ - Poll_Station = next_poll_station; + Poll_Station = next_next_station; MSTP_Send_Frame( FRAME_TYPE_POLL_FOR_MASTER, Poll_Station, This_Station, NULL, 0); diff --git a/bacnet-stack/ports/atmega168/dlmstp.c b/bacnet-stack/ports/atmega168/dlmstp.c index 6f3cee72..0b5b4a64 100644 --- a/bacnet-stack/ports/atmega168/dlmstp.c +++ b/bacnet-stack/ports/atmega168/dlmstp.c @@ -921,7 +921,7 @@ static bool MSTP_Master_Node_FSM(void) } else if (next_poll_station == Next_Station) { if (MSTP_Flag.SoleMaster == true) { /* SoleMasterRestartMaintenancePFM */ - Poll_Station = next_poll_station; + Poll_Station = next_next_station; MSTP_Send_Frame( FRAME_TYPE_POLL_FOR_MASTER, Poll_Station, This_Station, NULL, 0); diff --git a/bacnet-stack/ports/pic18f6720/mstp.c b/bacnet-stack/ports/pic18f6720/mstp.c index faae1286..c7cf5ccd 100644 --- a/bacnet-stack/ports/pic18f6720/mstp.c +++ b/bacnet-stack/ports/pic18f6720/mstp.c @@ -832,7 +832,7 @@ bool MSTP_Master_Node_FSM(volatile struct mstp_port_struct_t * mstp_port) } else if (next_poll_station == mstp_port->Next_Station) { if (mstp_port->SoleMaster == true) { /* SoleMasterRestartMaintenancePFM */ - mstp_port->Poll_Station = next_poll_station; + mstp_port->Poll_Station = next_next_station; MSTP_Create_And_Send_Frame(mstp_port, FRAME_TYPE_POLL_FOR_MASTER, mstp_port->Poll_Station, mstp_port->This_Station, NULL, 0);