Fixed MS/TP Slave Node FSM to enable receiving DNER frames (#832)
This commit is contained in:
@@ -1133,6 +1133,18 @@ static void MSTP_Slave_Node_FSM(void)
|
|||||||
MSTP_Flag.ReceivePacketPending = true;
|
MSTP_Flag.ReceivePacketPending = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case FRAME_TYPE_BACNET_DATA_NOT_EXPECTING_REPLY:
|
||||||
|
if ((DestinationAddress == MSTP_BROADCAST_ADDRESS) &&
|
||||||
|
(npdu_confirmed_service(InputBuffer, DataLength))) {
|
||||||
|
/* quietly discard any Confirmed-Request-PDU, whose
|
||||||
|
destination address is a multicast or
|
||||||
|
broadcast address, received from the
|
||||||
|
network layer. */
|
||||||
|
} else {
|
||||||
|
/* indicate successful reception to higher layer */
|
||||||
|
MSTP_Flag.ReceivePacketPending = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case FRAME_TYPE_TEST_REQUEST:
|
case FRAME_TYPE_TEST_REQUEST:
|
||||||
MSTP_Send_Frame(FRAME_TYPE_TEST_RESPONSE, SourceAddress,
|
MSTP_Send_Frame(FRAME_TYPE_TEST_RESPONSE, SourceAddress,
|
||||||
This_Station, &InputBuffer[0], DataLength);
|
This_Station, &InputBuffer[0], DataLength);
|
||||||
@@ -1140,7 +1152,6 @@ static void MSTP_Slave_Node_FSM(void)
|
|||||||
case FRAME_TYPE_TOKEN:
|
case FRAME_TYPE_TOKEN:
|
||||||
case FRAME_TYPE_POLL_FOR_MASTER:
|
case FRAME_TYPE_POLL_FOR_MASTER:
|
||||||
case FRAME_TYPE_TEST_RESPONSE:
|
case FRAME_TYPE_TEST_RESPONSE:
|
||||||
case FRAME_TYPE_BACNET_DATA_NOT_EXPECTING_REPLY:
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1163,6 +1163,18 @@ static void MSTP_Slave_Node_FSM(void)
|
|||||||
MSTP_Flag.ReceivePacketPending = true;
|
MSTP_Flag.ReceivePacketPending = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case FRAME_TYPE_BACNET_DATA_NOT_EXPECTING_REPLY:
|
||||||
|
if ((DestinationAddress == MSTP_BROADCAST_ADDRESS) &&
|
||||||
|
(npdu_confirmed_service(InputBuffer, DataLength))) {
|
||||||
|
/* quietly discard any Confirmed-Request-PDU, whose
|
||||||
|
destination address is a multicast or
|
||||||
|
broadcast address, received from the
|
||||||
|
network layer. */
|
||||||
|
} else {
|
||||||
|
/* indicate successful reception to higher layer */
|
||||||
|
MSTP_Flag.ReceivePacketPending = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case FRAME_TYPE_TEST_REQUEST:
|
case FRAME_TYPE_TEST_REQUEST:
|
||||||
MSTP_Send_Frame(FRAME_TYPE_TEST_RESPONSE, SourceAddress,
|
MSTP_Send_Frame(FRAME_TYPE_TEST_RESPONSE, SourceAddress,
|
||||||
This_Station, &InputBuffer[0], DataLength);
|
This_Station, &InputBuffer[0], DataLength);
|
||||||
@@ -1170,7 +1182,6 @@ static void MSTP_Slave_Node_FSM(void)
|
|||||||
case FRAME_TYPE_TOKEN:
|
case FRAME_TYPE_TOKEN:
|
||||||
case FRAME_TYPE_POLL_FOR_MASTER:
|
case FRAME_TYPE_POLL_FOR_MASTER:
|
||||||
case FRAME_TYPE_TEST_RESPONSE:
|
case FRAME_TYPE_TEST_RESPONSE:
|
||||||
case FRAME_TYPE_BACNET_DATA_NOT_EXPECTING_REPLY:
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1254,6 +1254,22 @@ void MSTP_Slave_Node_FSM(struct mstp_port_struct_t *mstp_port)
|
|||||||
(void)MSTP_Put_Receive(mstp_port);
|
(void)MSTP_Put_Receive(mstp_port);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case FRAME_TYPE_BACNET_DATA_NOT_EXPECTING_REPLY:
|
||||||
|
case FRAME_TYPE_BACNET_EXTENDED_DATA_NOT_EXPECTING_REPLY:
|
||||||
|
if ((mstp_port->DestinationAddress == MSTP_BROADCAST_ADDRESS) &&
|
||||||
|
(npdu_confirmed_service(
|
||||||
|
mstp_port->InputBuffer, mstp_port->DataLength))) {
|
||||||
|
/* quietly discard any Confirmed-Request-PDU,
|
||||||
|
whose destination address is a multicast or
|
||||||
|
broadcast address, received from the
|
||||||
|
network layer. */
|
||||||
|
} else {
|
||||||
|
/* ForUs */
|
||||||
|
/* indicate successful reception
|
||||||
|
to the higher layers */
|
||||||
|
(void)MSTP_Put_Receive(mstp_port);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case FRAME_TYPE_TEST_REQUEST:
|
case FRAME_TYPE_TEST_REQUEST:
|
||||||
MSTP_Create_And_Send_Frame(
|
MSTP_Create_And_Send_Frame(
|
||||||
mstp_port, FRAME_TYPE_TEST_RESPONSE,
|
mstp_port, FRAME_TYPE_TEST_RESPONSE,
|
||||||
@@ -1263,8 +1279,6 @@ void MSTP_Slave_Node_FSM(struct mstp_port_struct_t *mstp_port)
|
|||||||
case FRAME_TYPE_TOKEN:
|
case FRAME_TYPE_TOKEN:
|
||||||
case FRAME_TYPE_POLL_FOR_MASTER:
|
case FRAME_TYPE_POLL_FOR_MASTER:
|
||||||
case FRAME_TYPE_TEST_RESPONSE:
|
case FRAME_TYPE_TEST_RESPONSE:
|
||||||
case FRAME_TYPE_BACNET_DATA_NOT_EXPECTING_REPLY:
|
|
||||||
case FRAME_TYPE_BACNET_EXTENDED_DATA_NOT_EXPECTING_REPLY:
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user