Skip to content
Start free evaluation

pdcomm_gem_equipment_publish_event_with_data

Function

Sends an Event Report Send (S6F11, W-bit set) using sampled data variable values.

PdcommStatus pdcomm_gem_equipment_publish_event_with_data(PdcommTcpEndpoint *endpoint, uint32_t data_id, uint32_t event_id, const PdcommGemDataSample *samples, size_t count, PdcommTcpToken *out_token)

Declared in: #include <pdcomm_gem_data.h>

Works like pdcomm_gem_equipment_publish_event(), but a DATA-bound VID takes its value from the sample with the matching DVID first, then from the cache; if neither exists the whole report fails. Every sample, including samples whose DVID no report uses, is validated against the sample count, sample byte, and item limits and must name a known DVID exactly once with the declared format and count. Samples never change the cache. The complete ordered report is built before submission, so the sample items can be changed or destroyed after the call returns. The existing #PDCOMM_GEM_EVENT_REPORT request kind, #PDCOMM_GEM_EVENT_ACK outcome, 32 pending slots, token, T3, and cancellation rules apply. A failure leaves out_token zeroed and preserves caches, bindings, and previously queued reports.

Parameters

NameDescription
endpointEquipment endpoint in the Communicating state.
data_idDATAID to send (U4).
event_idCEID to report; must be enabled. Without linked reports the S6F11 carries an empty report list.
samplesArray of count samples. May be NULL when count is 0, which uses cached values only.
countNumber of samples; at most max_samples_per_event.
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, samples is NULL with a nonzero count, a sample value is NULL, or a sample names an unknown or repeated DVID or has the wrong format or count; #PDCOMM_LIMIT_EXCEEDED when a sample count, sample byte, item, or message limit is exceeded; #PDCOMM_INVALID_STATE when the endpoint is not an Equipment, is not Communicating, samples are supplied without a data store, or a reported data 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_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.

Notes

  • Submission is not peer acknowledgement; wait for the #PDCOMM_GEM_EVENT_ACK result.