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:
@@ -33,9 +33,9 @@
|
||||
|
||||
static COMMAND_DESCR Command_Descr[MAX_COMMANDS];
|
||||
|
||||
/* clang-format off */
|
||||
/* These arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int32_t Command_Properties_Required[] = {
|
||||
/* unordered list of required properties */
|
||||
PROP_OBJECT_IDENTIFIER,
|
||||
PROP_OBJECT_NAME,
|
||||
PROP_OBJECT_TYPE,
|
||||
@@ -43,12 +43,21 @@ static const int32_t Command_Properties_Required[] = {
|
||||
PROP_IN_PROCESS,
|
||||
PROP_ALL_WRITES_SUCCESSFUL,
|
||||
PROP_ACTION,
|
||||
-1 };
|
||||
-1
|
||||
};
|
||||
|
||||
static const int32_t Command_Properties_Optional[] = { -1 };
|
||||
|
||||
static const int32_t Command_Properties_Proprietary[] = { -1 };
|
||||
/* clang-format on */
|
||||
|
||||
/* 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, -1
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the list of required, optional, and proprietary properties.
|
||||
@@ -79,6 +88,20 @@ void Command_Property_Lists(
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the list of writable properties for an Command object
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @param properties - Pointer to the pointer of writable properties.
|
||||
*/
|
||||
void Command_Writable_Property_List(
|
||||
uint32_t object_instance, const int32_t **properties)
|
||||
{
|
||||
(void)object_instance;
|
||||
if (properties) {
|
||||
*properties = Writable_Properties;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the Command object data
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user