Skip to content
Start free evaluation

pdcomm_gem_equipment_report_at

Function

Copies one report definition of the local report store by position.

PdcommStatus pdcomm_gem_equipment_report_at(PdcommTcpEndpoint *endpoint, size_t index, uint32_t *out_id, uint32_t *variable_ids, size_t capacity, size_t *required)

Declared in: #include <pdcomm_gem_reports.h>

Reports are enumerated in stored order, from 0 to report_count - 1. *out_id and *required are set to 0 before any other check. For a valid index, *out_id receives the RPTID and *required the number of VIDs even when the array is too short; a short array is not modified.

Parameters

NameDescription
endpointEquipment endpoint with a report store.
indexZero-based report position.
out_idReceives the RPTID (0 on failure). Must not be NULL.
variable_idsDestination for the VIDs. May be NULL only when capacity is 0, which queries the count.
capacityNumber of uint32_t elements at variable_ids.
requiredReceives the number of VIDs (0 on failure). Must not be NULL.

Returns

#PDCOMM_OK when every VID was copied; #PDCOMM_BUFFER_TOO_SMALL when capacity is smaller than *required; #PDCOMM_INVALID_ARGUMENT when endpoint, out_id, or required is NULL, variable_ids is NULL with a nonzero capacity, or the output regions overlap; #PDCOMM_OUT_OF_RANGE when index is not less than the report count; #PDCOMM_BACKPRESSURE, #PDCOMM_INVALID_STATE (not an Equipment or no report store), or #PDCOMM_POISONED.

Notes

  • Outputs must be valid, aligned, and must not overlap each other.