pdcomm_gem_equipment_publish_alarm
Function
Publishes the current state of one alarm as an S5F1 Alarm Report Send.
PdcommStatus pdcomm_gem_equipment_publish_alarm(PdcommTcpEndpoint *endpoint, uint32_t id, uint8_t reply_expected, PdcommTcpToken *out_token)The report carries L[ALCD, ALID, ALTX], with the ALCD alarm-set bit taken from the current observed state. Publishing requires GEM communication to be COMMUNICATING and reporting of the alarm to be enabled by the Host. The queued body is an independent snapshot of the alarm.
With W=1 the request occupies one of the 32 native GEM pending slots, and pdcomm_gem_handle_event() later yields a RESPONSE result with outcome #PDCOMM_GEM_ALARM_ACK and the ACKC5 value. With W=0 no pending slot is used, so the report can be submitted while all 32 slots are busy if TCP still has capacity; the TCP #PDCOMM_TCP_W0_WRITTEN event then means only that the frame was written locally, not that the Host received it.
Parameters
| Name | Description |
|---|---|
endpoint | Endpoint with a configured GEM Equipment and alarm store. |
id | Alarm ID (ALID) to publish. |
reply_expected | 1 to send with W=1 (request S5F2), 0 to send with W=0. |
out_token | Receives the transport token of the accepted message. Zeroed first, so it is zero after every failure. |
Returns
#PDCOMM_OK when the message was queued (queue acceptance only); #PDCOMM_INVALID_ARGUMENT when endpoint or out_token is NULL or reply_expected 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 no alarm store, reporting of the alarm is disabled, communication is not COMMUNICATING, or the HSMS session is not selected; #PDCOMM_BACKPRESSURE when a TCP event is staged, all 32 pending slots are busy (W=1 only), or the TCP queue is full or stopping; #PDCOMM_LIMIT_EXCEEDED when the message exceeds the endpoint limits; #PDCOMM_ALLOCATION_FAILED; #PDCOMM_POISONED when the endpoint is poisoned or a panic was contained; or another TCP submission status, as for pdcomm_tcp_request().