Changed the MSTP_MASTER_STATE_ANSWER_DATA_REQUEST state to always send a REPLY_POSTPONED by

commenting out the section that checks for new packets to send.  It was not the intent of the BACnet standard, but it makes the Master Node FSM compliant.  It's either that or re-parse the message for a matching apdu and invoke id, and then defer if the next message does not match.  The problem happens when an unconfirmed request (i.e. WhoIs) is followed immediated by a confirmed request (i.e. ReadProperty) before the device can respond to the unconfirmed request (i.e. the I-Am is queued in the Transmit buffer).
This commit is contained in:
skarg
2007-07-14 00:09:16 +00:00
parent 3d54a5cd50
commit e53f38dd40
8 changed files with 271 additions and 441 deletions
+7 -4
View File
@@ -1177,9 +1177,11 @@ bool MSTP_Master_Node_FSM(volatile struct mstp_port_struct_t * mstp_port)
/* BACnet Data Expecting Reply, a Test_Request, or */
/* a proprietary frame that expects a reply is received. */
case MSTP_MASTER_STATE_ANSWER_DATA_REQUEST:
#if 0
/* FIXME: we always defer the reply to be safe */
/* FIXME: if we knew the APDU type received, we could
see if the next message was that same APDU type */
/* FIXME: we could always defer the reply to be safe */
see if the next message was that same APDU type
along with the matching src/dest and invoke ID */
if ((mstp_port->SilenceTimer <= Treply_delay) &&
mstp_port->TxReady) {
/* Reply */
@@ -1203,7 +1205,8 @@ bool MSTP_Master_Node_FSM(volatile struct mstp_port_struct_t * mstp_port)
mstp_port->TxReady = false;
mstp_port->master_state = MSTP_MASTER_STATE_IDLE;
}
}
} else
#endif
/* DeferredReply */
/* If no reply will be available from the higher layers */
/* within Treply_delay after the reception of the */
@@ -1213,7 +1216,7 @@ bool MSTP_Master_Node_FSM(volatile struct mstp_port_struct_t * mstp_port)
/* Any reply shall wait until this node receives the token. */
/* Call MSTP_Create_And_Send_Frame to transmit a Reply Postponed frame, */
/* and enter the IDLE state. */
else {
{
MSTP_Create_And_Send_Frame(mstp_port,
FRAME_TYPE_REPLY_POSTPONED,
mstp_port->SourceAddress,