This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/develop by this push:
     new a761949e0d fix(bacnet): fixed length calculation for APDUComplexAck
a761949e0d is described below

commit a761949e0d2180956bc539f45a2725ee593f0103
Author: Sebastian Rühl <[email protected]>
AuthorDate: Fri Apr 22 17:12:01 2022 +0200

    fix(bacnet): fixed length calculation for APDUComplexAck
---
 plc4go/internal/plc4go/bacnetip/readwrite/model/APDUComplexAck.go       | 2 +-
 protocols/bacnetip/src/main/resources/protocols/bacnetip/bacnetip.mspec | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/plc4go/internal/plc4go/bacnetip/readwrite/model/APDUComplexAck.go 
b/plc4go/internal/plc4go/bacnetip/readwrite/model/APDUComplexAck.go
index 85820d6dc4..8067857bcb 100644
--- a/plc4go/internal/plc4go/bacnetip/readwrite/model/APDUComplexAck.go
+++ b/plc4go/internal/plc4go/bacnetip/readwrite/model/APDUComplexAck.go
@@ -290,7 +290,7 @@ func APDUComplexAckParse(readBuffer utils.ReadBuffer, 
apduLength uint16) (*APDUC
                if pullErr := readBuffer.PullContext("serviceAck"); pullErr != 
nil {
                        return nil, pullErr
                }
-               _val, _err := BACnetServiceAckParse(readBuffer, 
uint16(apduLength)-uint16(uint16(uint16(uint16(3))+uint16(uint16(utils.InlineIf(segmentedMessage,
 func() interface{} { return uint16(uint16(2)) }, func() interface{} { return 
uint16(uint16(0)) }).(uint16))))))
+               _val, _err := BACnetServiceAckParse(readBuffer, 
uint16(apduLength)-uint16(uint16(uint16(uint16(2))+uint16(uint16(utils.InlineIf(segmentedMessage,
 func() interface{} { return uint16(uint16(2)) }, func() interface{} { return 
uint16(uint16(0)) }).(uint16))))))
                switch {
                case errors.Is(_err, utils.ParseAssertError{}) || 
errors.Is(_err, io.EOF):
                        readBuffer.Reset(currentPos)
diff --git 
a/protocols/bacnetip/src/main/resources/protocols/bacnetip/bacnetip.mspec 
b/protocols/bacnetip/src/main/resources/protocols/bacnetip/bacnetip.mspec
index 87e4a63945..a3d40bcdb4 100644
--- a/protocols/bacnetip/src/main/resources/protocols/bacnetip/bacnetip.mspec
+++ b/protocols/bacnetip/src/main/resources/protocols/bacnetip/bacnetip.mspec
@@ -213,7 +213,7 @@
             [simple   uint 8    originalInvokeId                        ]
             [optional uint 8    sequenceNumber     'segmentedMessage'   ]
             [optional uint 8    proposedWindowSize 'segmentedMessage'   ]
-            [optional BACnetServiceAck('apduLength - (3 + (segmentedMessage ? 
2 : 0))')
+            [optional BACnetServiceAck('apduLength - (2 + (segmentedMessage ? 
2 : 0))')
                                 serviceAck         '!segmentedMessage'  ]
             // TODO: maybe we should put this in the discriminated types below
             [optional uint 8    segmentServiceChoice 'segmentedMessage && 
sequenceNumber != 0']

Reply via email to