Skip to content
Start free evaluation

pdcomm_gem_equipment_status_metadata

Function

Copies the name and units of a registered status variable.

PdcommStatus pdcomm_gem_equipment_status_metadata(PdcommTcpEndpoint *endpoint, uint32_t id, uint8_t *name, size_t name_capacity, size_t *name_required, uint8_t *units, size_t units_capacity, size_t *units_required)

Declared in: #include <pdcomm_gem.h>

Both lengths are reported. If either buffer is too small, neither buffer is changed. The bytes are ASCII without an added terminator.

Parameters

NameDescription
endpointLive TCP endpoint with an equipment role.
idRegistered status variable ID.
nameDestination for the name; NULL only with name_capacity 0.
name_capacitySize of name in bytes.
name_requiredReceives the name length (set to 0 first when not NULL). Must not be NULL.
unitsDestination for the units; NULL only with units_capacity 0.
units_capacitySize of units in bytes.
units_requiredReceives the units length (set to 0 first when not NULL). Must not be NULL.

Returns

#PDCOMM_OK when both strings were copied; #PDCOMM_BUFFER_TOO_SMALL when either capacity is too small (both lengths set, no buffer changed); #PDCOMM_INVALID_ARGUMENT when endpoint, name_required, or units_required is NULL, or a buffer is NULL with a nonzero capacity; #PDCOMM_OUT_OF_RANGE when id is not registered; #PDCOMM_INVALID_STATE when the endpoint has no equipment role; #PDCOMM_BACKPRESSURE when a staged TCP event exists; #PDCOMM_POISONED when the endpoint is poisoned.

Notes

  • All outputs must be writable and must not overlap each other.