Skip to content
Start free evaluation

pdcomm_gem_formatted_program_respond

Function

Sends the S7F28 acknowledge for a received S7F27 report.

PdcommStatus pdcomm_gem_formatted_program_respond(PdcommTcpEndpoint *endpoint, PdcommGemResult *result)

Declared in: #include <pdcomm_gem_formatted_programs.h>

Host only. result must be an unanswered S7F27 primary that this endpoint received in the current HSMS session. S7F28 has no body. On success the result outcome becomes #PDCOMM_GEM_REPLIED and reply_sent becomes 1.

The prepared reply is kept when queuing fails, so a call that returned #PDCOMM_BACKPRESSURE can be repeated. A repeated call after the reply was committed returns #PDCOMM_OK without sending again.

Parameters

NameDescription
endpointHost endpoint in the GEM COMMUNICATING state.
resultResult from pdcomm_gem_handle_event() whose outcome is #PDCOMM_GEM_FORMATTED_PROGRAM_RECEIVED.

Returns

#PDCOMM_OK when S7F28 was queued or had already been sent; #PDCOMM_INVALID_ARGUMENT when endpoint or result is NULL; #PDCOMM_INVALID_STATE when the endpoint is not a Host in the COMMUNICATING state, the service is not configured, or result is not a verification report result; #PDCOMM_STALE_TOKEN when result is not a received S7F27, came from another endpoint, or belongs to 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); other TCP statuses when the reply cannot be queued; #PDCOMM_POISONED when the endpoint is poisoned.

Notes

  • Thread safety: serialize with every other call on endpoint, and do not read result from another thread during this call.