Added a Binary Input object to the demo objects and updated the demo applications and device object to support the new object.
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
/* demo objects */
|
||||
#include "device.h"
|
||||
#include "ai.h"
|
||||
#include "bi.h"
|
||||
#include "ao.h"
|
||||
#if BACFILE
|
||||
#include "bacfile.h"
|
||||
@@ -123,6 +124,27 @@ void handler_read_property(uint8_t * service_request,
|
||||
} else
|
||||
error = true;
|
||||
break;
|
||||
case OBJECT_BINARY_INPUT:
|
||||
if (Binary_Input_Valid_Instance(data.object_instance)) {
|
||||
len = Binary_Input_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!\n");
|
||||
send = true;
|
||||
} else
|
||||
error = true;
|
||||
} else
|
||||
error = true;
|
||||
break;
|
||||
case OBJECT_ANALOG_OUTPUT:
|
||||
if (Analog_Output_Valid_Instance(data.object_instance)) {
|
||||
len = Analog_Output_Encode_Property_APDU(&Temp_Buf[0],
|
||||
|
||||
Reference in New Issue
Block a user