BACnetStack_SetAlarmsAndEventsForObjectEnabled
bool BACnetStack_SetAlarmsAndEventsForObjectEnabled( const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t notificationClassInstance, const uint8_t notifyType, const bool enableToOffNormalEvent, const bool enableToFaultEvent, const bool enableToNormalEvent, const bool enableEventDetection, const bool enabled);Enables Alarms and Events for a specific object.
The object and the notification class object must exist before calling this function, otherwise the function will return false.
This function will enable the required properties and store the initial values in memory.
For an object type whose intrinsic reporting applies the NONE event algorithm - Command, Device, Notification Class, Program, Schedule, Credential Data Input, the Date, Time, DateTime and pattern Value types, Channel, Network Port, Lighting Output (cl. 12.54) and Binary Lighting Output - no BACnetStack_SetIntrinsic* setter applies, so enabling also attaches the NONE event algorithm: the object reports faults only. The Event_State of a Lighting Output, Binary Lighting Output, Channel, Credential Data Input, Program or Network Port then shows FAULT while a Reliability fault is held. For the other types listed (Command, Device, Notification Class, Schedule, and the Date, Time, DateTime and pattern Value types), the stack does not carry a Reliability change to their event state, so attaching NONE changes nothing a client can see. An event algorithm already attached is kept when the object is enabled again.
An OctetString Value has no intrinsic-reporting properties (cl. 12.41), so enabling one returns false and changes nothing.
NOTE: this function makes Event_Algorithm_Inhibit and Reliability_Evaluation_Inhibit WRITABLE, so a remote client can inhibit the algorithms armed by the SetIntrinsic* / SetFault* setters.
BACnet reference: ANSI/ASHRAE 135-2024 clause 13.2 (Event Reporting).
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The instance number of the device that owns this object. |
objectType, objectInstance |
in | The object for alarms and events: one BACnet Object Identifier, carried as two parameters (see the API conventions). |
notificationClassInstance |
in | The instance number of the notification class object that will handle the event notifications generated by this object. |
notifyType |
in | The type of notifications that this object generates, a BACnetNotifyType (cl. 21): 0 = Alarm, 1 = Event. Any other value (2 = ACK_NOTIFICATION included) returns false and changes nothing when enabled is true (135-2024 cl. 12.2.25: the object’s notifications are Events or Alarms). |
enableToOffNormalEvent |
in | Whether the To_OffNormal event is enabled (true) or not (false). Recommended value: true. |
enableToFaultEvent |
in | Whether the To_Fault event is enabled (true) or not (false). Recommended value: true. |
enableToNormalEvent |
in | Whether the To_Normal event is enabled (true) or not (false). Recommended value: true. The three enableTo* flags set the bits of the object’s Event_Enable property, a BACnetEventTransitionBits BIT STRING (cl. 21). |
enableEventDetection |
in | Whether event detection is enabled (true) or not (false). Recommended value: true |
enabled |
in | Master switch. Caution: false is destructive, not merely “skip”. It frees this object’s alarm-and-event state - discarding any event or fault algorithm already armed by the BACnetStack_SetIntrinsic* / BACnetStack_SetFault* setters - and disables Event_State, Notification_Class, Event_Enable, Acked_Transitions, Notify_Type, Event_Time_Stamps, Event_Detection_Enable, Event_Algorithm_Inhibit and Reliability_Evaluation_Inhibit, then returns true. The other parameters are ignored when false. Re-enabling requires re-arming every algorithm from scratch. Recommended value: true. |
Returns
Section titled “Returns”True on success; false if the device or object does not exist, if enabled is true and the Notification Class object does not exist, the object is an OctetString Value or notifyType is not 0 or 1, or if Alarm-and-Event support was not compiled (STACK_OPTION_ALARMS_AND_EVENTS).
Topic: Alarms and events. Declared in CASBACnetStackDLL.h.