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
+14 -3
View File
@@ -314,9 +314,20 @@ void handler_read_property(uint8_t * service_request,
}
}
if (error) {
len = bacerror_encode_apdu(&Handler_Transmit_Buffer[pdu_len],
service_data->invoke_id,
SERVICE_CONFIRMED_READ_PROPERTY, error_class, error_code);
switch (len) {
/* BACnet APDU too small to fit data, so proper response is Abort */
case -2:
len = abort_encode_apdu(&Handler_Transmit_Buffer[pdu_len],
service_data->invoke_id,
ABORT_REASON_SEGMENTATION_NOT_SUPPORTED);
break;
case -1:
default:
len = bacerror_encode_apdu(&Handler_Transmit_Buffer[pdu_len],
service_data->invoke_id,
SERVICE_CONFIRMED_READ_PROPERTY, error_class, error_code);
break;
}
#if PRINT_ENABLED
fprintf(stderr, "Sending Read Property Error!\n");
#endif