IEC_BACNET_PROPERTY_CONTENTS (STRUCT)

TYPE IEC_BACNET_PROPERTY_CONTENTS : STRUCT

Commonly used structure for storing and transfering BACnet service and object property values.

The Property Contents data structure can be used to store the value of a local or remote property. Each property contents has BACNET_DATA_TYPE (which describes the type stored in it), the number of elements (which allows to store arrays), and a buffer (which contains a reference to memory where the actual value is stored and the buffer size). A Property Contents structure can be initialized to a variable, an array, or a buffer with sufficient size. The buffer is used for reading elements of unknown type or when the desired type has a complex structure. If you write a code that may be used on non-Intel platform, the buffer should be suitably aligned for the desired datatype. Alternatively, the application can provide an NULL pointer with 0 size, then the API routines will allocate the buffer required size, attach it to the Property Contents, and decode the result in it.n

NOTE: A Property Contents structure should be properly initialized before calling any read operation. If the memory should be provided by the API then there is no need to initialize the Property Contents with a buffer. The application shall set pBuffer to NULL and nBufferSize to zero, but after any successful reading operation BACnetFreeStackAllocatedMemory should be used to release the Property Contents that is no longer needed.

InOut:

Name

Type

Comment

tag

IEC_BACNET_DATA_TYPE

Type of data contents in this buffer

nElements

IEC_BACNET_ELEMENT_COUNT

Number of elements in this buffer

buffer

IEC_BACNET_BUFFER

Decoded BACnet value see also ref BACnetComplexDefines

rawBuffer

IEC_BACNET_BUFFER

This member is filled in the callbacks or service hooks by the BACnet API and does point to the raw BACnet encoded property value which might be of interest by some applications.

NOTE: This buffer is pointing to temporarily allocated memory which is only valid during execution of the callback and its contents has to be copied if the application requires it later. After a call to one of the BACnetRetrievePropertyInstance functions this pointer references into the internal database allocated memory which probably will get invalid on the next property value change.