Bugfix/issues 1082 AddListElement and RemoveListElement and Notification Class object (#1083)
* Fixed AddListElement and RemoveListElement which were checking the wrong return value from Device object. * Fixed decoding of ListElement Tag 0: Object ID instance. * Fixed Notification_Class_Add_List_Element() and Notification_Class_Remove_List_Element() element counter index, and empty slot detection. * Added bacnet_recipient_device_set() and bacnet_recipient_address_set() API * Added unit test coverage for Notification Class object.
This commit is contained in:
@@ -94,6 +94,36 @@ bool bacnet_recipient_same(
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the BACnetRecipient complex data to a device
|
||||
* @param dest - BACnetRecipient structure
|
||||
* @param object_type - BACnetObjectType enumeration value
|
||||
* @param instance - BACnetObjectInstance value
|
||||
*/
|
||||
void bacnet_recipient_device_set(
|
||||
BACNET_RECIPIENT *dest, BACNET_OBJECT_TYPE object_type, uint32_t instance)
|
||||
{
|
||||
if (dest) {
|
||||
dest->tag = BACNET_RECIPIENT_TAG_DEVICE;
|
||||
dest->type.device.type = object_type;
|
||||
dest->type.device.instance = instance;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the BACnetRecipient complex data to an address
|
||||
* @param dest - BACnetRecipient structure
|
||||
* @param address - BACnetAddress structure
|
||||
*/
|
||||
void bacnet_recipient_address_set(
|
||||
BACNET_RECIPIENT *dest, const BACNET_ADDRESS *address)
|
||||
{
|
||||
if (dest && address) {
|
||||
dest->tag = BACNET_RECIPIENT_TAG_ADDRESS;
|
||||
bacnet_address_copy(&dest->type.address, address);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Copy the BACnetRecipient complex data from src to dest
|
||||
* @param src - BACnetRecipient 1 structure
|
||||
|
||||
Reference in New Issue
Block a user