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)Both lengths are reported. If either buffer is too small, neither buffer is changed. The bytes are ASCII without an added terminator.
Parameters
| Name | Description |
|---|---|
endpoint | Live TCP endpoint with an equipment role. |
id | Registered status variable ID. |
name | Destination for the name; NULL only with name_capacity 0. |
name_capacity | Size of name in bytes. |
name_required | Receives the name length (set to 0 first when not NULL). Must not be NULL. |
units | Destination for the units; NULL only with units_capacity 0. |
units_capacity | Size of units in bytes. |
units_required | Receives 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.