Created demo Life Safety Point object. Integrated it with the demos.
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
#include "ao.h"
|
||||
#include "bi.h"
|
||||
#include "bo.h"
|
||||
#include "lsp.h"
|
||||
#if BACFILE
|
||||
#include "bacfile.h"
|
||||
#endif
|
||||
@@ -188,6 +189,27 @@ void handler_read_property(uint8_t * service_request,
|
||||
} else
|
||||
error = true;
|
||||
break;
|
||||
case OBJECT_LIFE_SAFETY_POINT:
|
||||
if (Life_Safety_Point_Valid_Instance(data.object_instance)) {
|
||||
len = Life_Safety_Point_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;
|
||||
#if BACFILE
|
||||
case OBJECT_FILE:
|
||||
if (bacfile_valid_instance(data.object_instance)) {
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "ao.h"
|
||||
#include "bi.h"
|
||||
#include "bo.h"
|
||||
#include "lsp.h"
|
||||
#if BACFILE
|
||||
#include "bacfile.h"
|
||||
#endif
|
||||
@@ -145,6 +146,23 @@ void handler_write_property(uint8_t * service_request,
|
||||
fprintf(stderr, "Sending Write Access Error!\n");
|
||||
}
|
||||
break;
|
||||
case OBJECT_LIFE_SAFETY_POINT:
|
||||
if (Life_Safety_Point_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!\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!\n");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
pdu_len +=
|
||||
bacerror_encode_apdu(&Handler_Transmit_Buffer[pdu_len],
|
||||
|
||||
Reference in New Issue
Block a user