Skip to content
Start free evaluation

pdcomm_gem_equipment_publish_event

Function

Sends an Event Report Send (S6F11, W-bit set) for an enabled event.

PdcommStatus pdcomm_gem_equipment_publish_event(PdcommTcpEndpoint *endpoint, uint32_t data_id, uint32_t event_id, PdcommTcpToken *out_token)

Declared in: #include <pdcomm_gem_reports.h>

The report body is built from the current values of every VID in every linked report, resolved through the report bindings (or, without bindings, from the registered status variables), and queued as an independent snapshot. The Host's S6F12 later produces #PDCOMM_GEM_RESPONSE with request kind #PDCOMM_GEM_EVENT_REPORT and outcome #PDCOMM_GEM_EVENT_ACK; the ACKC6 value (0 to 63) is preserved in acknowledgement. This is equivalent to pdcomm_gem_equipment_publish_event_with_data() without samples.

Parameters

NameDescription
endpointEquipment endpoint in the Communicating state.
data_idDATAID to send (U4).
event_idCEID to report.
out_tokenZeroed first; receives the transaction token on success. Must not be NULL.

Returns

#PDCOMM_OK when the report was queued; #PDCOMM_INVALID_ARGUMENT when endpoint or out_token is NULL; #PDCOMM_INVALID_STATE when the endpoint is not an Equipment, is not Communicating, or a data variable value is unavailable; #PDCOMM_INVALID_DATA when no report store is configured or the event is unknown or disabled; #PDCOMM_OUT_OF_RANGE when a reported VID has no value source; #PDCOMM_LIMIT_EXCEEDED when the message exceeds the item limits; #PDCOMM_BACKPRESSURE when a TCP event is staged or the pending slots or send queue are full; #PDCOMM_ALLOCATION_FAILED, #PDCOMM_IO_ERROR, or #PDCOMM_POISONED.