This section describes the function templates for the helper functions that provide common object support.
typedef void( * object_init_function) (void) |
Called so a BACnet object can perform any necessary initialization.
typedef unsigned( * object_count_function) (void) |
Counts the number of objects of this type.
- Returns
- Count of implemented objects of this type.
typedef uint32_t( * object_index_to_instance_function) (unsigned index) |
Maps an object index position to its corresponding BACnet object instance number.
- Parameters
-
index | [in] The index of the object, in the array of objects of its type. |
- Returns
- The BACnet object instance number to be used in a BACNET_OBJECT_ID.
typedef bool( * object_name_function) (uint32_t object_instance, BACNET_CHARACTER_STRING *object_name) |
Provides the BACnet Object_Name for a given object instance of this type.
- Parameters
-
object_instance | [in] The object instance number to be looked up. |
object_name | [in,out] Pointer to a character_string structure that will hold a copy of the object name if this is a valid object_instance. |
- Returns
- True if the object_instance is valid and object_name has been filled with a copy of the Object's name.
typedef bool( * object_valid_instance_function) (uint32_t object_instance) |
Look in the table of objects of this type, and see if this is a valid instance number.
- Parameters
-
[in] | The | object instance number to be looked up. |
- Returns
- True if the object instance refers to a valid object of this type.
typedef unsigned( * object_iterate_function) (unsigned current_index) |
Helper function to step through an array of objects and find either the first one or the next one of a given type. Used to step through an array of objects which is not necessarily contiguious for each type i.e. the index for the 'n'th object of a given type is not necessarily 'n'.
- Parameters
-
[in] | The | index of the current object or a value of ~0 to indicate start at the beginning. |
- Returns
- The index of the next object of the required type or ~0 (all bits == 1) to indicate no more objects found.
typedef bool( * object_value_list_function) (uint32_t object_instance, BACNET_PROPERTY_VALUE *value_list) |
Look in the table of objects of this type, and get the COV Value List.
- Parameters
-
[in] | The | object instance number to be looked up. |
[out] | The | value list |
- Returns
- True if the object instance supports this feature, and has changed.
typedef bool( * object_cov_function) (uint32_t object_instance) |
Look in the table of objects for this instance to see if value changed.
- Parameters
-
[in] | The | object instance number to be looked up. |
- Returns
- True if the object instance has changed.
typedef void( * object_cov_clear_function) (uint32_t object_instance) |
Look in the table of objects for this instance to clear the changed flag.
- Parameters
-
[in] | The | object instance number to be looked up. |
typedef void( * object_intrinsic_reporting_function) (uint32_t object_instance) |
Intrinsic Reporting funcionality.
- Parameters
-
Defines the group of object helper functions for any supported Object.
Each Object must provide some implementation of each of these helpers in order to properly support the handlers. Eg, the ReadProperty handler handler_read_property() relies on the instance of Object_Read_Property for each Object type, or configure the function as NULL. In both appearance and operation, this group of functions acts like they are member functions of a C++ Object base class.