Fixed structured view object subtype get and set. (#909)
This commit is contained in:
@@ -286,6 +286,31 @@ bool bacnet_device_object_property_reference_same(
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Copy the complex data of src into dest
|
||||
* @param dest - destination structure
|
||||
* @param src - source structure
|
||||
* @return true if the values are the copied
|
||||
*/
|
||||
bool bacnet_device_object_property_reference_copy(
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *dest,
|
||||
const BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *src)
|
||||
{
|
||||
bool status = false;
|
||||
|
||||
if (dest && src) {
|
||||
dest->arrayIndex = src->arrayIndex;
|
||||
dest->deviceIdentifier.instance = src->deviceIdentifier.instance;
|
||||
dest->deviceIdentifier.type = src->deviceIdentifier.type;
|
||||
dest->objectIdentifier.instance = src->objectIdentifier.instance;
|
||||
dest->objectIdentifier.type = src->objectIdentifier.type;
|
||||
dest->propertyIdentifier = src->propertyIdentifier;
|
||||
status = true;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode a property reference of a device object.
|
||||
*
|
||||
@@ -551,6 +576,29 @@ bool bacnet_device_object_reference_same(
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Copy the complex data from src into dest
|
||||
* @param dest - destination structure
|
||||
* @param src - source structure
|
||||
* @return true if the values are copied
|
||||
*/
|
||||
bool bacnet_device_object_reference_copy(
|
||||
BACNET_DEVICE_OBJECT_REFERENCE *dest,
|
||||
const BACNET_DEVICE_OBJECT_REFERENCE *src)
|
||||
{
|
||||
bool status = false;
|
||||
|
||||
if (dest && src) {
|
||||
dest->deviceIdentifier.instance = src->deviceIdentifier.instance;
|
||||
dest->deviceIdentifier.type = src->deviceIdentifier.type;
|
||||
dest->objectIdentifier.instance = src->objectIdentifier.instance;
|
||||
dest->objectIdentifier.type = src->objectIdentifier.type;
|
||||
status = true;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode the device object reference.
|
||||
*
|
||||
@@ -822,6 +870,28 @@ bool bacnet_object_property_reference_same(
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Copy the complex data from src to dest
|
||||
* @param dest - destination structure
|
||||
* @param src - source structure
|
||||
* @return true if the values are copied
|
||||
*/
|
||||
bool bacnet_object_property_reference_copy(
|
||||
BACNET_OBJECT_PROPERTY_REFERENCE *dest,
|
||||
const BACNET_OBJECT_PROPERTY_REFERENCE *src)
|
||||
{
|
||||
bool status = false;
|
||||
|
||||
if (src && dest) {
|
||||
dest->property_identifier = src->property_identifier;
|
||||
dest->object_identifier.instance = src->object_identifier.instance;
|
||||
dest->object_identifier.type = src->object_identifier.type;
|
||||
status = true;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a BACnetPropertyReference into a buffer
|
||||
*
|
||||
|
||||
@@ -163,16 +163,28 @@ BACNET_STACK_EXPORT
|
||||
bool bacnet_device_object_property_reference_same(
|
||||
const BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *value1,
|
||||
const BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *value2);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacnet_device_object_property_reference_copy(
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *dest,
|
||||
const BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *src);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacnet_device_object_reference_same(
|
||||
const BACNET_DEVICE_OBJECT_REFERENCE *value1,
|
||||
const BACNET_DEVICE_OBJECT_REFERENCE *value2);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacnet_device_object_reference_copy(
|
||||
BACNET_DEVICE_OBJECT_REFERENCE *dest,
|
||||
const BACNET_DEVICE_OBJECT_REFERENCE *src);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacnet_object_property_reference_same(
|
||||
const BACNET_OBJECT_PROPERTY_REFERENCE *value1,
|
||||
const BACNET_OBJECT_PROPERTY_REFERENCE *value2);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacnet_object_property_reference_copy(
|
||||
BACNET_OBJECT_PROPERTY_REFERENCE *dest,
|
||||
const BACNET_OBJECT_PROPERTY_REFERENCE *src);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int bacnet_property_reference_encode(
|
||||
|
||||
@@ -325,7 +325,7 @@ const char *Structured_View_Node_Subtype(uint32_t object_instance)
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
if (pObject->Description) {
|
||||
if (pObject->Node_Subtype) {
|
||||
name = pObject->Node_Subtype;
|
||||
} else {
|
||||
name = "";
|
||||
@@ -350,7 +350,7 @@ bool Structured_View_Node_Subtype_Set(
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Description = new_name;
|
||||
pObject->Node_Subtype = new_name;
|
||||
}
|
||||
|
||||
return status;
|
||||
@@ -469,8 +469,8 @@ bool Structured_View_Represents_Set(
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
status = true;
|
||||
pObject->Represents = *represents;
|
||||
status = bacnet_device_object_reference_copy(
|
||||
&pObject->Represents, represents);
|
||||
}
|
||||
|
||||
return status;
|
||||
|
||||
Reference in New Issue
Block a user