Fix [bug#80] npdu_decode via deprecation (#447)

* Fix [bug#80] npdu_decode via deprecation

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
Steve Karg
2023-07-10 17:27:10 -05:00
committed by GitHub
parent 13c85db4cb
commit 4efaf097c0
23 changed files with 81 additions and 67 deletions
+6 -5
View File
@@ -567,8 +567,8 @@ static bool mstp_compare_data_expecting_reply(uint8_t *request_pdu,
/* decode the request data */
request.address.mac[0] = src_address;
request.address.mac_len = 1;
offset = npdu_decode(
&request_pdu[0], NULL, &request.address, &request.npdu_data);
offset = bacnet_npdu_decode(request_pdu, request_pdu_len, NULL,
&request.address, &request.npdu_data);
if (request.npdu_data.network_layer_message) {
return false;
}
@@ -585,7 +585,8 @@ static bool mstp_compare_data_expecting_reply(uint8_t *request_pdu,
/* decode the reply data */
reply.address.mac[0] = dest_address;
reply.address.mac_len = 1;
offset = npdu_decode(&reply_pdu[0], &reply.address, NULL, &reply.npdu_data);
offset = bacnet_npdu_decode(
reply_pdu, reply_pdu_len, &reply.address, NULL, &reply.npdu_data);
if (reply.npdu_data.network_layer_message) {
return false;
}
@@ -753,9 +754,9 @@ bool MSTP_Master_Node_FSM(volatile struct mstp_port_struct_t *mstp_port)
break;
case FRAME_TYPE_BACNET_DATA_NOT_EXPECTING_REPLY:
if ((mstp_port->DestinationAddress ==
MSTP_BROADCAST_ADDRESS) &&
MSTP_BROADCAST_ADDRESS) &&
(npdu_confirmed_service(mstp_port->InputBuffer,
mstp_port->DataLength))) {
mstp_port->DataLength))) {
/* BTL test: verifies that the IUT will quietly
discard any Confirmed-Request-PDU, whose
destination address is a multicast or