pdcomm_gem_equipment_respond_constants
Function
Sends the S2F16 reply for a received S2F15 and applies accepted values.
PdcommStatus pdcomm_gem_equipment_respond_constants(PdcommTcpEndpoint *endpoint, PdcommGemResult *result, uint8_t decision, PdcommGemConstantReply *reply)S2F15 is returned as #PDCOMM_GEM_PRIMARY with outcome #PDCOMM_GEM_CONSTANT_CHANGES_RECEIVED and no automatic acknowledgement. The result owns the receipt validation, the original values, and a candidate store. If receipt validation rejected the request, the reply always carries its EAC 1 (unknown ECID) or 3 (invalid value), whatever decision is. Otherwise the reply carries decision, and only a successful EAC 0 reply swaps the candidate into the store; no physical operation, persistence, or event publication is performed. A candidate becomes stale after another change or a reconfiguration and can no longer be applied, but a valid non-apply decision can still reject it and release the incoming transaction. A build or send failure preserves the candidate, the current store, and retryability; only success sets responded and the reply fields. A reply to an empty S2F15 with EAC 0 reports applied 0. The original TCP event may already be destroyed.
Parameters
| Name | Description |
|---|---|
endpoint | Equipment endpoint that produced result; must be Communicating. |
result | Result with outcome #PDCOMM_GEM_CONSTANT_CHANGES_RECEIVED. |
decision | #PDCOMM_GEM_CONSTANT_APPLY, #PDCOMM_GEM_CONSTANT_CANNOT_PERFORM, #PDCOMM_GEM_CONSTANT_OUT_OF_RANGE, or an equipment-specific EAC from 4 to 63. |
reply | Caller storage; set reply->struct_size first. Known fields are zeroed first and receive the sent EAC and the applied flag on success. |
Returns
#PDCOMM_OK when S2F16 was queued; #PDCOMM_INVALID_ARGUMENT when reply is NULL or too small, endpoint or result is NULL, decision is 1 or greater than 63, or result is not a received S2F15; #PDCOMM_STALE_TOKEN when the result was already answered, belongs to another endpoint, connection generation, or selection, its incoming transaction is gone, or an EAC 0 decision targets a stale candidate; #PDCOMM_INVALID_STATE when the endpoint is not an Equipment or is not Communicating; #PDCOMM_BACKPRESSURE when a TCP event is staged or the send queue is full; #PDCOMM_LIMIT_EXCEEDED, #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.