When MAC address length is zero, assume it is a broadcast. Updated the MS/TP to understand this.

This commit is contained in:
skarg
2014-11-02 05:27:14 +00:00
parent cab93e9db4
commit 3fca74bcfb
9 changed files with 41 additions and 21 deletions
+6 -8
View File
@@ -74,19 +74,17 @@ int dlmstp_send_pdu(
unsigned mtu_len = 0;
if (MSTP_Port.TxReady == false) {
if (npdu_data->confirmed_message)
if (npdu_data->confirmed_message) {
MSTP_Port.TxFrameType = FRAME_TYPE_BACNET_DATA_EXPECTING_REPLY;
else
} else {
MSTP_Port.TxFrameType = FRAME_TYPE_BACNET_DATA_NOT_EXPECTING_REPLY;
}
/* load destination MAC address */
if (dest && dest->mac_len == 1) {
if (dest->mac_len) {
destination = dest->mac[0];
} else {
#if PRINT_ENABLED
fprintf(stderr, "mstp: invalid destination MAC address!\n");
#endif
return -2;
/* mac_len = 0 is a broadcast address */
destination = MSTP_BROADCAST_ADDRESS;
}
/* header len */
mtu_len = MAX_HEADER - 2 /* data crc */ ;