Add API for writable object property lists (#1206)
Added a new API for writable property lists across all the basic example object types, preparing for the introduction of a Writable_Property_List property in every object in a future BACnet standard revision. The lists can be used by backup and restore feature to automatically choose the object property values in the backup that can be restored via internal WriteProperty directly from BACnet CreateObject services with List of Initial Values. Updated existing device object examples to include these writable property lists.
This commit is contained in:
@@ -67,20 +67,17 @@ static const BACNET_OBJECT_TYPE Object_Type = OBJECT_BINARY_VALUE;
|
||||
static binary_value_write_present_value_callback
|
||||
Binary_Value_Write_Present_Value_Callback;
|
||||
|
||||
/* clang-format off */
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int32_t 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
|
||||
/* unordered list of optional properties */
|
||||
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 int32_t Binary_Value_Properties_Optional[] = {
|
||||
/* unordered list of optional properties */
|
||||
PROP_DESCRIPTION,
|
||||
PROP_RELIABILITY,
|
||||
PROP_ACTIVE_TEXT,
|
||||
@@ -98,10 +95,25 @@ static const int32_t Binary_Value_Properties_Optional[] = {
|
||||
-1
|
||||
};
|
||||
|
||||
static const int32_t Binary_Value_Properties_Proprietary[] = {
|
||||
static const int32_t Binary_Value_Properties_Proprietary[] = { -1 };
|
||||
|
||||
/* Every object shall have a Writable Property_List property
|
||||
which is a BACnetARRAY of property identifiers,
|
||||
one property identifier for each property within this object
|
||||
that is always writable. */
|
||||
static const int32_t Writable_Properties[] = {
|
||||
/* unordered list of always writable properties */
|
||||
PROP_PRESENT_VALUE,
|
||||
PROP_OUT_OF_SERVICE,
|
||||
#if defined(INTRINSIC_REPORTING) && (BINARY_VALUE_INTRINSIC_REPORTING)
|
||||
PROP_TIME_DELAY,
|
||||
PROP_NOTIFICATION_CLASS,
|
||||
PROP_ALARM_VALUE,
|
||||
PROP_EVENT_ENABLE,
|
||||
PROP_NOTIFY_TYPE,
|
||||
#endif
|
||||
-1
|
||||
};
|
||||
/* clang-format on */
|
||||
|
||||
/**
|
||||
* Initialize the pointers for the required, the optional and the properitary
|
||||
@@ -129,6 +141,20 @@ void Binary_Value_Property_Lists(
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the list of writable properties for a Binary Value object
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @param properties - Pointer to the pointer of writable properties.
|
||||
*/
|
||||
void Binary_Value_Writable_Property_List(
|
||||
uint32_t object_instance, const int32_t **properties)
|
||||
{
|
||||
(void)object_instance;
|
||||
if (properties) {
|
||||
*properties = Writable_Properties;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gets an object from the list using an instance number as the key
|
||||
* @param object_instance - object-instance number of the object
|
||||
|
||||
Reference in New Issue
Block a user