added property list library to return all required and optional properties of an object. Not finished with all object properties yet, but functional in the EPICs demo. Updated property enumerations and text names based on 135-2010 standard.
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
#include "datalink.h"
|
||||
#include "whois.h"
|
||||
#include "rp.h"
|
||||
#include "proplist.h"
|
||||
/* some demo stuff needed */
|
||||
#include "filename.h"
|
||||
#include "handlers.h"
|
||||
@@ -765,7 +766,7 @@ static uint8_t Read_Properties(
|
||||
* In practice, this should only happen for simple devices that don't
|
||||
* implement RPM or have really limited MAX_APDU size.
|
||||
*/
|
||||
Device_Objects_Property_List(pMyObject->type, &PropertyListStruct);
|
||||
Property_List_Special(pMyObject->type, &PropertyListStruct);
|
||||
pPropList = PropertyListStruct.Required.pList;
|
||||
if (pPropList != NULL) {
|
||||
Property_List_Length = PropertyListStruct.Required.count;
|
||||
|
||||
@@ -220,7 +220,7 @@ typedef enum {
|
||||
PROP_COV_PERIOD = 180,
|
||||
PROP_INPUT_REFERENCE = 181,
|
||||
PROP_LIMIT_MONITORING_INTERVAL = 182,
|
||||
PROP_LOGGING_DEVICE = 183,
|
||||
PROP_LOGGING_OBJECT = 183,
|
||||
PROP_LOGGING_RECORD = 184,
|
||||
PROP_PRESCALE = 185,
|
||||
PROP_PULSE_RATE = 186,
|
||||
@@ -232,14 +232,11 @@ typedef enum {
|
||||
PROP_VALUE_CHANGE_TIME = 192,
|
||||
/* enumerations 193-206 are new */
|
||||
PROP_ALIGN_INTERVALS = 193,
|
||||
PROP_GROUP_MEMBER_NAMES = 194,
|
||||
/* enumeration 194 is unassigned */
|
||||
PROP_INTERVAL_OFFSET = 195,
|
||||
PROP_LAST_RESTART_REASON = 196,
|
||||
PROP_LOGGING_TYPE = 197,
|
||||
PROP_MEMBER_STATUS_FLAGS = 198,
|
||||
PROP_NOTIFICATION_PERIOD = 199,
|
||||
PROP_PREVIOUS_NOTIFY_RECORD = 200,
|
||||
PROP_REQUESTED_UPDATE_INTERVAL = 201,
|
||||
/* enumeration 198-201 is unassigned */
|
||||
PROP_RESTART_NOTIFICATION_RECIPIENTS = 202,
|
||||
PROP_TIME_OF_DEVICE_RESTART = 203,
|
||||
PROP_TIME_SYNCHRONIZATION_INTERVAL = 204,
|
||||
@@ -256,9 +253,7 @@ typedef enum {
|
||||
PROP_DUTY_WINDOW = 213,
|
||||
PROP_EXPECTED_SHED_LEVEL = 214,
|
||||
PROP_FULL_DUTY_BASELINE = 215,
|
||||
/* enumerations 216-217 are used in Addendum i to ANSI/ASHRAE 135-2004 */
|
||||
PROP_BLINK_PRIORITY_THRESHOLD = 216,
|
||||
PROP_BLINK_TIME = 217,
|
||||
/* enumerations 216-217 are unassigned */
|
||||
/* enumerations 212-225 are used in Addendum e to ANSI/ASHRAE 135-2004 */
|
||||
PROP_REQUESTED_SHED_LEVEL = 218,
|
||||
PROP_SHED_DURATION = 219,
|
||||
@@ -358,14 +353,7 @@ typedef enum {
|
||||
PROP_TRANSACTION_NOTIFICATION_CLASS = 309,
|
||||
PROP_USER_EXTERNAL_IDENTIFIER = 310,
|
||||
PROP_USER_INFORMATION_REFERENCE = 311,
|
||||
/* enumerations 312-313 are used in Addendum k to ANSI/ASHRAE 135-2004 */
|
||||
PROP_CHARACTER_SET = 312,
|
||||
PROP_STRICT_CHARACTER_MODE = 313,
|
||||
/* enumerations 314-316 are used in Addendum ? */
|
||||
PROP_BACKUP_AND_RESTORE_STATE = 314,
|
||||
PROP_BACKUP_PREPARATION_TIME = 315,
|
||||
PROP_RESTORE_PREPARATION_TIME = 316,
|
||||
/* enumerations 317-323 are used in Addendum j to ANSI/ASHRAE 135-2004 */
|
||||
/* enumerations 312-316 are unassigned */
|
||||
PROP_USER_NAME = 317,
|
||||
PROP_USER_TYPE = 318,
|
||||
PROP_USES_REMAINING = 319,
|
||||
@@ -373,21 +361,45 @@ typedef enum {
|
||||
PROP_ZONE_TO = 321,
|
||||
PROP_ACCESS_EVENT_TAG = 322,
|
||||
PROP_GLOBAL_IDENTIFIER = 323,
|
||||
/* enumerations 324-325 are used in Addendum i to ANSI/ASHRAE 135-2004 */
|
||||
PROP_BINARY_ACTIVE_VALUE = 324,
|
||||
PROP_BINARY_INACTIVE_VALUE = 325,
|
||||
/* enumeration 326 is used in Addendum j to ANSI/ASHRAE 135-2004 */
|
||||
/* enumerations 324-325 are unassigned */
|
||||
PROP_VERIFICATION_TIME = 326,
|
||||
PROP_BASE_DEVICE_SECURITY_POLICY = 327,
|
||||
PROP_DISTRIBUTION_KEY_REVISION = 328,
|
||||
PROP_DO_NOT_HIDE = 329,
|
||||
PROP_KEY_SETS = 330,
|
||||
PROP_LAST_KEY_SERVER = 331,
|
||||
PROP_NETWORK_ACCESS_SECURITY_ALGORITHMS = 332,
|
||||
PROP_PACKET_REORDER_TIME = 333,
|
||||
PROP_SECURITY_PDU_TIMEOUT = 334,
|
||||
PROP_SECURITY_TIME_WINDOW = 335,
|
||||
PROP_SUPPORTED_SECURITY_ALGORITHM = 336,
|
||||
PROP_UPDATE_KEY_SET_TIMEOUT = 337,
|
||||
PROP_BACKUP_AND_RESTORE_STATE = 338,
|
||||
PROP_BACKUP_PREPARATION_TIME = 339,
|
||||
PROP_RESTORE_COMPLETION_TIME = 340,
|
||||
PROP_RESTORE_PREPARATION_TIME = 341,
|
||||
/* enumerations 342-344 are defined in Addendum 2008-w */
|
||||
PROP_BIT_MASK = 342,
|
||||
PROP_BIT_TEXT = 343,
|
||||
PROP_IS_UTC = 344
|
||||
PROP_IS_UTC = 344,
|
||||
PROP_GROUP_MEMBERS = 345,
|
||||
PROP_GROUP_MEMBER_NAMES = 346,
|
||||
PROP_MEMBER_STATUS_FLAGS = 347,
|
||||
PROP_REQUESTED_UPDATE_INTERVAL = 348,
|
||||
PROP_COVU_PERIOD = 349,
|
||||
PROP_COVU_RECIPIENTS = 350,
|
||||
PROP_EVENT_MESSAGE_TEXTS = 351,
|
||||
/* The special property identifiers all, optional, and required */
|
||||
/* are reserved for use in the ReadPropertyConditional and */
|
||||
/* ReadPropertyMultiple services or services not defined in this standard. */
|
||||
/* Enumerated values 0-511 are reserved for definition by ASHRAE. */
|
||||
/* Enumerated values 512-4194303 may be used by others subject to the */
|
||||
/* procedures and constraints described in Clause 23. */
|
||||
/* enumerations used to test Addendum i to ANSI/ASHRAE 135-2008 - private */
|
||||
PROP_BLINK_PRIORITY_THRESHOLD = 4201,
|
||||
PROP_BLINK_TIME = 4202,
|
||||
PROP_BINARY_ACTIVE_VALUE = 4203,
|
||||
PROP_BINARY_INACTIVE_VALUE = 4204
|
||||
} BACNET_PROPERTY_ID;
|
||||
|
||||
/* do the MAX as define rather than enumeration for devices
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
/*####COPYRIGHTBEGIN####
|
||||
-------------------------------------------
|
||||
Copyright (C) 2012 Steve Karg
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to:
|
||||
The Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330
|
||||
Boston, MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if other files instantiate templates or
|
||||
use macros or inline functions from this file, or you compile
|
||||
this file and link it with other works to produce a work based
|
||||
on this file, this file does not by itself cause the resulting
|
||||
work to be covered by the GNU General Public License. However
|
||||
the source code for this file must still be made available in
|
||||
accordance with section (3) of the GNU General Public License.
|
||||
|
||||
This exception does not invalidate any other reasons why a work
|
||||
based on this file might be covered by the GNU General Public
|
||||
License.
|
||||
-------------------------------------------
|
||||
####COPYRIGHTEND####*/
|
||||
#ifndef PROPLIST_H
|
||||
#define PROPLIST_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "bacdef.h"
|
||||
#include "bacenum.h"
|
||||
#include "rpm.h"
|
||||
|
||||
/** @file proplist.h Library of all required and optional object properties */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
void Property_List_Special(
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
struct special_property_list_t *pPropertyList);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
@@ -27,6 +27,7 @@ CORE_SRC = \
|
||||
$(BACNET_CORE)/indtext.c \
|
||||
$(BACNET_CORE)/key.c \
|
||||
$(BACNET_CORE)/keylist.c \
|
||||
$(BACNET_CORE)/proplist.c \
|
||||
$(BACNET_CORE)/debug.c \
|
||||
$(BACNET_CORE)/bigend.c \
|
||||
$(BACNET_CORE)/arf.c \
|
||||
|
||||
@@ -38,6 +38,7 @@ INCLUDES = \
|
||||
CORE1_SRC = $(BACNET_CORE)\indtext.c \
|
||||
$(BACNET_CORE)\key.c \
|
||||
$(BACNET_CORE)\keylist.c \
|
||||
$(BACNET_CORE)\proplist.c \
|
||||
$(BACNET_CORE)\debug.c \
|
||||
$(BACNET_CORE)\bigend.c \
|
||||
$(BACNET_CORE)\filename.c \
|
||||
|
||||
+45
-29
@@ -655,7 +655,7 @@ INDTEXT_DATA bacnet_property_names[] = {
|
||||
,
|
||||
{PROP_LIMIT_MONITORING_INTERVAL, "limit-monitoring-interval"}
|
||||
,
|
||||
{PROP_LOGGING_DEVICE, "logging-device"}
|
||||
{PROP_LOGGING_OBJECT, "logging-object"}
|
||||
,
|
||||
{PROP_LOGGING_RECORD, "logging-record"}
|
||||
,
|
||||
@@ -677,22 +677,12 @@ INDTEXT_DATA bacnet_property_names[] = {
|
||||
,
|
||||
{PROP_ALIGN_INTERVALS, "align-intervals"}
|
||||
,
|
||||
{PROP_GROUP_MEMBER_NAMES, "group-member-names"}
|
||||
,
|
||||
{PROP_INTERVAL_OFFSET, "interval-offset"}
|
||||
,
|
||||
{PROP_LAST_RESTART_REASON, "last-restart-reason"}
|
||||
,
|
||||
{PROP_LOGGING_TYPE, "logging-type"}
|
||||
,
|
||||
{PROP_MEMBER_STATUS_FLAGS, "member-status-flags"}
|
||||
,
|
||||
{PROP_NOTIFICATION_PERIOD, "notification-period"}
|
||||
,
|
||||
{PROP_REQUESTED_UPDATE_INTERVAL, "requested-update-interval"}
|
||||
,
|
||||
{PROP_RESTART_NOTIFICATION_RECIPIENTS, "restart-notification-recipients"}
|
||||
,
|
||||
{PROP_TIME_OF_DEVICE_RESTART, "time-of-device-restart"}
|
||||
,
|
||||
{PROP_TIME_SYNCHRONIZATION_INTERVAL, "time-synchronization-interval"}
|
||||
@@ -720,10 +710,6 @@ INDTEXT_DATA bacnet_property_names[] = {
|
||||
,
|
||||
{PROP_FULL_DUTY_BASELINE, "full-duty-baseline"}
|
||||
,
|
||||
{PROP_BLINK_PRIORITY_THRESHOLD, "blink-priority-threshold"}
|
||||
,
|
||||
{PROP_BLINK_TIME, "blink-time"}
|
||||
,
|
||||
{PROP_REQUESTED_SHED_LEVEL, "requested-shed-level"}
|
||||
,
|
||||
{PROP_SHED_DURATION, "shed-duration"}
|
||||
@@ -776,7 +762,6 @@ INDTEXT_DATA bacnet_property_names[] = {
|
||||
,
|
||||
{PROP_SYSTEM_FAILURE_VALUE, "system-failure-value"}
|
||||
,
|
||||
/* enumerations 244-311 are used in Addendum j to ANSI/ASHRAE 135-2004 */
|
||||
{PROP_ABSENTEE_LIMIT, "absentee-limit"}
|
||||
,
|
||||
{PROP_ACCESS_ALARM_EVENTS, "access-alarm-events"}
|
||||
@@ -916,17 +901,6 @@ INDTEXT_DATA bacnet_property_names[] = {
|
||||
,
|
||||
{PROP_USER_INFORMATION_REFERENCE, "user-information-reference"}
|
||||
,
|
||||
/* enumerations 312-313 are used in Addendum k to ANSI/ASHRAE 135-2004 */
|
||||
{PROP_CHARACTER_SET, "character-set"}
|
||||
,
|
||||
{PROP_STRICT_CHARACTER_MODE, "strict-character-mode"}
|
||||
,
|
||||
{PROP_BACKUP_AND_RESTORE_STATE, "backup-and-restore-state"}
|
||||
,
|
||||
{PROP_BACKUP_PREPARATION_TIME, "backup-preparation-time"}
|
||||
,
|
||||
{PROP_RESTORE_PREPARATION_TIME, "restore-preparation-time"}
|
||||
,
|
||||
{PROP_USER_INFORMATION_REFERENCE, "user-information-reference"}
|
||||
,
|
||||
{PROP_USER_NAME, "user-name"}
|
||||
@@ -943,16 +917,58 @@ INDTEXT_DATA bacnet_property_names[] = {
|
||||
,
|
||||
{PROP_BINARY_INACTIVE_VALUE, "binary-inactive-value"}
|
||||
,
|
||||
/* enumeration 326 is used in Addendum j to ANSI/ASHRAE 135-2004 */
|
||||
{PROP_VERIFICATION_TIME, "verification-time"}
|
||||
,
|
||||
{PROP_BASE_DEVICE_SECURITY_POLICY, "base-device-security-policy"}
|
||||
,
|
||||
{PROP_DISTRIBUTION_KEY_REVISION, "distribution-key-revision"}
|
||||
,
|
||||
{PROP_DO_NOT_HIDE, "do-not-hide"}
|
||||
,
|
||||
{PROP_KEY_SETS, "key-sets"}
|
||||
,
|
||||
{PROP_LAST_KEY_SERVER, "last-key-server"}
|
||||
,
|
||||
{PROP_NETWORK_ACCESS_SECURITY_ALGORITHMS, "network-access-security-algorithms"}
|
||||
,
|
||||
{PROP_PACKET_REORDER_TIME, "packet-reorder-time"}
|
||||
,
|
||||
{PROP_SECURITY_PDU_TIMEOUT, "security-pdu-timeout"}
|
||||
,
|
||||
{PROP_SECURITY_TIME_WINDOW, "security-time-window"}
|
||||
,
|
||||
{PROP_SUPPORTED_SECURITY_ALGORITHM, "supported-security-algorithm"}
|
||||
,
|
||||
{PROP_UPDATE_KEY_SET_TIMEOUT, "update-key-set-timeout"}
|
||||
,
|
||||
{PROP_BACKUP_AND_RESTORE_STATE, "backup-and-restore-state"}
|
||||
,
|
||||
{PROP_BACKUP_PREPARATION_TIME, "backup-preparation-time"}
|
||||
,
|
||||
{PROP_RESTORE_COMPLETION_TIME, "restore-completion-time"}
|
||||
,
|
||||
{PROP_RESTORE_PREPARATION_TIME, "restore-preparation-time"}
|
||||
,
|
||||
{PROP_BIT_MASK, "bit-mask"}
|
||||
,
|
||||
{PROP_BIT_TEXT, "bit-text"}
|
||||
,
|
||||
{PROP_IS_UTC, "is-utc"}
|
||||
,
|
||||
|
||||
{PROP_GROUP_MEMBERS, "group-members"}
|
||||
,
|
||||
{PROP_GROUP_MEMBER_NAMES, "group-member-names"}
|
||||
,
|
||||
{PROP_MEMBER_STATUS_FLAGS, "member-status-flags"}
|
||||
,
|
||||
{PROP_REQUESTED_UPDATE_INTERVAL, "requested-update-interval"}
|
||||
,
|
||||
{PROP_COVU_PERIOD, "covu-period"}
|
||||
,
|
||||
{PROP_COVU_RECIPIENTS, "covu-recipients"}
|
||||
,
|
||||
{PROP_EVENT_MESSAGE_TEXTS, "event-message-texts"}
|
||||
,
|
||||
{0, NULL}
|
||||
/* Enumerated values 0-511 are reserved for definition by ASHRAE.
|
||||
Enumerated values 512-4194303 may be used by others subject to the
|
||||
|
||||
@@ -0,0 +1,623 @@
|
||||
/*####COPYRIGHTBEGIN####
|
||||
-------------------------------------------
|
||||
Copyright (C) 2012 Steve Karg
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to:
|
||||
The Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330
|
||||
Boston, MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if other files instantiate templates or
|
||||
use macros or inline functions from this file, or you compile
|
||||
this file and link it with other works to produce a work based
|
||||
on this file, this file does not by itself cause the resulting
|
||||
work to be covered by the GNU General Public License. However
|
||||
the source code for this file must still be made available in
|
||||
accordance with section (3) of the GNU General Public License.
|
||||
|
||||
This exception does not invalidate any other reasons why a work
|
||||
based on this file might be covered by the GNU General Public
|
||||
License.
|
||||
-------------------------------------------
|
||||
####COPYRIGHTEND####*/
|
||||
#include <stdint.h>
|
||||
#include "bacenum.h"
|
||||
#include "bacdef.h"
|
||||
#include "rpm.h"
|
||||
#include "proplist.h"
|
||||
|
||||
/** @file proplist.c List of Required and Optional object properties */
|
||||
|
||||
static const int Default_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Device_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_SYSTEM_STATUS,
|
||||
PROP_VENDOR_NAME,
|
||||
PROP_VENDOR_IDENTIFIER,
|
||||
PROP_MODEL_NAME,
|
||||
PROP_FIRMWARE_REVISION,
|
||||
PROP_APPLICATION_SOFTWARE_VERSION,
|
||||
PROP_PROTOCOL_VERSION,
|
||||
PROP_PROTOCOL_REVISION,
|
||||
PROP_PROTOCOL_SERVICES_SUPPORTED,
|
||||
PROP_PROTOCOL_OBJECT_TYPES_SUPPORTED,
|
||||
PROP_OBJECT_LIST,
|
||||
PROP_MAX_APDU_LENGTH_ACCEPTED,
|
||||
PROP_SEGMENTATION_SUPPORTED,
|
||||
PROP_APDU_TIMEOUT,
|
||||
PROP_NUMBER_OF_APDU_RETRIES,
|
||||
PROP_DEVICE_ADDRESS_BINDING,
|
||||
PROP_DATABASE_REVISION,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Device_Properties_Optional[] = {
|
||||
PROP_LOCATION,
|
||||
PROP_DESCRIPTION,
|
||||
PROP_STRUCTURED_OBJECT_LIST,
|
||||
PROP_MAX_SEGMENTS_ACCEPTED,
|
||||
PROP_VT_CLASSES_SUPPORTED,
|
||||
PROP_ACTIVE_VT_SESSIONS,
|
||||
PROP_LOCAL_TIME,
|
||||
PROP_LOCAL_DATE,
|
||||
PROP_UTC_OFFSET,
|
||||
PROP_DAYLIGHT_SAVINGS_STATUS,
|
||||
PROP_APDU_SEGMENT_TIMEOUT,
|
||||
PROP_TIME_SYNCHRONIZATION_RECIPIENTS,
|
||||
PROP_MAX_MASTER,
|
||||
PROP_MAX_INFO_FRAMES,
|
||||
PROP_CONFIGURATION_FILES,
|
||||
PROP_LAST_RESTORE_TIME,
|
||||
PROP_BACKUP_FAILURE_TIMEOUT,
|
||||
PROP_BACKUP_PREPARATION_TIME,
|
||||
PROP_RESTORE_PREPARATION_TIME,
|
||||
PROP_RESTORE_COMPLETION_TIME,
|
||||
PROP_BACKUP_AND_RESTORE_STATE,
|
||||
PROP_ACTIVE_COV_SUBSCRIPTIONS,
|
||||
PROP_SLAVE_PROXY_ENABLE,
|
||||
PROP_MANUAL_SLAVE_ADDRESS_BINDING,
|
||||
PROP_AUTO_SLAVE_DISCOVERY,
|
||||
PROP_SLAVE_ADDRESS_BINDING,
|
||||
PROP_LAST_RESTART_REASON,
|
||||
PROP_TIME_OF_DEVICE_RESTART,
|
||||
PROP_RESTART_NOTIFICATION_RECIPIENTS,
|
||||
PROP_UTC_TIME_SYNCHRONIZATION_RECIPIENTS,
|
||||
PROP_TIME_SYNCHRONIZATION_INTERVAL,
|
||||
PROP_ALIGN_INTERVALS,
|
||||
PROP_INTERVAL_OFFSET,
|
||||
PROP_PROFILE_NAME,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Accumulator_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE,
|
||||
PROP_STATUS_FLAGS,
|
||||
PROP_EVENT_STATE,
|
||||
PROP_OUT_OF_SERVICE,
|
||||
PROP_SCALE,
|
||||
PROP_UNITS,
|
||||
PROP_MAX_PRES_VALUE,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Accumulator_Properties_Optional[] = {
|
||||
PROP_DESCRIPTION,
|
||||
PROP_DEVICE_TYPE,
|
||||
PROP_RELIABILITY,
|
||||
PROP_PRESCALE,
|
||||
PROP_VALUE_CHANGE_TIME,
|
||||
PROP_VALUE_BEFORE_CHANGE,
|
||||
PROP_VALUE_SET,
|
||||
PROP_LOGGING_RECORD,
|
||||
PROP_LOGGING_OBJECT,
|
||||
PROP_PULSE_RATE,
|
||||
PROP_HIGH_LIMIT,
|
||||
PROP_LOW_LIMIT,
|
||||
PROP_LIMIT_MONITORING_INTERVAL,
|
||||
PROP_NOTIFICATION_CLASS,
|
||||
PROP_TIME_DELAY,
|
||||
PROP_LIMIT_ENABLE,
|
||||
PROP_EVENT_ENABLE,
|
||||
PROP_ACKED_TRANSITIONS,
|
||||
PROP_NOTIFY_TYPE,
|
||||
PROP_EVENT_TIME_STAMPS,
|
||||
PROP_EVENT_MESSAGE_TEXTS,
|
||||
PROP_PROFILE_NAME,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Analog_Input_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE,
|
||||
PROP_STATUS_FLAGS,
|
||||
PROP_EVENT_STATE,
|
||||
PROP_OUT_OF_SERVICE,
|
||||
PROP_UNITS,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Analog_Input_Properties_Optional[] = {
|
||||
PROP_DESCRIPTION,
|
||||
PROP_DEVICE_TYPE,
|
||||
PROP_RELIABILITY,
|
||||
PROP_UPDATE_INTERVAL,
|
||||
PROP_MIN_PRES_VALUE,
|
||||
PROP_MAX_PRES_VALUE,
|
||||
PROP_RESOLUTION,
|
||||
PROP_COV_INCREMENT,
|
||||
PROP_TIME_DELAY,
|
||||
PROP_NOTIFICATION_CLASS,
|
||||
PROP_HIGH_LIMIT,
|
||||
PROP_LOW_LIMIT,
|
||||
PROP_DEADBAND,
|
||||
PROP_LIMIT_ENABLE,
|
||||
PROP_EVENT_ENABLE,
|
||||
PROP_ACKED_TRANSITIONS,
|
||||
PROP_NOTIFY_TYPE,
|
||||
PROP_EVENT_TIME_STAMPS,
|
||||
PROP_EVENT_MESSAGE_TEXTS,
|
||||
PROP_PROFILE_NAME,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Analog_Output_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE,
|
||||
PROP_STATUS_FLAGS,
|
||||
PROP_EVENT_STATE,
|
||||
PROP_OUT_OF_SERVICE,
|
||||
PROP_UNITS,
|
||||
PROP_PRIORITY_ARRAY,
|
||||
PROP_RELINQUISH_DEFAULT,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Analog_Output_Properties_Optional[] = {
|
||||
PROP_DESCRIPTION,
|
||||
PROP_DEVICE_TYPE,
|
||||
PROP_RELIABILITY,
|
||||
PROP_MIN_PRES_VALUE,
|
||||
PROP_MAX_PRES_VALUE,
|
||||
PROP_RESOLUTION,
|
||||
PROP_COV_INCREMENT,
|
||||
PROP_TIME_DELAY,
|
||||
PROP_NOTIFICATION_CLASS,
|
||||
PROP_HIGH_LIMIT,
|
||||
PROP_LOW_LIMIT,
|
||||
PROP_DEADBAND,
|
||||
PROP_LIMIT_ENABLE,
|
||||
PROP_EVENT_ENABLE,
|
||||
PROP_ACKED_TRANSITIONS,
|
||||
PROP_NOTIFY_TYPE,
|
||||
PROP_EVENT_TIME_STAMPS,
|
||||
PROP_EVENT_MESSAGE_TEXTS,
|
||||
PROP_PROFILE_NAME,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Analog_Value_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE,
|
||||
PROP_STATUS_FLAGS,
|
||||
PROP_EVENT_STATE,
|
||||
PROP_OUT_OF_SERVICE,
|
||||
PROP_UNITS,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Analog_Value_Properties_Optional[] = {
|
||||
PROP_DESCRIPTION,
|
||||
PROP_RELIABILITY,
|
||||
PROP_PRIORITY_ARRAY,
|
||||
PROP_RELINQUISH_DEFAULT,
|
||||
PROP_COV_INCREMENT,
|
||||
PROP_TIME_DELAY,
|
||||
PROP_NOTIFICATION_CLASS,
|
||||
PROP_HIGH_LIMIT,
|
||||
PROP_LOW_LIMIT,
|
||||
PROP_DEADBAND,
|
||||
PROP_LIMIT_ENABLE,
|
||||
PROP_EVENT_ENABLE,
|
||||
PROP_ACKED_TRANSITIONS,
|
||||
PROP_NOTIFY_TYPE,
|
||||
PROP_EVENT_TIME_STAMPS,
|
||||
PROP_EVENT_MESSAGE_TEXTS,
|
||||
PROP_PROFILE_NAME,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Averaging_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_MINIMUM_VALUE,
|
||||
PROP_AVERAGE_VALUE,
|
||||
PROP_MAXIMUM_VALUE,
|
||||
PROP_STATUS_FLAGS,
|
||||
PROP_EVENT_STATE,
|
||||
PROP_OUT_OF_SERVICE,
|
||||
PROP_UNITS,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Averaging_Properties_Optional[] = {
|
||||
PROP_PROFILE_NAME,
|
||||
PROP_MINIMUM_VALUE_TIMESTAMP,
|
||||
PROP_VARIANCE_VALUE,
|
||||
PROP_MAXIMUM_VALUE_TIMESTAMP,
|
||||
PROP_DESCRIPTION,
|
||||
PROP_ATTEMPTED_SAMPLES,
|
||||
PROP_VALID_SAMPLES,
|
||||
PROP_OBJECT_PROPERTY_REFERENCE,
|
||||
PROP_WINDOW_INTERVAL,
|
||||
PROP_WINDOW_SAMPLES,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Binary_Input_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE,
|
||||
PROP_STATUS_FLAGS,
|
||||
PROP_EVENT_STATE,
|
||||
PROP_OUT_OF_SERVICE,
|
||||
PROP_POLARITY,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Binary_Input_Properties_Optional[] = {
|
||||
PROP_DESCRIPTION,
|
||||
PROP_DEVICE_TYPE,
|
||||
PROP_RELIABILITY,
|
||||
PROP_INACTIVE_TEXT,
|
||||
PROP_ACTIVE_TEXT,
|
||||
PROP_CHANGE_OF_STATE_TIME,
|
||||
PROP_CHANGE_OF_STATE_COUNT,
|
||||
PROP_TIME_OF_STATE_COUNT_RESET,
|
||||
PROP_ELAPSED_ACTIVE_TIME,
|
||||
PROP_TIME_OF_ACTIVE_TIME_RESET,
|
||||
PROP_TIME_DELAY,
|
||||
PROP_NOTIFICATION_CLASS,
|
||||
PROP_ALARM_VALUE,
|
||||
PROP_EVENT_ENABLE,
|
||||
PROP_ACKED_TRANSITIONS,
|
||||
PROP_NOTIFY_TYPE,
|
||||
PROP_EVENT_TIME_STAMPS,
|
||||
PROP_EVENT_MESSAGE_TEXTS,
|
||||
PROP_PROFILE_NAME,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Binary_Output_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE,
|
||||
PROP_STATUS_FLAGS,
|
||||
PROP_EVENT_STATE,
|
||||
PROP_OUT_OF_SERVICE,
|
||||
PROP_POLARITY,
|
||||
PROP_PRIORITY_ARRAY,
|
||||
PROP_RELINQUISH_DEFAULT,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Binary_Output_Properties_Optional[] = {
|
||||
PROP_DESCRIPTION,
|
||||
PROP_DEVICE_TYPE,
|
||||
PROP_RELIABILITY,
|
||||
PROP_INACTIVE_TEXT,
|
||||
PROP_ACTIVE_TEXT,
|
||||
PROP_CHANGE_OF_STATE_TIME,
|
||||
PROP_CHANGE_OF_STATE_COUNT,
|
||||
PROP_TIME_OF_STATE_COUNT_RESET,
|
||||
PROP_ELAPSED_ACTIVE_TIME,
|
||||
PROP_TIME_OF_ACTIVE_TIME_RESET,
|
||||
PROP_MINIMUM_OFF_TIME,
|
||||
PROP_MINIMUM_ON_TIME,
|
||||
PROP_TIME_DELAY,
|
||||
PROP_NOTIFICATION_CLASS,
|
||||
PROP_FEEDBACK_VALUE,
|
||||
PROP_EVENT_ENABLE,
|
||||
PROP_ACKED_TRANSITIONS,
|
||||
PROP_NOTIFY_TYPE,
|
||||
PROP_EVENT_TIME_STAMPS,
|
||||
PROP_EVENT_MESSAGE_TEXTS,
|
||||
PROP_PROFILE_NAME,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Binary_Value_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE,
|
||||
PROP_STATUS_FLAGS,
|
||||
PROP_EVENT_STATE,
|
||||
PROP_OUT_OF_SERVICE,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Binary_Value_Properties_Optional[] = {
|
||||
PROP_DESCRIPTION,
|
||||
PROP_RELIABILITY,
|
||||
PROP_INACTIVE_TEXT,
|
||||
PROP_ACTIVE_TEXT,
|
||||
PROP_CHANGE_OF_STATE_TIME,
|
||||
PROP_CHANGE_OF_STATE_COUNT,
|
||||
PROP_TIME_OF_STATE_COUNT_RESET,
|
||||
PROP_ELAPSED_ACTIVE_TIME,
|
||||
PROP_TIME_OF_ACTIVE_TIME_RESET,
|
||||
PROP_MINIMUM_OFF_TIME,
|
||||
PROP_MINIMUM_ON_TIME,
|
||||
PROP_PRIORITY_ARRAY,
|
||||
PROP_RELINQUISH_DEFAULT,
|
||||
PROP_TIME_DELAY,
|
||||
PROP_NOTIFICATION_CLASS,
|
||||
PROP_ALARM_VALUE,
|
||||
PROP_EVENT_ENABLE,
|
||||
PROP_ACKED_TRANSITIONS,
|
||||
PROP_NOTIFY_TYPE,
|
||||
PROP_EVENT_TIME_STAMPS,
|
||||
PROP_EVENT_MESSAGE_TEXTS,
|
||||
PROP_PROFILE_NAME,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Calendar_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE,
|
||||
PROP_DATE_LIST,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Calendar_Properties_Optional[] = {
|
||||
PROP_DESCRIPTION,
|
||||
PROP_PROFILE_NAME,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Command_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE,
|
||||
PROP_IN_PROCESS,
|
||||
PROP_ALL_WRITES_SUCCESSFUL,
|
||||
PROP_ACTION,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Command_Properties_Optional[] = {
|
||||
PROP_DESCRIPTION,
|
||||
PROP_ACTION_TEXT,
|
||||
PROP_PROFILE_NAME,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Load_Control_Properties_Required[] = {
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
PROP_PRESENT_VALUE,
|
||||
PROP_STATUS_FLAGS,
|
||||
PROP_EVENT_STATE,
|
||||
PROP_REQUESTED_SHED_LEVEL,
|
||||
PROP_START_TIME,
|
||||
PROP_SHED_DURATION,
|
||||
PROP_DUTY_WINDOW,
|
||||
PROP_ENABLE,
|
||||
PROP_EXPECTED_SHED_LEVEL,
|
||||
PROP_ACTUAL_SHED_LEVEL,
|
||||
PROP_SHED_LEVELS,
|
||||
PROP_SHED_LEVEL_DESCRIPTIONS,
|
||||
-1
|
||||
};
|
||||
|
||||
static const int Load_Control_Properties_Optional[] = {
|
||||
PROP_DESCRIPTION,
|
||||
PROP_FULL_DUTY_BASELINE,
|
||||
-1
|
||||
};
|
||||
|
||||
/* Function that returns the number of properties in a list
|
||||
*/
|
||||
static unsigned property_list_count(
|
||||
const int *pList)
|
||||
{
|
||||
unsigned property_count = 0;
|
||||
|
||||
if (pList) {
|
||||
while (*pList != -1) {
|
||||
property_count++;
|
||||
pList++;
|
||||
}
|
||||
}
|
||||
|
||||
return property_count;
|
||||
}
|
||||
|
||||
/* Function that returns the list of Required or Optional properties
|
||||
* of known standard objects.
|
||||
*/
|
||||
void Property_List_Special(
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
struct special_property_list_t *pPropertyList)
|
||||
{
|
||||
if (pPropertyList == NULL) {
|
||||
return;
|
||||
}
|
||||
pPropertyList->Proprietary.pList = NULL;
|
||||
switch (object_type) {
|
||||
case OBJECT_DEVICE:
|
||||
pPropertyList->Required.pList = Device_Properties_Required;
|
||||
pPropertyList->Optional.pList = Device_Properties_Optional;
|
||||
break;
|
||||
break;
|
||||
case OBJECT_ACCUMULATOR:
|
||||
pPropertyList->Required.pList = Accumulator_Properties_Required;
|
||||
pPropertyList->Optional.pList = Accumulator_Properties_Optional;
|
||||
break;
|
||||
case OBJECT_ANALOG_INPUT:
|
||||
pPropertyList->Required.pList = Analog_Input_Properties_Required;
|
||||
pPropertyList->Optional.pList = Analog_Input_Properties_Optional;
|
||||
break;
|
||||
case OBJECT_ANALOG_OUTPUT:
|
||||
pPropertyList->Required.pList = Analog_Output_Properties_Required;
|
||||
pPropertyList->Optional.pList = Analog_Output_Properties_Optional;
|
||||
break;
|
||||
case OBJECT_ANALOG_VALUE:
|
||||
pPropertyList->Required.pList = Analog_Value_Properties_Required;
|
||||
pPropertyList->Optional.pList = Analog_Value_Properties_Optional;
|
||||
break;
|
||||
case OBJECT_AVERAGING:
|
||||
pPropertyList->Required.pList = Averaging_Properties_Required;
|
||||
pPropertyList->Optional.pList = Averaging_Properties_Optional;
|
||||
break;
|
||||
case OBJECT_BINARY_INPUT:
|
||||
pPropertyList->Required.pList = Binary_Input_Properties_Required;
|
||||
pPropertyList->Optional.pList = Binary_Input_Properties_Optional;
|
||||
break;
|
||||
case OBJECT_BINARY_OUTPUT:
|
||||
pPropertyList->Required.pList = Binary_Output_Properties_Required;
|
||||
pPropertyList->Optional.pList = Binary_Output_Properties_Optional;
|
||||
break;
|
||||
case OBJECT_BINARY_VALUE:
|
||||
pPropertyList->Required.pList = Binary_Value_Properties_Required;
|
||||
pPropertyList->Optional.pList = Binary_Value_Properties_Optional;
|
||||
break;
|
||||
case OBJECT_CALENDAR:
|
||||
pPropertyList->Required.pList = Calendar_Properties_Required;
|
||||
pPropertyList->Optional.pList = Calendar_Properties_Optional;
|
||||
break;
|
||||
case OBJECT_COMMAND:
|
||||
pPropertyList->Required.pList = Command_Properties_Required;
|
||||
pPropertyList->Optional.pList = Command_Properties_Optional;
|
||||
break;
|
||||
case OBJECT_EVENT_ENROLLMENT:
|
||||
case OBJECT_FILE:
|
||||
case OBJECT_GROUP:
|
||||
case OBJECT_LOOP:
|
||||
case OBJECT_MULTI_STATE_INPUT:
|
||||
case OBJECT_MULTI_STATE_OUTPUT:
|
||||
case OBJECT_NOTIFICATION_CLASS:
|
||||
case OBJECT_PROGRAM:
|
||||
case OBJECT_SCHEDULE:
|
||||
case OBJECT_MULTI_STATE_VALUE:
|
||||
case OBJECT_TRENDLOG:
|
||||
case OBJECT_LIFE_SAFETY_POINT:
|
||||
case OBJECT_LIFE_SAFETY_ZONE:
|
||||
case OBJECT_PULSE_CONVERTER:
|
||||
case OBJECT_EVENT_LOG:
|
||||
case OBJECT_GLOBAL_GROUP:
|
||||
case OBJECT_TREND_LOG_MULTIPLE:
|
||||
case OBJECT_LOAD_CONTROL:
|
||||
case OBJECT_STRUCTURED_VIEW:
|
||||
case OBJECT_ACCESS_DOOR:
|
||||
case OBJECT_LIGHTING_OUTPUT:
|
||||
case OBJECT_ACCESS_CREDENTIAL:
|
||||
case OBJECT_ACCESS_POINT:
|
||||
case OBJECT_ACCESS_RIGHTS:
|
||||
case OBJECT_ACCESS_USER:
|
||||
case OBJECT_ACCESS_ZONE:
|
||||
case OBJECT_CREDENTIAL_DATA_INPUT:
|
||||
case OBJECT_NETWORK_SECURITY:
|
||||
case OBJECT_BITSTRING_VALUE:
|
||||
case OBJECT_CHARACTERSTRING_VALUE:
|
||||
case OBJECT_DATE_PATTERN_VALUE:
|
||||
case OBJECT_DATE_VALUE:
|
||||
case OBJECT_DATETIME_PATTERN_VALUE:
|
||||
case OBJECT_DATETIME_VALUE:
|
||||
case OBJECT_INTEGER_VALUE:
|
||||
case OBJECT_LARGE_ANALOG_VALUE:
|
||||
case OBJECT_OCTETSTRING_VALUE:
|
||||
case OBJECT_POSITIVE_INTEGER_VALUE:
|
||||
case OBJECT_TIME_PATTERN_VALUE:
|
||||
case OBJECT_TIME_VALUE:
|
||||
pPropertyList->Required.pList = Default_Properties_Required;
|
||||
pPropertyList->Optional.pList = NULL;
|
||||
pPropertyList->Proprietary.pList = NULL;
|
||||
break;
|
||||
default:
|
||||
pPropertyList->Required.pList = Default_Properties_Required;
|
||||
pPropertyList->Optional.pList = NULL;
|
||||
pPropertyList->Proprietary.pList = NULL;
|
||||
break;
|
||||
}
|
||||
/* Fetch the counts if available otherwise zero them */
|
||||
pPropertyList->Required.count =
|
||||
pPropertyList->Required.pList ==
|
||||
NULL ? 0 : property_list_count(pPropertyList->Required.pList);
|
||||
|
||||
pPropertyList->Optional.count =
|
||||
pPropertyList->Optional.pList ==
|
||||
NULL ? 0 : property_list_count(pPropertyList->Optional.pList);
|
||||
|
||||
pPropertyList->Proprietary.count = 0;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef TEST
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include "ctest.h"
|
||||
|
||||
void testPropList(
|
||||
Test * pTest)
|
||||
{
|
||||
ct_test(pTest, 0);
|
||||
}
|
||||
|
||||
#ifdef TEST_PROPLIST
|
||||
int main(
|
||||
void)
|
||||
{
|
||||
Test *pTest;
|
||||
bool rc;
|
||||
|
||||
pTest = ct_create("BACnet Property List", NULL);
|
||||
/* individual tests */
|
||||
rc = ct_addTestFunction(pTest, testPropList);
|
||||
assert(rc);
|
||||
|
||||
ct_setStream(pTest, stdout);
|
||||
ct_run(pTest);
|
||||
(void) ct_report(pTest);
|
||||
ct_destroy(pTest);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* TEST_PROPLIST */
|
||||
#endif /* TEST */
|
||||
Reference in New Issue
Block a user