Skip to content
Start free evaluation

pdcomm_gem_equipment_constant_at

Function

Reads one constant definition and its ID by position.

PdcommStatus pdcomm_gem_equipment_constant_at(PdcommTcpEndpoint *endpoint, size_t index, PdcommGemConstantInfo *info, PdcommSecsItem **out_id)

Declared in: #include <pdcomm_gem_constants.h>

Constants are enumerated in definition order. *out_id is set to NULL and the known fields of info are zeroed before the endpoint is inspected.

Parameters

NameDescription
endpointEquipment endpoint.
indexZero-based position.
infoCaller storage; set info->struct_size first.
out_idReceives the constant ID as a new item (numeric IDs normalized to I8 or U8). 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_OUT_OF_RANGE when index is not less than the constant count; #PDCOMM_INVALID_STATE when the endpoint is not an Equipment or has no constant store; #PDCOMM_LIMIT_EXCEEDED, #PDCOMM_ALLOCATION_FAILED, or #PDCOMM_POISONED.

Notes

  • Ownership: release *out_id with pdcomm_secs_destroy().