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)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
| Name | Description |
|---|---|
endpoint | Equipment endpoint with formatted program queries configured. |
execution_token | Token of the current execution. |
report_id | Application-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. |
detail | Application-defined detail bytes, copied. May be NULL when detail_length is 0. |
detail_length | Length 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.