Skip to content
Start free evaluation

pdcomm_gem_result_status_value

Function

Copies one status variable value from an S1F4 result.

PdcommStatus pdcomm_gem_result_status_value(const PdcommGemResult *result, size_t index, uint32_t *out_id, uint8_t *id_present, PdcommSecsItem **out_item)

Declared in: #include <pdcomm_gem.h>

Only results with outcome #PDCOMM_GEM_VALUES_RECEIVED support this getter; entry_count gives the number of values. For a request with selected IDs, the values keep the request order and each one reports its requested ID. For an all-variables request, id_present is 0 because S1F4 carries no IDs. An empty List value does not prove that the variable is unknown: the equipment returns an empty List for unknown SVIDs, but a known variable can also hold one.

Parameters

NameDescription
resultLive result.
indexZero-based value index.
out_idReceives the requested SVID, or 0; set to 0 first.
id_presentReceives 1 when out_id is valid, else 0; set to 0 first.
out_itemReceives a new item that owns a copy of the value; set to NULL first.

Returns

#PDCOMM_OK on success; #PDCOMM_INVALID_ARGUMENT when any pointer is NULL; #PDCOMM_INVALID_STATE when the result outcome is not #PDCOMM_GEM_VALUES_RECEIVED; #PDCOMM_OUT_OF_RANGE when index is not less than entry_count; #PDCOMM_LIMIT_EXCEEDED, #PDCOMM_ALLOCATION_FAILED, or #PDCOMM_INTERNAL_ERROR.

Notes

  • Ownership: release the item with pdcomm_secs_destroy().
  • All outputs must be writable and must not overlap each other or the result.