pdcomm_gem_equipment_respond_report_query
Function
Sends the reply (S6F16, S6F20, or S6F22) to a received report query.
PdcommStatus pdcomm_gem_equipment_respond_report_query(PdcommTcpEndpoint *endpoint, PdcommGemResult *result, const PdcommGemDataSample *samples, size_t count)The reply uses the report graph, bindings, and caches current at response time. Samples are keyed by data variable ID (DVID) and override the cache for this reply only; pass NULL and 0 to use cached values. Every supplied sample is validated, including samples that no reported VID uses and queries that return an empty report. The complete value set and encoded reply are checked before submission. A failure keeps the request unresponded so that a fresh explicit call can retry. Only success sets responded and reply_sent. There is no automatic abort, retry, device operation, or event acknowledgement.
Parameters
| Name | Description |
|---|---|
endpoint | Equipment endpoint that produced result; must be Communicating. |
result | Result with outcome #PDCOMM_GEM_REPORT_QUERY_RECEIVED. |
samples | Array of count samples. May be NULL when count is 0. |
count | Number of samples; at most max_samples_per_event of the data store. |
Returns
#PDCOMM_OK when the reply was queued; #PDCOMM_INVALID_ARGUMENT when endpoint or result is NULL, samples is NULL with a nonzero count, result is not a received query, or a sample is NULL, unknown, repeated, or has the wrong format or count; #PDCOMM_STALE_TOKEN when the query was already answered, belongs to another endpoint, connection generation, or selection, or its incoming transaction is gone; #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_OUT_OF_RANGE when a reported VID has no value source; #PDCOMM_LIMIT_EXCEEDED when a sample or message limit is exceeded; #PDCOMM_BACKPRESSURE when a TCP event is staged or the send queue is full; #PDCOMM_ALLOCATION_FAILED, #PDCOMM_IO_ERROR, or #PDCOMM_POISONED.
Notes
- Thread safety: this call mutates
result. Never run it concurrently with getters on, or destruction of, the same result.