Skip to content
Start free evaluation

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)

Declared in: #include <pdcomm_gem_alarms.h>

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

NameDescription
resultAlarm report or alarm list result.
indexZero-based entry index.
valueCaller storage; set value->struct_size before the call.
textDestination for the ALTX bytes. May be NULL only when capacity is 0.
capacitySize of text in bytes.
requiredReceives 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, and required must not overlap each other.