Created a demo Multi-state Output object, and added it to the demo applications.
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
#include "bo.h"
|
||||
#include "bv.h"
|
||||
#include "lsp.h"
|
||||
#include "mso.h"
|
||||
#if BACFILE
|
||||
#include "bacfile.h"
|
||||
#endif
|
||||
@@ -254,6 +255,27 @@ void handler_read_property(uint8_t * service_request,
|
||||
} else
|
||||
error = true;
|
||||
break;
|
||||
case OBJECT_MULTI_STATE_OUTPUT:
|
||||
if (Multistate_Output_Valid_Instance(data.object_instance)) {
|
||||
len = Multistate_Output_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 */
|
||||
pdu_len +=
|
||||
rp_ack_encode_apdu(&Handler_Transmit_Buffer
|
||||
[pdu_len], service_data->invoke_id, &data);
|
||||
fprintf(stderr, "Sending Read Property Ack for MSO!\n");
|
||||
send = true;
|
||||
} else
|
||||
error = true;
|
||||
} else
|
||||
error = true;
|
||||
break;
|
||||
#if BACFILE
|
||||
case OBJECT_FILE:
|
||||
if (bacfile_valid_instance(data.object_instance)) {
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "bo.h"
|
||||
#include "bv.h"
|
||||
#include "lsp.h"
|
||||
#include "mso.h"
|
||||
#if BACFILE
|
||||
#include "bacfile.h"
|
||||
#endif
|
||||
@@ -200,6 +201,23 @@ void handler_write_property(uint8_t * service_request,
|
||||
fprintf(stderr, "Sending Write Access Error for LSP!\n");
|
||||
}
|
||||
break;
|
||||
case OBJECT_MULTI_STATE_OUTPUT:
|
||||
if (Multistate_Output_Write_Property(&wp_data, &error_class,
|
||||
&error_code)) {
|
||||
pdu_len +=
|
||||
encode_simple_ack(&Handler_Transmit_Buffer[pdu_len],
|
||||
service_data->invoke_id,
|
||||
SERVICE_CONFIRMED_WRITE_PROPERTY);
|
||||
fprintf(stderr, "Sending Write Property Simple Ack for MSO!\n");
|
||||
} else {
|
||||
pdu_len +=
|
||||
bacerror_encode_apdu(&Handler_Transmit_Buffer[pdu_len],
|
||||
service_data->invoke_id,
|
||||
SERVICE_CONFIRMED_WRITE_PROPERTY, error_class,
|
||||
error_code);
|
||||
fprintf(stderr, "Sending Write Access Error for MSO!\n");
|
||||
}
|
||||
break;
|
||||
#if BACFILE
|
||||
case OBJECT_FILE:
|
||||
if (bacfile_write_property(&wp_data, &error_class,
|
||||
|
||||
Reference in New Issue
Block a user