Skip to content
Start free evaluation

pdcomm_gem_formatted_program_execution_complete

Function

Records the application's terminal report for the execution.

PdcommStatus pdcomm_gem_formatted_program_execution_complete(PdcommTcpEndpoint *endpoint, const PdcommGemFormattedProgramExecutionToken *execution_token, uint64_t report_id, uint32_t outcome, const uint8_t *detail, size_t detail_length)

Declared in: #include <pdcomm_gem_formatted_program_executions.h>

Allowed in RUNNING with no pending action. #PDCOMM_GEM_FORMATTED_PROGRAM_EXECUTION_TERMINAL_COMPLETE additionally requires every command to have been applied. The state becomes COMPLETED, FAILED, or OUTCOME_UNKNOWN. Repeating the identical report succeeds without changing state.

Parameters

NameDescription
endpointEquipment endpoint with formatted program queries configured.
execution_tokenToken of the current execution.
report_idApplication-defined report identifier, stored verbatim.
outcome#PDCOMM_GEM_FORMATTED_PROGRAM_EXECUTION_TERMINAL_COMPLETE, #PDCOMM_GEM_FORMATTED_PROGRAM_EXECUTION_TERMINAL_FAIL, or #PDCOMM_GEM_FORMATTED_PROGRAM_EXECUTION_TERMINAL_OUTCOME_UNKNOWN.
detailApplication-defined detail bytes, copied. May be NULL when detail_length is 0.
detail_lengthLength of detail; at most the GEM SECS-II message_bytes limit.

Returns

#PDCOMM_OK on success or on an identical repeat; #PDCOMM_INVALID_ARGUMENT when endpoint or execution_token is NULL, detail is NULL with a nonzero length, the token has an invalid size, version, or reserved field, or outcome is unknown; #PDCOMM_STALE_TOKEN when the token does not identify the current execution, or a different report was already recorded; #PDCOMM_INVALID_STATE when execution tracking is not available, the state is not RUNNING, an action is pending, or COMPLETE is reported before every command was applied; #PDCOMM_LIMIT_EXCEEDED when detail is too long; #PDCOMM_BACKPRESSURE when the endpoint holds a staged TCP event; #PDCOMM_ALLOCATION_FAILED; #PDCOMM_POISONED.