pdcomm_gem_formatted_program_query_respond
Function
Sends the S7F26 reply for a received S7F25 from the program store.
PdcommStatus pdcomm_gem_formatted_program_query_respond(PdcommTcpEndpoint *endpoint, PdcommGemResult *result)Equipment only. The reply contains the stored program with the requested PPID, or a zero-length List when the store has no such program. The reply content is captured on the first attempt, so a retry after #PDCOMM_BACKPRESSURE sends the same content even if the store changed in between. After a successful call the result outcome becomes #PDCOMM_GEM_REPLIED, reply_sent becomes 1, and the result exposes the returned program through the accessors below. A repeated call after the reply was sent returns #PDCOMM_OK without sending again.
Parameters
| Name | Description |
|---|---|
endpoint | Equipment endpoint in the GEM COMMUNICATING state. |
result | Result whose outcome is #PDCOMM_GEM_FORMATTED_PROGRAM_QUERY_RECEIVED. |
Returns
#PDCOMM_OK when S7F26 was queued or had already been sent; #PDCOMM_INVALID_ARGUMENT when endpoint or result is NULL; #PDCOMM_INVALID_STATE when the endpoint is not an Equipment in the COMMUNICATING state, the service is not configured, or result is not a query result; #PDCOMM_STALE_TOKEN when result is not a received S7F25, or came from another endpoint or an earlier HSMS session or selection; #PDCOMM_BACKPRESSURE when a staged TCP event must be drained first or the TCP send queue is full (retry later); #PDCOMM_INVALID_DATA or #PDCOMM_LIMIT_EXCEEDED when the reply cannot be built; other TCP statuses when it cannot be queued; #PDCOMM_ALLOCATION_FAILED; #PDCOMM_POISONED when the endpoint is poisoned.
Notes
- Thread safety: serialize with every other call on
endpoint, and do not readresultfrom another thread during this call.