integrated the load control object into the demos.

This commit is contained in:
skarg
2007-01-26 12:47:46 +00:00
parent fc3074b8fa
commit c27c5002d5
26 changed files with 105 additions and 0 deletions
+23
View File
@@ -43,6 +43,7 @@
#include "bi.h"
#include "bo.h"
#include "bv.h"
#include "lc.h"
#include "lsp.h"
#include "mso.h"
#if BACFILE
@@ -258,6 +259,28 @@ void handler_read_property(uint8_t * service_request,
#if PRINT_ENABLED
fprintf(stderr,
"Sending Read Property Ack for LSP!\n");
#endif
error = false;
}
}
break;
case OBJECT_LOAD_CONTROL:
if (Load_Control_Valid_Instance(data.object_instance)) {
len = Load_Control_Encode_Property_APDU(&Temp_Buf[0],
data.object_instance,
data.object_property,
data.array_index, &error_class, &error_code);
if (len >= 0) {
/* encode the APDU portion of the packet */
data.application_data = &Temp_Buf[0];
data.application_data_len = len;
/* FIXME: probably need a length limitation sent with encode */
len =
rp_ack_encode_apdu(&Handler_Transmit_Buffer
[pdu_len], service_data->invoke_id, &data);
#if PRINT_ENABLED
fprintf(stderr,
"Sending Read Property Ack for Load Control!\n");
#endif
error = false;
}
+23
View File
@@ -43,6 +43,7 @@
#include "bi.h"
#include "bo.h"
#include "bv.h"
#include "lc.h"
#include "lsp.h"
#include "mso.h"
#if BACFILE
@@ -237,6 +238,28 @@ void handler_write_property(uint8_t * service_request,
error_code);
#if PRINT_ENABLED
fprintf(stderr, "Sending Write Access Error for LSP!\n");
#endif
}
break;
case OBJECT_LOAD_CONTROL:
if (Load_Control_Write_Property(&wp_data, &error_class,
&error_code)) {
len =
encode_simple_ack(&Handler_Transmit_Buffer[pdu_len],
service_data->invoke_id,
SERVICE_CONFIRMED_WRITE_PROPERTY);
#if PRINT_ENABLED
fprintf(stderr,
"Sending Write Property Simple Ack for Load Control!\n");
#endif
} else {
len =
bacerror_encode_apdu(&Handler_Transmit_Buffer[pdu_len],
service_data->invoke_id,
SERVICE_CONFIRMED_WRITE_PROPERTY, error_class,
error_code);
#if PRINT_ENABLED
fprintf(stderr, "Sending Write Access Error for Load Control!\n");
#endif
}
break;