Corrected ReadProperty reply when data is too big to fit into APDU. It is required to be an Abort messaage, not an Error message.
This commit is contained in:
@@ -548,7 +548,8 @@ char *Device_Valid_Object_Id(int object_type, uint32_t object_instance)
|
||||
return name;
|
||||
}
|
||||
|
||||
/* return the length of the apdu encoded or -1 for error */
|
||||
/* return the length of the apdu encoded or -1 for error or
|
||||
-2 for abort message */
|
||||
int Device_Encode_Property_APDU(uint8_t * apdu,
|
||||
BACNET_PROPERTY_ID property,
|
||||
int32_t array_index,
|
||||
@@ -704,9 +705,8 @@ int Device_Encode_Property_APDU(uint8_t * apdu,
|
||||
/* assume next one is the same size as this one */
|
||||
/* can we all fit into the APDU? */
|
||||
if ((apdu_len + len) >= MAX_APDU) {
|
||||
*error_class = ERROR_CLASS_SERVICES;
|
||||
*error_code = ERROR_CODE_NO_SPACE_FOR_OBJECT;
|
||||
apdu_len = -1;
|
||||
/* reject message */
|
||||
apdu_len = -2;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user