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:
skarg
2006-10-05 12:47:23 +00:00
parent de8a4b960c
commit 4ddeb3dcad
3 changed files with 21 additions and 11 deletions
+4 -4
View File
@@ -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 {