pdcomm_gem_result_alarm_at
Function
Reads one alarm tuple of a validated Host alarm result and copies its text.
PdcommStatus pdcomm_gem_result_alarm_at(const PdcommGemResult *result, size_t index, PdcommGemAlarmValue *value, uint8_t *text, size_t capacity, size_t *required)Index 0 is the only entry of a report; list entries keep their wire order. The text copy follows the rules of pdcomm_gem_equipment_alarm_at(): the known fields of value are cleared and *required is set to 0 first, and a short buffer receives nothing while value and *required are written.
Parameters
| Name | Description |
|---|---|
result | Alarm report or alarm list result. |
index | Zero-based entry index. |
value | Caller storage; set value->struct_size before the call. |
text | Destination for the ALTX bytes. May be NULL only when capacity is 0. |
capacity | Size of text in bytes. |
required | Receives the text length. Must not be NULL. |
Returns
#PDCOMM_OK when the entry and its text were copied; #PDCOMM_BUFFER_TOO_SMALL when capacity is smaller than the text; #PDCOMM_INVALID_ARGUMENT when result, value, or required is NULL, text is NULL with a nonzero capacity, the outputs overlap, or value->struct_size is too small; #PDCOMM_OUT_OF_RANGE when index is not less than the entry count; #PDCOMM_INVALID_STATE when result is not an alarm result; #PDCOMM_INTERNAL_ERROR when a panic was contained.
Notes
value,text, andrequiredmust not overlap each other.