pdcomm_gem_result_query_value
Function
Copies one value of a report query response.
PdcommStatus pdcomm_gem_result_query_value(const PdcommGemResult *result, size_t report_index, size_t value_index, PdcommGemQueryValueInfo *info, PdcommSecsItem **out_item)For S6F16, report_index selects the report and value_index the value in it. For S6F20 and S6F22, report_index must be 0 and value_index selects the entry. Only S6F22 entries set vid_present; duplicate VIDs keep their wire order. These responses do not accept the S6F11 acknowledgement function pdcomm_gem_host_acknowledge_event().
Parameters
| Name | Description |
|---|---|
result | Response result with outcome #PDCOMM_GEM_EVENT_QUERY_RECEIVED, #PDCOMM_GEM_INDIVIDUAL_QUERY_RECEIVED, or #PDCOMM_GEM_ANNOTATED_QUERY_RECEIVED. |
report_index | Zero-based report position (0 for S6F20 and S6F22). |
value_index | Zero-based value position. |
info | Caller storage; set info->struct_size first. Known fields are zeroed before the result is inspected. |
out_item | Receives the value item; set to NULL first. Must not be NULL or overlap info. |
Returns
#PDCOMM_OK on success; #PDCOMM_INVALID_ARGUMENT when a pointer is NULL, info is too small, or the outputs overlap; #PDCOMM_INVALID_STATE when result is a query request or not a query response; #PDCOMM_OUT_OF_RANGE when an index is out of range; #PDCOMM_INVALID_DATA, #PDCOMM_LIMIT_EXCEEDED, #PDCOMM_ALLOCATION_FAILED, or #PDCOMM_INTERNAL_ERROR. info is cleared and *out_item is NULL after every failure.
Notes
- Ownership: release the item with pdcomm_secs_destroy(). It remains valid after the result, the TCP event, and the endpoint are destroyed.