diff --git a/CHANGELOG.md b/CHANGELOG.md index 44f1d2c3..efcd4a14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ The git repositories are hosted at the following sites: ### Fixed +* Fixed NDPU comparison functions that were missing segment-ack PDU. (#991) * Fixed WriteProperty NULL bypass which is only for present-value property of commandable objects. (#984) * Fixed the ghost Device ID 0 in the I-Am response when the actual diff --git a/ports/at91sam7s/dlmstp.c b/ports/at91sam7s/dlmstp.c index 7460d439..fbd3d161 100644 --- a/ports/at91sam7s/dlmstp.c +++ b/ports/at91sam7s/dlmstp.c @@ -264,6 +264,7 @@ static bool dlmstp_compare_data_expecting_reply(const uint8_t *request_pdu, break; case PDU_TYPE_REJECT: case PDU_TYPE_ABORT: + case PDU_TYPE_SEGMENT_ACK: reply.invoke_id = reply_pdu[offset + 1]; break; default: @@ -274,7 +275,8 @@ static bool dlmstp_compare_data_expecting_reply(const uint8_t *request_pdu, } /* these services don't have service choice included */ if ((reply.pdu_type != PDU_TYPE_REJECT) && - (reply.pdu_type != PDU_TYPE_ABORT)) { + (reply.pdu_type != PDU_TYPE_ABORT) && + (reply.pdu_type != PDU_TYPE_SEGMENT_ACK)) { if (request.service_choice != reply.service_choice) { return false; } diff --git a/ports/bdk-atxx4-mstp/dlmstp.c b/ports/bdk-atxx4-mstp/dlmstp.c index 673b684f..023a67c1 100644 --- a/ports/bdk-atxx4-mstp/dlmstp.c +++ b/ports/bdk-atxx4-mstp/dlmstp.c @@ -265,6 +265,7 @@ static bool dlmstp_compare_data_expecting_reply(const uint8_t *request_pdu, break; case PDU_TYPE_REJECT: case PDU_TYPE_ABORT: + case PDU_TYPE_SEGMENT_ACK: reply.invoke_id = reply_pdu[offset + 1]; break; default: @@ -275,7 +276,8 @@ static bool dlmstp_compare_data_expecting_reply(const uint8_t *request_pdu, } /* these services don't have service choice included */ if ((reply.pdu_type != PDU_TYPE_REJECT) && - (reply.pdu_type != PDU_TYPE_ABORT)) { + (reply.pdu_type != PDU_TYPE_ABORT) && + (reply.pdu_type != PDU_TYPE_SEGMENT_ACK)) { if (request.service_choice != reply.service_choice) { return false; } diff --git a/ports/bsd/dlmstp.c b/ports/bsd/dlmstp.c index 36bfafa5..3534df0e 100644 --- a/ports/bsd/dlmstp.c +++ b/ports/bsd/dlmstp.c @@ -488,6 +488,7 @@ static bool dlmstp_compare_data_expecting_reply( break; case PDU_TYPE_REJECT: case PDU_TYPE_ABORT: + case PDU_TYPE_SEGMENT_ACK: reply.invoke_id = reply_pdu[offset + 1]; break; default: @@ -495,7 +496,8 @@ static bool dlmstp_compare_data_expecting_reply( } /* these don't have service choice included */ if ((reply.pdu_type == PDU_TYPE_REJECT) || - (reply.pdu_type == PDU_TYPE_ABORT)) { + (reply.pdu_type == PDU_TYPE_ABORT) || + (reply.pdu_type == PDU_TYPE_SEGMENT_ACK)) { if (request.invoke_id != reply.invoke_id) { debug_printf("DLMSTP: DER Compare failed: " "Invoke ID mismatch.\n"); diff --git a/ports/bsd/dlmstp_port.c b/ports/bsd/dlmstp_port.c index 6697169a..910e5b1b 100644 --- a/ports/bsd/dlmstp_port.c +++ b/ports/bsd/dlmstp_port.c @@ -526,6 +526,7 @@ static bool dlmstp_compare_data_expecting_reply( break; case PDU_TYPE_REJECT: case PDU_TYPE_ABORT: + case PDU_TYPE_SEGMENT_ACK: reply.invoke_id = reply_pdu[offset + 1]; break; default: @@ -533,7 +534,8 @@ static bool dlmstp_compare_data_expecting_reply( } /* these don't have service choice included */ if ((reply.pdu_type == PDU_TYPE_REJECT) || - (reply.pdu_type == PDU_TYPE_ABORT)) { + (reply.pdu_type == PDU_TYPE_ABORT) || + (reply.pdu_type == PDU_TYPE_SEGMENT_ACK)) { if (request.invoke_id != reply.invoke_id) { debug_printf("DLMSTP: DER Compare failed: " "Invoke ID mismatch.\n"); diff --git a/ports/linux/dlmstp.c b/ports/linux/dlmstp.c index a1783a17..a16bc547 100644 --- a/ports/linux/dlmstp.c +++ b/ports/linux/dlmstp.c @@ -489,6 +489,7 @@ static bool dlmstp_compare_data_expecting_reply( break; case PDU_TYPE_REJECT: case PDU_TYPE_ABORT: + case PDU_TYPE_SEGMENT_ACK: reply.invoke_id = reply_pdu[offset + 1]; break; default: @@ -496,7 +497,8 @@ static bool dlmstp_compare_data_expecting_reply( } /* these don't have service choice included */ if ((reply.pdu_type == PDU_TYPE_REJECT) || - (reply.pdu_type == PDU_TYPE_ABORT)) { + (reply.pdu_type == PDU_TYPE_ABORT) || + (reply.pdu_type == PDU_TYPE_SEGMENT_ACK)) { if (request.invoke_id != reply.invoke_id) { debug_printf("DLMSTP: DER Compare failed: " "Invoke ID mismatch.\n"); diff --git a/ports/linux/dlmstp_port.c b/ports/linux/dlmstp_port.c index f1019988..c25a98fb 100644 --- a/ports/linux/dlmstp_port.c +++ b/ports/linux/dlmstp_port.c @@ -471,6 +471,7 @@ static bool dlmstp_compare_data_expecting_reply( break; case PDU_TYPE_REJECT: case PDU_TYPE_ABORT: + case PDU_TYPE_SEGMENT_ACK: reply.invoke_id = reply_pdu[offset + 1]; break; default: @@ -478,7 +479,8 @@ static bool dlmstp_compare_data_expecting_reply( } /* these don't have service choice included */ if ((reply.pdu_type == PDU_TYPE_REJECT) || - (reply.pdu_type == PDU_TYPE_ABORT)) { + (reply.pdu_type == PDU_TYPE_ABORT) || + (reply.pdu_type == PDU_TYPE_SEGMENT_ACK)) { if (request.invoke_id != reply.invoke_id) { debug_printf("DLMSTP: DER Compare failed: " "Invoke ID mismatch.\n"); diff --git a/ports/pic18f6720/mstp.c b/ports/pic18f6720/mstp.c index a9dc75a1..a57f1aac 100644 --- a/ports/pic18f6720/mstp.c +++ b/ports/pic18f6720/mstp.c @@ -586,6 +586,7 @@ static bool mstp_compare_data_expecting_reply(uint8_t *request_pdu, break; case PDU_TYPE_REJECT: case PDU_TYPE_ABORT: + case PDU_TYPE_SEGMENT_ACK: reply.invoke_id = reply_pdu[offset + 1]; break; default: @@ -596,7 +597,8 @@ static bool mstp_compare_data_expecting_reply(uint8_t *request_pdu, } /* these services don't have service choice included */ if ((reply.pdu_type != PDU_TYPE_REJECT) && - (reply.pdu_type != PDU_TYPE_ABORT)) { + (reply.pdu_type != PDU_TYPE_ABORT) && + (reply.pdu_type != PDU_TYPE_SEGMENT_ACK)) { if (request.service_choice != reply.service_choice) { return false; } diff --git a/ports/pic18f97j60/mstp.c b/ports/pic18f97j60/mstp.c index 373acfc7..2c71e2ed 100644 --- a/ports/pic18f97j60/mstp.c +++ b/ports/pic18f97j60/mstp.c @@ -594,6 +594,7 @@ static bool mstp_compare_data_expecting_reply(uint8_t *request_pdu, break; case PDU_TYPE_REJECT: case PDU_TYPE_ABORT: + case PDU_TYPE_SEGMENT_ACK: reply.invoke_id = reply_pdu[offset + 1]; break; default: @@ -604,7 +605,8 @@ static bool mstp_compare_data_expecting_reply(uint8_t *request_pdu, } /* these services don't have service choice included */ if ((reply.pdu_type != PDU_TYPE_REJECT) && - (reply.pdu_type != PDU_TYPE_ABORT)) { + (reply.pdu_type != PDU_TYPE_ABORT) && + (reply.pdu_type != PDU_TYPE_SEGMENT_ACK)) { if (request.service_choice != reply.service_choice) { return false; } diff --git a/ports/win32/dlmstp-mm.c b/ports/win32/dlmstp-mm.c index 5cdb7ceb..3c816800 100644 --- a/ports/win32/dlmstp-mm.c +++ b/ports/win32/dlmstp-mm.c @@ -377,6 +377,7 @@ bool dlmstp_compare_data_expecting_reply( break; case PDU_TYPE_REJECT: case PDU_TYPE_ABORT: + case PDU_TYPE_SEGMENT_ACK: reply.invoke_id = reply_pdu[offset + 1]; break; default: @@ -384,7 +385,8 @@ bool dlmstp_compare_data_expecting_reply( } /* these don't have service choice included */ if ((reply.pdu_type == PDU_TYPE_REJECT) || - (reply.pdu_type == PDU_TYPE_ABORT)) { + (reply.pdu_type == PDU_TYPE_ABORT) || + (reply.pdu_type == PDU_TYPE_SEGMENT_ACK)) { if (request.invoke_id != reply.invoke_id) { return false; } diff --git a/ports/win32/dlmstp.c b/ports/win32/dlmstp.c index 144396af..d8c0ae23 100644 --- a/ports/win32/dlmstp.c +++ b/ports/win32/dlmstp.c @@ -364,6 +364,7 @@ static bool dlmstp_compare_data_expecting_reply( break; case PDU_TYPE_REJECT: case PDU_TYPE_ABORT: + case PDU_TYPE_SEGMENT_ACK: reply.invoke_id = reply_pdu[offset + 1]; break; default: @@ -371,7 +372,8 @@ static bool dlmstp_compare_data_expecting_reply( } /* these don't have service choice included */ if ((reply.pdu_type == PDU_TYPE_REJECT) || - (reply.pdu_type == PDU_TYPE_ABORT)) { + (reply.pdu_type == PDU_TYPE_ABORT) || + (reply.pdu_type == PDU_TYPE_SEGMENT_ACK)) { if (request.invoke_id != reply.invoke_id) { return false; } diff --git a/src/bacnet/datalink/dlmstp.c b/src/bacnet/datalink/dlmstp.c index 5af8458b..8852d40b 100644 --- a/src/bacnet/datalink/dlmstp.c +++ b/src/bacnet/datalink/dlmstp.c @@ -200,6 +200,7 @@ static bool MSTP_Compare_Data_Expecting_Reply( break; case PDU_TYPE_REJECT: case PDU_TYPE_ABORT: + case PDU_TYPE_SEGMENT_ACK: reply.invoke_id = reply_pdu[offset + 1]; break; default: @@ -207,7 +208,8 @@ static bool MSTP_Compare_Data_Expecting_Reply( } /* these don't have service choice included */ if ((reply.pdu_type == PDU_TYPE_REJECT) || - (reply.pdu_type == PDU_TYPE_ABORT)) { + (reply.pdu_type == PDU_TYPE_ABORT) || + (reply.pdu_type == PDU_TYPE_SEGMENT_ACK)) { if (request.invoke_id != reply.invoke_id) { return false; }