Added segmentation support for server reply. (#974)

Added segmentation support for server devices for some services. Configure BACNET_SEGMENTATION_ENABLED=1 to include in the library, and adjust BACNET_MAX_SEGMENTS_ACCEPTED for maximum number of segments.
This commit is contained in:
Steve Karg
2025-11-15 13:33:36 -06:00
committed by GitHub
parent bea2ceba11
commit 3ea710f92f
25 changed files with 2112 additions and 144 deletions
+8
View File
@@ -1143,7 +1143,11 @@ uint8_t Device_Protocol_Revision(void)
BACNET_SEGMENTATION Device_Segmentation_Supported(void)
{
#if BACNET_SEGMENTATION_ENABLED
return SEGMENTATION_BOTH;
#else
return SEGMENTATION_NONE;
#endif
}
/**
@@ -1614,8 +1618,12 @@ int Device_Read_Property_Local(BACNET_READ_PROPERTY_DATA *rpdata)
rpdata->object_instance, rpdata->array_index,
Device_Object_List_Element_Encode, count, apdu, apdu_max);
if (apdu_len == BACNET_STATUS_ABORT) {
#if BACNET_SEGMENTATION_ENABLED
rpdata->error_code = ERROR_CODE_ABORT_BUFFER_OVERFLOW;
#else
rpdata->error_code =
ERROR_CODE_ABORT_SEGMENTATION_NOT_SUPPORTED;
#endif
} else if (apdu_len == BACNET_STATUS_ERROR) {
rpdata->error_class = ERROR_CLASS_PROPERTY;
rpdata->error_code = ERROR_CODE_INVALID_ARRAY_INDEX;