diff --git a/ports/at91sam7s/dlmstp.c b/ports/at91sam7s/dlmstp.c index fbd3d161..f3cf8c98 100644 --- a/ports/at91sam7s/dlmstp.c +++ b/ports/at91sam7s/dlmstp.c @@ -795,21 +795,26 @@ static bool MSTP_Master_Node_FSM(void) Master_State = MSTP_MASTER_STATE_DONE_WITH_TOKEN; break; - case FRAME_TYPE_BACNET_DATA_NOT_EXPECTING_REPLY: + case FRAME_TYPE_TOKEN: + case FRAME_TYPE_POLL_FOR_MASTER: + case FRAME_TYPE_REPLY_TO_POLL_FOR_MASTER: + case FRAME_TYPE_TEST_REQUEST: + /* ReceivedUnexpectedFrame */ + /* FrameType has a value other than a FrameType + known to this node that indicates a reply */ + Master_State = + MSTP_MASTER_STATE_IDLE; + break; + default: /* ReceivedReply */ - /* or a proprietary type that indicates - a reply */ - /* indicate successful reception to - the higher layers */ + /* FrameType known to this node that + indicates a reply */ + /* indicate successful reception + to the higher layers */ MSTP_Flag.ReceivePacketPending = true; Master_State = MSTP_MASTER_STATE_DONE_WITH_TOKEN; break; - default: - /* if proprietary frame was expected, you might - need to transition to DONE WITH TOKEN */ - Master_State = MSTP_MASTER_STATE_IDLE; - break; } } else { /* ReceivedUnexpectedFrame */ diff --git a/ports/atmega328/dlmstp.c b/ports/atmega328/dlmstp.c index 757eb874..9da7a66a 100644 --- a/ports/atmega328/dlmstp.c +++ b/ports/atmega328/dlmstp.c @@ -680,21 +680,25 @@ static bool MSTP_Master_Node_FSM(void) Master_State = MSTP_MASTER_STATE_DONE_WITH_TOKEN; break; - case FRAME_TYPE_BACNET_DATA_NOT_EXPECTING_REPLY: + case FRAME_TYPE_TOKEN: + case FRAME_TYPE_POLL_FOR_MASTER: + case FRAME_TYPE_REPLY_TO_POLL_FOR_MASTER: + case FRAME_TYPE_TEST_REQUEST: + /* ReceivedUnexpectedFrame */ + /* FrameType has a value other than a FrameType + known to this node that indicates a reply */ + Master_State = MSTP_MASTER_STATE_IDLE; + break; + default: /* ReceivedReply */ - /* or a proprietary type that indicates a reply - */ - /* indicate successful reception to the higher - * layers */ + /* FrameType known to this node that + indicates a reply */ + /* indicate successful reception + to the higher layers */ MSTP_Flag.ReceivePacketPending = true; Master_State = MSTP_MASTER_STATE_DONE_WITH_TOKEN; break; - default: - /* if proprietary frame was expected, you might - need to transition to DONE WITH TOKEN */ - Master_State = MSTP_MASTER_STATE_IDLE; - break; } } else { /* ReceivedUnexpectedFrame */ diff --git a/ports/bdk-atxx4-mstp/dlmstp.c b/ports/bdk-atxx4-mstp/dlmstp.c index 023a67c1..e1b9a0aa 100644 --- a/ports/bdk-atxx4-mstp/dlmstp.c +++ b/ports/bdk-atxx4-mstp/dlmstp.c @@ -817,21 +817,26 @@ static bool MSTP_Master_Node_FSM(void) Master_State = MSTP_MASTER_STATE_DONE_WITH_TOKEN; break; - case FRAME_TYPE_BACNET_DATA_NOT_EXPECTING_REPLY: + case FRAME_TYPE_TOKEN: + case FRAME_TYPE_POLL_FOR_MASTER: + case FRAME_TYPE_REPLY_TO_POLL_FOR_MASTER: + case FRAME_TYPE_TEST_REQUEST: + /* ReceivedUnexpectedFrame */ + /* FrameType has a value other than a FrameType + known to this node that indicates a reply */ + Master_State = + MSTP_MASTER_STATE_IDLE; + break; + default: /* ReceivedReply */ - /* or a proprietary type that indicates - a reply */ - /* indicate successful reception to - the higher layers */ + /* FrameType known to this node that + indicates a reply */ + /* indicate successful reception + to the higher layers */ MSTP_Flag.ReceivePacketPending = true; Master_State = MSTP_MASTER_STATE_DONE_WITH_TOKEN; break; - default: - /* if proprietary frame was expected, you might - need to transition to DONE WITH TOKEN */ - Master_State = MSTP_MASTER_STATE_IDLE; - break; } } else { /* ReceivedUnexpectedFrame */ diff --git a/ports/pic18f6720/mstp.c b/ports/pic18f6720/mstp.c index a57f1aac..7afd1c5a 100644 --- a/ports/pic18f6720/mstp.c +++ b/ports/pic18f6720/mstp.c @@ -850,12 +850,22 @@ bool MSTP_Master_Node_FSM(volatile struct mstp_port_struct_t *mstp_port) mstp_port->master_state = MSTP_MASTER_STATE_IDLE; break; - case FRAME_TYPE_BACNET_DATA_NOT_EXPECTING_REPLY: + case FRAME_TYPE_TOKEN: + case FRAME_TYPE_POLL_FOR_MASTER: + case FRAME_TYPE_REPLY_TO_POLL_FOR_MASTER: + case FRAME_TYPE_TEST_REQUEST: + /* ReceivedUnexpectedFrame */ + /* FrameType has a value other than a FrameType + known to this node that indicates a reply */ + mstp_port->master_state = + MSTP_MASTER_STATE_IDLE; + break; + default: /* ReceivedReply */ - /* or a proprietary type that indicates a reply - */ - /* indicate successful reception to the higher - * layers */ + /* FrameType known to this node that + indicates a reply */ + /* indicate successful reception + to the higher layers */ dlmstp_put_receive( mstp_port->SourceAddress, /* source MS/TP address */ @@ -864,12 +874,6 @@ bool MSTP_Master_Node_FSM(volatile struct mstp_port_struct_t *mstp_port) mstp_port->master_state = MSTP_MASTER_STATE_DONE_WITH_TOKEN; break; - default: - /* if proprietary frame was expected, you might - need to transition to DONE WITH TOKEN */ - mstp_port->master_state = - MSTP_MASTER_STATE_IDLE; - break; } } else { /* ReceivedUnexpectedFrame */ diff --git a/ports/pic18f97j60/mstp.c b/ports/pic18f97j60/mstp.c index 2c71e2ed..38043746 100644 --- a/ports/pic18f97j60/mstp.c +++ b/ports/pic18f97j60/mstp.c @@ -858,12 +858,22 @@ bool MSTP_Master_Node_FSM(volatile struct mstp_port_struct_t *mstp_port) mstp_port->master_state = MSTP_MASTER_STATE_IDLE; break; - case FRAME_TYPE_BACNET_DATA_NOT_EXPECTING_REPLY: + case FRAME_TYPE_TOKEN: + case FRAME_TYPE_POLL_FOR_MASTER: + case FRAME_TYPE_REPLY_TO_POLL_FOR_MASTER: + case FRAME_TYPE_TEST_REQUEST: + /* ReceivedUnexpectedFrame */ + /* FrameType has a value other than a FrameType + known to this node that indicates a reply */ + mstp_port->master_state = + MSTP_MASTER_STATE_IDLE; + break; + default: /* ReceivedReply */ - /* or a proprietary type that indicates a reply - */ - /* indicate successful reception to the higher - * layers */ + /* FrameType known to this node that + indicates a reply */ + /* indicate successful reception + to the higher layers */ dlmstp_put_receive( mstp_port->SourceAddress, /* source MS/TP address */ @@ -872,12 +882,6 @@ bool MSTP_Master_Node_FSM(volatile struct mstp_port_struct_t *mstp_port) mstp_port->master_state = MSTP_MASTER_STATE_DONE_WITH_TOKEN; break; - default: - /* if proprietary frame was expected, you might - need to transition to DONE WITH TOKEN */ - mstp_port->master_state = - MSTP_MASTER_STATE_IDLE; - break; } } else { /* ReceivedUnexpectedFrame */ diff --git a/src/bacnet/datalink/mstp.c b/src/bacnet/datalink/mstp.c index cd2c43ae..b83cda22 100644 --- a/src/bacnet/datalink/mstp.c +++ b/src/bacnet/datalink/mstp.c @@ -836,8 +836,6 @@ bool MSTP_Master_Node_FSM(struct mstp_port_struct_t *mstp_port) mstp_port->master_state = MSTP_MASTER_STATE_WAIT_FOR_REPLY; break; - case FRAME_TYPE_TEST_RESPONSE: - case FRAME_TYPE_BACNET_DATA_NOT_EXPECTING_REPLY: default: /* SendNoWait */ mstp_port->master_state = @@ -883,22 +881,26 @@ bool MSTP_Master_Node_FSM(struct mstp_port_struct_t *mstp_port) mstp_port->master_state = MSTP_MASTER_STATE_DONE_WITH_TOKEN; break; - case FRAME_TYPE_BACNET_DATA_NOT_EXPECTING_REPLY: + case FRAME_TYPE_TOKEN: + case FRAME_TYPE_POLL_FOR_MASTER: + case FRAME_TYPE_REPLY_TO_POLL_FOR_MASTER: + case FRAME_TYPE_TEST_REQUEST: + /* ReceivedUnexpectedFrame */ + /* FrameType has a value other than a FrameType + known to this node that indicates a reply */ + mstp_port->master_state = + MSTP_MASTER_STATE_IDLE; + break; + default: /* ReceivedReply */ - /* or a proprietary type that indicates a reply - */ - /* indicate successful reception to the higher - * layers */ + /* FrameType known to this node that + indicates a reply */ + /* indicate successful reception + to the higher layers */ (void)MSTP_Put_Receive(mstp_port); mstp_port->master_state = MSTP_MASTER_STATE_DONE_WITH_TOKEN; break; - default: - /* if proprietary frame was expected, you might - need to transition to DONE WITH TOKEN */ - mstp_port->master_state = - MSTP_MASTER_STATE_IDLE; - break; } } else { /* ReceivedUnexpectedFrame */