pdcomm_gem_result_program_item
Function
Copies a PPID or PPBODY from a program result.
PdcommStatus pdcomm_gem_result_program_item(const PdcommGemResult *result, uint32_t field, size_t index, PdcommSecsItem **out_item)- #PDCOMM_GEM_PROGRAM_ID with
indexbelowid_countreturns a request PPID or a PPID from an S7F6 or S7F20 reply. - #PDCOMM_GEM_PROGRAM_BODY with
index0 returns the body of an S7F3 request or an S7F6 reply. For an S7F6 carrying the unknown sentinel the call returns #PDCOMM_OK with*out_itemNULL, which is distinct from a stored empty body.
Parameters
| Name | Description |
|---|---|
result | Program request or response result. |
field | #PDCOMM_GEM_PROGRAM_ID or #PDCOMM_GEM_PROGRAM_BODY. |
index | Zero-based PPID index, or 0 for the body. |
out_item | Receives a new item, or NULL as described above. Set to NULL first. Must not be NULL. |
Returns
#PDCOMM_OK on success; #PDCOMM_INVALID_ARGUMENT when out_item or result is NULL or field is unknown; #PDCOMM_INVALID_STATE when the result has no program data or the body is requested from a kind without one; #PDCOMM_OUT_OF_RANGE when index is past the PPIDs or nonzero for the body; #PDCOMM_ALLOCATION_FAILED or #PDCOMM_INTERNAL_ERROR.
Notes
- Ownership: release a non-NULL
*out_itemwith pdcomm_secs_destroy().