upm  1.5.0
Sensor/Actuator repository for libmraa (v1.8.0)
Data Structures | Typedefs
Object Helper Functions

Data Structures

struct  object_functions
 

Typedefs

typedef void(* object_init_function) (void)
 
typedef unsigned(* object_count_function) (void)
 
typedef uint32_t(* object_index_to_instance_function) (unsigned index)
 
typedef bool(* object_name_function) (uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
 
typedef bool(* object_valid_instance_function) (uint32_t object_instance)
 
typedef unsigned(* object_iterate_function) (unsigned current_index)
 
typedef bool(* object_value_list_function) (uint32_t object_instance, BACNET_PROPERTY_VALUE *value_list)
 
typedef bool(* object_cov_function) (uint32_t object_instance)
 
typedef void(* object_cov_clear_function) (uint32_t object_instance)
 
typedef void(* object_intrinsic_reporting_function) (uint32_t object_instance)
 
typedef struct object_functions object_functions_t
 

Detailed Description

This section describes the function templates for the helper functions that provide common object support.

Typedef Documentation

◆ object_init_function

typedef void( * object_init_function) (void)

Called so a BACnet object can perform any necessary initialization.

◆ object_count_function

typedef unsigned( * object_count_function) (void)

Counts the number of objects of this type.

Returns
Count of implemented objects of this type.

◆ object_index_to_instance_function

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.

◆ object_name_function

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.

◆ object_valid_instance_function

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]Theobject instance number to be looked up.
Returns
True if the object instance refers to a valid object of this type.

◆ object_iterate_function

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]Theindex 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.

◆ object_value_list_function

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]Theobject instance number to be looked up.
[out]Thevalue list
Returns
True if the object instance supports this feature, and has changed.

◆ object_cov_function

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]Theobject instance number to be looked up.
Returns
True if the object instance has changed.

◆ object_cov_clear_function

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]Theobject instance number to be looked up.

◆ object_intrinsic_reporting_function

typedef void( * object_intrinsic_reporting_function) (uint32_t object_instance)

Intrinsic Reporting funcionality.

Parameters
[in]Objectinstance.

◆ object_functions_t

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.

Collaboration diagram for Object Helper Functions: