Skip to content
Start free evaluation

pdcomm_gem_equipment_observe_alarm

Function

Records the current set or cleared state of an alarm without sending anything.

PdcommStatus pdcomm_gem_equipment_observe_alarm(PdcommTcpEndpoint *endpoint, uint32_t id, uint8_t active, PdcommGemAlarmChange *change)

Declared in: #include <pdcomm_gem_alarms.h>

The observation updates the stored state immediately and does not allocate. When the state changes, change reports the transition and the configured set or clear CEID. When the state is unchanged, changed and event_present are 0. reporting_enabled is a snapshot of the Host's current S5F3 setting for the alarm.

Publishing is separate: call pdcomm_gem_equipment_publish_alarm() for the S5F1 report and pdcomm_gem_equipment_publish_event() for the S6F11 event report of the returned CEID. A later send failure never rolls the observed state back.

Parameters

NameDescription
endpointEndpoint with a configured GEM Equipment and alarm store.
idAlarm ID (ALID).
active1 when the alarm condition is set, 0 when it is cleared.
changeCaller storage; set change->struct_size before the call. Written only on success.

Returns

#PDCOMM_OK when the observation was recorded; #PDCOMM_INVALID_ARGUMENT when endpoint or change is NULL, change->struct_size is too small, or active is not 0 or 1; #PDCOMM_OUT_OF_RANGE when id is not a configured alarm; #PDCOMM_INVALID_STATE when the endpoint has no GEM Equipment or the GEM Equipment has no alarm store; #PDCOMM_POISONED when the endpoint is poisoned or a panic was contained.