BACnetStack_AddEventLogObject
bool BACnetStack_AddEventLogObject( const uint32_t deviceInstance, const uint32_t objectInstance, const uint32_t maxBufferSize);Adds a BACnet Event Log Object.
The device must be added first. Records accumulate from received event notifications. Each record advances Total_Record_Count, the property the BUFFER_READY event algorithm monitors.
The Event Log properties that are handled and stored by the CAS BACnet Stack are:
- Enable, Stop_When_Full
- Buffer_Size, Record_Count, Total_Record_Count
- Notification_Threshold, Records_Since_Notification, Last_Notify_Record
- Log_Buffer, Object_Identifier, Object_Type, Status_Flags, Property_List These are answered from stack storage BEFORE any callback is consulted, so a registered Get callback CANNOT override them, and writes to the writable ones land in the same storage rather than in a Set callback. Start_Time and Stop_Time are also stored by the stack, but this function does NOT enable them (they are optional in cl. 12.27). Until BACnetStack_SetPropertyEnabled() is called for them, a read returns Error(PROPERTY, UNKNOWN_PROPERTY). Once intrinsic BUFFER_READY reporting is enabled, Notification_Threshold, Records_Since_Notification and Last_Notify_Record are served by the event algorithm instead of by this object’s own members, for both reads and writes. Log_Buffer records are retrieved with ReadRange. As for the Trend Log, a ReadProperty of it returns Error(PROPERTY, READ_ACCESS_DENIED).
Callbacks are used to handle the remaining required properties. The following list contains those properties and the Callbacks that are used to get the required data:
-------------------------------------------------------------------------------- Property Datatype Callback -------------------------------------------------------------------------------- ObjectName CharacterString CallbackGetPropertyCharacterString CallbackSetPropertyCharacterString (only if made writable) EventState* Enumerated CallbackGetPropertyEnumerated (*) Served by the stack's intrinsic alarm engine instead, if intrinsic reporting has been enabled for this object. With neither an alarm engine nor a callback the stack answers NORMAL. --------------------------------------------------------------------------------See also: BACnetStack_ObjectExists(), BACnetStack_RemoveObject()
BACnet reference: ANSI/ASHRAE 135-2024 clause 12.27 (Event Log Object Type).
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The instance of the device that the event log object is added to. |
objectInstance |
in | The instance of the event log object being added. |
maxBufferSize |
in | The maximum number of records to maintain in memory. |
Returns
Section titled “Returns”Returns true if successful, false if failed.
Topic: Objects and properties. Declared in CASBACnetStackDLL.h.