MangoAutomation / BACnet4J

BACnet/IP stack written in Java. Forked from http://sourceforge.net/projects/bacnet4j/
GNU General Public License v3.0
187 stars 111 forks source link

Maximum segments in defaultTransport.java #27

Open michelseiler opened 6 years ago

michelseiler commented 6 years ago

Hello everyone, In the defaultTransport.java class, the number of segments is hard-coded to a maximum of 128.

When sending a request: defaultTransport.java if (segmentsRequired > 128) throw new ServiceTooBigException("Request too big to send to device; too many segments required");

When sending a response: defaultTransport.java if (segmentsRequired > request.getMaxSegmentsAccepted().getMaxSegments() || segmentsRequired > 128) { LOG.warn("Response too big to send to device; too many segments required"); throw new BACnetAbortException(AbortReason.bufferOverflow); }

According to BACnet Standard 135-2016, the maximum is 255. Page 22: "The first conditional parameter is the 'Sequence Number.' This one-octet unsigned integer is used by the segment transmitter to indicate the position of the current segment in the series of segments composing the complete message.". Does anyone know why the segmentation here is limited to 128, can and should we change that value to the maximum of 255?