EVT_BACNET_WRITEPROPERTYCALLBACK (STRUCT)

TYPE EVT_BACNET_WRITEPROPERTYCALLBACK : STRUCT

This routine is provided by the application and is invoked by the API default actions when a WriteProperty or WritePropertyMutiple request is being processed or an internal write is made. A pointer to the routine is registered with the BACnetSetCallback. The callback has the opportunity to use the value for the Property supplied in the Property Contents argument. The write callback is intended to allow an application to set a parameter of a physical instrument. This callback is invoked for any property that has been attached to the write callback regardless of the current value of the Out-Of-Service property. When Out-Of-Service is TRUE, some properties are no longer represent the physical value of the device assosiated with this object. Therefore, the application callback should check the value of the Out-Of-Service property, and if Out-Of-Service is TRUE and the target property is required to be decoupled from the physical device when Out-Of-Service is TRUE then the callback should not take any action and return immediately with CALLBACK_STATUS_DEFAULT.

NOTE: On initialization of the client or server interface of this API the user application has to

make the choice, if it preferes the write callback to be called BEFORE the internal database contents is updated or AFTER the update has been done. The configuration is done by setting the bRWPropCBComplete member of the IEC_BACNET_SRVR_INIT or IEC_BACNET_CLI_INIT struct to True or False. If this is set to True, write callbacks will occure AFTER the internal database has been updated and parameter index will always have a value of BACNET_VOID_INDEX (-1) to indicate that the whole array contents is present even if only one index of content has been changed.

InOut:

Name

Type

Comment

pCallbackStatus

POINTER TO IEC_BACNET_CALLBACK_STATUS

Callback-Status returned for the event. “Default” processes the standard APIs reaction and takes no action.

deviceNumber

IEC_BACNET_DWORD

The device instance number in which the object is to be expected.

pObjectID

POINTER TO IEC_BACNET_OBJECT_ID

Pointer to the object identifier of the object which property value is to be written.

propertyID

IEC_BACNET_PROPERTY_ID

The Property Identifier of the Property to be written (for example the Present Value Property of an Analog Input Object. The same callback routine is invoked for all properties of all objects.

index

IEC_BACNET_SIGNED

An index of an array item. If the Property is not an array, the index value BACNET_VOID_INDEX (-1) should be used. If the Property is an array, the index value BACNET_ENTIRE_ARRAY (-1) can be used to read the entire array. If the Property is an array, the index value “BACNET_ARRAY_COUNT (0)” (use 0) will write the number of elements in the array. The indices of BACnet arrays start counting at 1.

pPropertyContents

POINTER TO IEC_BACNET_PROPERTY_CONTENTS

The property contents buffer which is filled by the stack API. The user has the choice to use the c-structure representation of the value (stored in the buffer member of the structure) or to use the ASN1 encoded representation of the value (stored in the rawBuffer member of the structure).