Bugfix/mstp extended frames client (#592)
* Fix routing to a remote network in the router-mstp example. The net, len and adr fields of remote_dest are not initialized although they are used by the npdu_encode_pdu function in case of "Routing to another Router". Thank you, Eugene! * Fixed handling of received MS/TP extended frames. mstp_port->DataLength should be set to the actual length of decoded data. * Fix MSTP_Master_Node_FSM and MSTP_Slave_Node_FSM for extended frames. BACNET_EXTENDED_DATA frames should be treated the same as their corresponding BACNET_DATA frames. * Fixed MSTP COBS frame encoding cobs_frame_encode writes the encoded data to the beginning of the buffer, overwriting the frame header. The frame header is constructed before COBS frame encoding, so it contains the wrong Frame Type and Data Length. * Added extended frame client unit test * Fix router-ipv6 application for remote networks
This commit is contained in:
@@ -865,6 +865,7 @@ static void routed_apdu_handler(uint16_t snet,
|
||||
}
|
||||
return;
|
||||
}
|
||||
remote_dest = *dest;
|
||||
port = dnet_find(dest->net, &remote_dest);
|
||||
if (port) {
|
||||
if (port->net == dest->net) {
|
||||
@@ -917,7 +918,7 @@ static void routed_apdu_handler(uint16_t snet,
|
||||
port = Router_Table_Head;
|
||||
while (port != NULL) {
|
||||
if (port->net != snet) {
|
||||
datalink_send_pdu(port->net, dest, npdu, &Tx_Buffer[0],
|
||||
datalink_send_pdu(port->net, dest, npdu, &Tx_Buffer[0],
|
||||
npdu_len + apdu_len);
|
||||
}
|
||||
port = port->next;
|
||||
|
||||
@@ -891,6 +891,7 @@ static void routed_apdu_handler(uint16_t snet,
|
||||
}
|
||||
return;
|
||||
}
|
||||
remote_dest = *dest;
|
||||
port = dnet_find(dest->net, &remote_dest);
|
||||
if (port) {
|
||||
if (port->net == dest->net) {
|
||||
|
||||
Reference in New Issue
Block a user