integrated the load control object into the demos.
This commit is contained in:
@@ -39,6 +39,7 @@ SRCS = main.c \
|
||||
$(BACNET_OBJECT)/bi.c \
|
||||
$(BACNET_OBJECT)/bo.c \
|
||||
$(BACNET_OBJECT)/bv.c \
|
||||
$(BACNET_OBJECT)/lc.c \
|
||||
$(BACNET_OBJECT)/lsp.c \
|
||||
$(BACNET_OBJECT)/mso.c \
|
||||
$(BACNET_OBJECT)/bacfile.c \
|
||||
|
||||
@@ -51,6 +51,7 @@ SRCS = main.c \
|
||||
..\..\demo\object\bi.c \
|
||||
..\..\demo\object\bo.c \
|
||||
..\..\demo\object\bv.c \
|
||||
..\..\demo\object\lc.c \
|
||||
..\..\demo\object\lsp.c \
|
||||
..\..\demo\object\mso.c \
|
||||
..\..\datalink.c \
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "bi.h" /* object list dependency */
|
||||
#include "bo.h" /* object list dependency */
|
||||
#include "bv.h" /* object list dependency */
|
||||
#include "lc.h" /* object list dependency */
|
||||
#include "lsp.h" /* object list dependency */
|
||||
#include "mso.h" /* object list dependency */
|
||||
#include "wp.h" /* write property handling */
|
||||
@@ -332,6 +333,7 @@ unsigned Device_Object_List_Count(void)
|
||||
count += Binary_Output_Count();
|
||||
count += Binary_Value_Count();
|
||||
count += Life_Safety_Point_Count();
|
||||
count += Load_Control_Count();
|
||||
count += Multistate_Output_Count();
|
||||
#if BACFILE
|
||||
count += bacfile_count();
|
||||
@@ -442,6 +444,19 @@ bool Device_Object_List_Identifier(unsigned array_index,
|
||||
status = true;
|
||||
}
|
||||
}
|
||||
/* load control objects */
|
||||
if (!status) {
|
||||
/* normalize the index since
|
||||
we know it is not the previous objects */
|
||||
object_index -= object_count;
|
||||
object_count = Load_Control_Count();
|
||||
/* is it a valid index for this object? */
|
||||
if (object_index < object_count) {
|
||||
*object_type = OBJECT_LOAD_CONTROL;
|
||||
*instance = Load_Control_Index_To_Instance(object_index);
|
||||
status = true;
|
||||
}
|
||||
}
|
||||
/* multi-state output objects */
|
||||
if (!status) {
|
||||
/* normalize the index since
|
||||
@@ -530,6 +545,9 @@ char *Device_Valid_Object_Id(int object_type, uint32_t object_instance)
|
||||
case OBJECT_LIFE_SAFETY_POINT:
|
||||
name = Life_Safety_Point_Name(object_instance);
|
||||
break;
|
||||
case OBJECT_LOAD_CONTROL:
|
||||
name = Load_Control_Name(object_instance);
|
||||
break;
|
||||
case OBJECT_MULTI_STATE_OUTPUT:
|
||||
name = Multistate_Output_Name(object_instance);
|
||||
break;
|
||||
@@ -677,6 +695,8 @@ int Device_Encode_Property_APDU(uint8_t * apdu,
|
||||
bitstring_set_bit(&bit_string, OBJECT_BINARY_VALUE, true);
|
||||
if (Life_Safety_Point_Count())
|
||||
bitstring_set_bit(&bit_string, OBJECT_LIFE_SAFETY_POINT, true);
|
||||
if (Load_Control_Count())
|
||||
bitstring_set_bit(&bit_string, OBJECT_LOAD_CONTROL, true);
|
||||
if (Multistate_Output_Count())
|
||||
bitstring_set_bit(&bit_string, OBJECT_MULTI_STATE_OUTPUT,
|
||||
true);
|
||||
@@ -1035,6 +1055,22 @@ uint32_t Life_Safety_Point_Index_To_Instance(unsigned index)
|
||||
return index;
|
||||
}
|
||||
|
||||
char *Load_Control_Name(uint32_t object_instance)
|
||||
{
|
||||
(void) object_instance;
|
||||
return "";
|
||||
}
|
||||
|
||||
unsigned Load_Control_Count(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t Load_Control_Index_To_Instance(unsigned index)
|
||||
{
|
||||
return index;
|
||||
}
|
||||
|
||||
char *Multistate_Output_Name(uint32_t object_instance)
|
||||
{
|
||||
(void) object_instance;
|
||||
|
||||
@@ -51,6 +51,7 @@ SRCS = main.c \
|
||||
$(BACNET_OBJECT)/bi.c \
|
||||
$(BACNET_OBJECT)/bo.c \
|
||||
$(BACNET_OBJECT)/bv.c \
|
||||
$(BACNET_OBJECT)/lc.c \
|
||||
$(BACNET_OBJECT)/lsp.c \
|
||||
$(BACNET_OBJECT)/mso.c \
|
||||
$(BACNET_OBJECT)/bacfile.c \
|
||||
|
||||
@@ -49,6 +49,7 @@ SRCS = main.c \
|
||||
..\..\demo\object\bi.c \
|
||||
..\..\demo\object\bo.c \
|
||||
..\..\demo\object\bv.c \
|
||||
..\..\demo\object\lc.c \
|
||||
..\..\demo\object\lsp.c \
|
||||
..\..\demo\object\mso.c \
|
||||
..\..\datalink.c \
|
||||
|
||||
@@ -40,6 +40,7 @@ SRCS = readprop.c \
|
||||
$(BACNET_OBJECT)/bi.c \
|
||||
$(BACNET_OBJECT)/bo.c \
|
||||
$(BACNET_OBJECT)/bv.c \
|
||||
$(BACNET_OBJECT)/lc.c \
|
||||
$(BACNET_OBJECT)/lsp.c \
|
||||
$(BACNET_OBJECT)/mso.c \
|
||||
$(BACNET_OBJECT)/bacfile.c \
|
||||
|
||||
@@ -51,6 +51,7 @@ SRCS = readprop.c \
|
||||
..\..\demo\object\bi.c \
|
||||
..\..\demo\object\bo.c \
|
||||
..\..\demo\object\bv.c \
|
||||
..\..\demo\object\lc.c \
|
||||
..\..\demo\object\lsp.c \
|
||||
..\..\demo\object\mso.c \
|
||||
..\..\datalink.c \
|
||||
|
||||
@@ -38,6 +38,7 @@ SRCS = main.c \
|
||||
$(BACNET_OBJECT)/bi.c \
|
||||
$(BACNET_OBJECT)/bo.c \
|
||||
$(BACNET_OBJECT)/bv.c \
|
||||
$(BACNET_OBJECT)/lc.c \
|
||||
$(BACNET_OBJECT)/lsp.c \
|
||||
$(BACNET_OBJECT)/mso.c \
|
||||
$(BACNET_OBJECT)/bacfile.c \
|
||||
|
||||
@@ -51,6 +51,7 @@ SRCS = main.c \
|
||||
..\..\demo\object\bi.c \
|
||||
..\..\demo\object\bo.c \
|
||||
..\..\demo\object\bv.c \
|
||||
..\..\demo\object\lc.c \
|
||||
..\..\demo\object\lsp.c \
|
||||
..\..\demo\object\mso.c \
|
||||
..\..\datalink.c \
|
||||
|
||||
@@ -43,6 +43,7 @@ SRCS = main.c \
|
||||
$(BACNET_OBJECT)/bi.c \
|
||||
$(BACNET_OBJECT)/bo.c \
|
||||
$(BACNET_OBJECT)/bv.c \
|
||||
$(BACNET_OBJECT)/lc.c \
|
||||
$(BACNET_OBJECT)/lsp.c \
|
||||
$(BACNET_OBJECT)/mso.c \
|
||||
$(BACNET_OBJECT)/bacfile.c \
|
||||
|
||||
@@ -130,6 +130,7 @@ Multi-state Output
|
||||
Life Safety Point
|
||||
-- Life Safety Zone Createable Deleteable
|
||||
-- Trend Log Createable Deleteable
|
||||
Load Control
|
||||
}
|
||||
|
||||
Data Link Layer Option:
|
||||
|
||||
@@ -59,6 +59,7 @@ SRCS = main.c \
|
||||
..\..\demo\object\bi.c \
|
||||
..\..\demo\object\bo.c \
|
||||
..\..\demo\object\bv.c \
|
||||
..\..\demo\object\lc.c \
|
||||
..\..\demo\object\lsp.c \
|
||||
..\..\demo\object\mso.c \
|
||||
..\..\datalink.c \
|
||||
|
||||
@@ -39,6 +39,7 @@ SRCS = main.c \
|
||||
$(BACNET_OBJECT)/bo.c \
|
||||
$(BACNET_OBJECT)/bv.c \
|
||||
$(BACNET_OBJECT)/lsp.c \
|
||||
$(BACNET_OBJECT)/lc.c \
|
||||
$(BACNET_OBJECT)/mso.c \
|
||||
$(BACNET_OBJECT)/bacfile.c \
|
||||
$(BACNET_ROOT)/filename.c \
|
||||
|
||||
@@ -40,6 +40,7 @@ SRCS = main.c \
|
||||
$(BACNET_OBJECT)\bi.c \
|
||||
$(BACNET_OBJECT)\bo.c \
|
||||
$(BACNET_OBJECT)\bv.c \
|
||||
$(BACNET_OBJECT)\lc.c \
|
||||
$(BACNET_OBJECT)\lsp.c \
|
||||
$(BACNET_OBJECT)\mso.c \
|
||||
$(BACNET_ROOT)\address.c \
|
||||
|
||||
@@ -35,6 +35,7 @@ SRCS = main.c \
|
||||
$(BACNET_OBJECT)/bi.c \
|
||||
$(BACNET_OBJECT)/bo.c \
|
||||
$(BACNET_OBJECT)/bv.c \
|
||||
$(BACNET_OBJECT)/lc.c \
|
||||
$(BACNET_OBJECT)/lsp.c \
|
||||
$(BACNET_OBJECT)/mso.c \
|
||||
$(BACNET_OBJECT)/bacfile.c \
|
||||
|
||||
@@ -48,6 +48,7 @@ SRCS = main.c \
|
||||
..\..\demo\object\bi.c \
|
||||
..\..\demo\object\bo.c \
|
||||
..\..\demo\object\bv.c \
|
||||
..\..\demo\object\lc.c \
|
||||
..\..\demo\object\lsp.c \
|
||||
..\..\demo\object\mso.c \
|
||||
..\..\datalink.c \
|
||||
|
||||
@@ -38,6 +38,7 @@ SRCS = main.c \
|
||||
$(BACNET_OBJECT)/bi.c \
|
||||
$(BACNET_OBJECT)/bo.c \
|
||||
$(BACNET_OBJECT)/bv.c \
|
||||
$(BACNET_OBJECT)/lc.c \
|
||||
$(BACNET_OBJECT)/lsp.c \
|
||||
$(BACNET_OBJECT)/mso.c \
|
||||
$(BACNET_OBJECT)/bacfile.c \
|
||||
|
||||
@@ -53,6 +53,7 @@ SRCS = main.c \
|
||||
..\..\demo\object\bi.c \
|
||||
..\..\demo\object\bo.c \
|
||||
..\..\demo\object\bv.c \
|
||||
..\..\demo\object\lc.c \
|
||||
..\..\demo\object\lsp.c \
|
||||
..\..\demo\object\mso.c \
|
||||
..\..\datalink.c \
|
||||
|
||||
@@ -39,6 +39,7 @@ SRCS = main.c \
|
||||
$(BACNET_OBJECT)/bi.c \
|
||||
$(BACNET_OBJECT)/bo.c \
|
||||
$(BACNET_OBJECT)/bv.c \
|
||||
$(BACNET_OBJECT)/lc.c \
|
||||
$(BACNET_OBJECT)/lsp.c \
|
||||
$(BACNET_OBJECT)/mso.c \
|
||||
$(BACNET_OBJECT)/bacfile.c \
|
||||
|
||||
@@ -39,6 +39,7 @@ SRCS = main.c \
|
||||
$(BACNET_OBJECT)\bi.c \
|
||||
$(BACNET_OBJECT)\bo.c \
|
||||
$(BACNET_OBJECT)\bv.c \
|
||||
$(BACNET_OBJECT)\lc.c \
|
||||
$(BACNET_OBJECT)\lsp.c \
|
||||
$(BACNET_OBJECT)\mso.c \
|
||||
$(BACNET_ROOT)\address.c \
|
||||
|
||||
@@ -51,6 +51,7 @@ SRCS = writefile.c \
|
||||
$(BACNET_OBJECT)/bi.c \
|
||||
$(BACNET_OBJECT)/bo.c \
|
||||
$(BACNET_OBJECT)/bv.c \
|
||||
$(BACNET_OBJECT)/lc.c \
|
||||
$(BACNET_OBJECT)/lsp.c \
|
||||
$(BACNET_OBJECT)/mso.c \
|
||||
$(BACNET_OBJECT)/bacfile.c \
|
||||
|
||||
@@ -49,6 +49,7 @@ SRCS = writefile.c \
|
||||
..\..\demo\object\bi.c \
|
||||
..\..\demo\object\bo.c \
|
||||
..\..\demo\object\bv.c \
|
||||
..\..\demo\object\lc.c \
|
||||
..\..\demo\object\lsp.c \
|
||||
..\..\demo\object\mso.c \
|
||||
..\..\datalink.c \
|
||||
|
||||
@@ -37,6 +37,7 @@ SRCS = writeprop.c \
|
||||
$(BACNET_OBJECT)/bi.c \
|
||||
$(BACNET_OBJECT)/bo.c \
|
||||
$(BACNET_OBJECT)/bv.c \
|
||||
$(BACNET_OBJECT)/lc.c \
|
||||
$(BACNET_OBJECT)/lsp.c \
|
||||
$(BACNET_OBJECT)/mso.c \
|
||||
$(BACNET_OBJECT)/bacfile.c \
|
||||
|
||||
@@ -50,6 +50,7 @@ SRCS = writeprop.c \
|
||||
..\..\demo\object\bi.c \
|
||||
..\..\demo\object\bo.c \
|
||||
..\..\demo\object\bv.c \
|
||||
..\..\demo\object\lc.c \
|
||||
..\..\demo\object\lsp.c \
|
||||
..\..\demo\object\mso.c \
|
||||
..\..\datalink.c \
|
||||
|
||||
Reference in New Issue
Block a user