354std::pair<AlarmItemVariant, std::size_t>
ParseAlarmItem(
const Bytes& data, std::size_t offset = 0);
399 std::vector<AlarmItemVariant>
items;
427 [[nodiscard]] std::string
Location()
const;
PROFINET record-data indices, block types, and protocol enumerations.
BlockType
PROFINET block types.
@ AlarmNotificationHigh
Alarm notification high block.
@ Unknown
Unknown / Initialize value.
@ AlarmNotificationLow
Alarm notification low block.
std::pair< AlarmItemVariant, std::size_t > ParseAlarmItem(const Bytes &data, std::size_t offset=0)
Parse a single alarm item starting at an offset.
AlarmNotification ParseAlarmNotification(const Bytes &data)
Parse a complete AlarmNotification PDU (BlockHeader + body + items).
AlarmType
PROFINET Alarm Types used in AlarmNotification blocks.
std::string GetUsiName(Usi usi)
Get the human-readable name for a User Structure Identifier.
std::string GetPeModeName(std::uint8_t mode)
Get the human-readable name for a PROFIenergy operational mode.
std::string UsiNameOf(const AlarmItemVariant &item)
Get the human-readable USI name for any AlarmItemVariant alternative.
Usi
PROFINET User Structure Identifiers (USI).
@ Maintenance
Maintenance item.
@ Bit0till14OfChannelNumber
The channel number (bits 0-14).
@ IParameter
iParameter item.
@ Bit15OfChannelNumber
Check diagnosis is accumulative (bit 15 of ChannelNumber).
@ PralAlarm
PRAL alarm item.
@ ExtendedChannelDiagnosis
Extended channel diagnosis.
@ Low11BitsOfRsAlarmInfo
The low 11 bits of RsAlarmInfo, so the RS specifier can be extracted from RsAlarmInfo.
@ QualifiedChannelDiagnosis
Qualified channel diagnosis.
static constexpr std::uint8_t LowByteMask
Bitmask used to isolate the lowest significant byte (8 bits) of a larger integer.
std::vector< std::uint8_t > Bytes
Generic byte buffer alias used throughout the library for raw wire data.
std::string GetAlarmTypeName(AlarmType alarmType)
Get the human-readable name for an alarm type.
Usi UsiOf(const AlarmItemVariant &item)
Get the USI shared by every AlarmItemVariant alternative.
std::variant< AlarmItem, DiagnosisItem, MaintenanceItem, UploadRetrievalItem, PEAlarmItem, RSAlarmItem, PRALAlarmItem > AlarmItemVariant
A parsed alarm payload item; the held alternative is selected by USI.
PROFINET protocol wire-format structures and serialization helpers.
Generic/unknown alarm item.
std::string UsiName() const
Human-readable name for this item's USI.
Usi userStructureId
User Structure Identifier for this item.
Bytes rawData
Raw, undecoded item payload.
Complete parsed AlarmNotification PDU: header fields + parsed items.
bool manufacturerSpecific
Whether the alarm specifier indicates a manufacturer-specific diagnosis.
std::vector< AlarmItemVariant > items
Parsed alarm items carried by this notification.
std::uint16_t slotNumber
Slot number where the alarm originated.
bool IsLowPriority() const
Whether this is a low-priority notification.
std::uint16_t alarmSequenceNumber
Sequence number extracted from the alarm specifier.
BlockType blockType
Block type (high or low priority notification).
std::uint32_t api
API number.
Bytes rawPayload
Raw, undecoded payload the items were parsed from.
std::string Location() const
Location string identifying where the alarm originated.
AlarmType alarmType
Alarm type (Diagnosis/Process/Pull/Plug/...).
std::pair< std::uint8_t, std::uint8_t > blockVersion
Block format version.
std::uint32_t submoduleIdentNumber
Submodule ident number of the affected submodule.
std::uint16_t subslotNumber
Subslot number where the alarm originated.
bool IsHighPriority() const
Whether this is a high-priority notification.
bool channelDiagnosis
Whether the alarm specifier indicates channel diagnosis is present.
std::uint32_t moduleIdentNumber
Module ident number of the affected module.
std::string AlarmTypeName() const
Human-readable name for AlarmType.
bool arDiagnosisState
Whether the alarm specifier indicates AR diagnosis state.
bool submoduleDiagnosisState
Whether the alarm specifier indicates submodule diagnosis state.
std::uint16_t extChannelErrorType
Extended channel error type code (Ext/Qualified variants only).
std::uint16_t channelProperties
Channel properties bitfield (type, direction, specifier, maintenance flags).
std::uint16_t ChannelNumberValue() const
Channel number with the accumulative bit masked off.
bool IsExtended() const
Whether this is the Ext or Qualified variant.
std::uint32_t qualifiedChannelQualifier
Qualifier bitmask (Qualified variant only).
Usi userStructureId
User Structure Identifier for this item.
bool IsAccumulative() const
Whether this diagnosis is accumulative (bit 15 of ChannelNumber).
std::string UsiName() const
Human-readable name for this item's USI.
std::uint8_t ChannelTypeValue() const
Channel type extracted from ChannelProperties.
std::uint16_t channelNumber
Channel number, with the accumulative bit packed into bit 15.
bool IsQualified() const
Whether this is the Qualified variant.
std::uint16_t channelErrorType
Channel error type code.
std::uint32_t extChannelAddValue
Extended channel additional value (Ext/Qualified variants only).
iParameter alarm item (USI 0x8201).
std::uint16_t blockVersion
Nested block version.
std::uint16_t blockType
Nested block type.
Usi userStructureId
User Structure Identifier for this item.
std::uint32_t maxSegmentSize
Maximum segment size for the transfer.
std::uint16_t blockLength
Nested block length.
std::uint32_t totalIparSize
Total iParameter data size in bytes.
std::uint32_t iParReqHeader
iParameter request header.
std::string UsiName() const
Human-readable name for this item's USI.
std::uint32_t transferIndex
Transfer index.
Maintenance alarm item (USI 0x8100).
std::uint32_t maintenanceStatus
Maintenance status bitmask.
std::string UsiName() const
Human-readable name for this item's USI.
bool MaintenanceRequired() const
Whether maintenance is required.
std::uint16_t blockLength
Nested block length.
bool MaintenanceDemanded() const
Whether maintenance is demanded (more urgent than required).
BlockType blockType
Nested block type.
Usi userStructureId
User Structure Identifier for this item.
std::uint16_t blockVersion
Nested block version.
PROFIenergy alarm item (USI 0x8310).
std::uint8_t peOperationalMode
Current PROFIenergy operational mode.
std::string ModeName() const
Human-readable name for PeOperationalMode.
Usi userStructureId
User Structure Identifier for this item.
std::string UsiName() const
Human-readable name for this item's USI.
BlockType blockType
Nested block type.
std::uint16_t blockLength
Nested block length.
std::uint16_t blockVersion
Nested block version.
Pull Request Alarm item (USI 0x8320).
std::uint16_t channelNumber
Channel number.
std::string UsiName() const
Human-readable name for this item's USI.
std::uint16_t prAlExtReason
Extended pull-request reason code.
std::uint16_t prAlReason
Pull-request reason code.
Bytes prAlReasonAddValue
Additional reason-specific data.
std::uint16_t propAlChannelProperties
Channel properties bitfield.
Usi userStructureId
User Structure Identifier for this item.
Reporting System alarm item (USI 0x8300-0x8302).
std::string UsiName() const
Human-readable name for this item's USI.
std::uint16_t RsSequenceNumber() const
RS sequence number (alias for RsSpecifier()).
std::uint16_t RsSpecifier() const
RS specifier extracted from RsAlarmInfo.
std::uint16_t rsAlarmInfo
RS alarm info bitfield.
Usi userStructureId
User Structure Identifier for this item.
Upload/Retrieval alarm item (USI 0x8200, 0x8201).
std::string UsiName() const
Human-readable name for this item's USI.
std::uint32_t urRecordIndex
Record index the upload/retrieval refers to.
bool IsUpload() const
Whether this is an upload record.
BlockType blockType
Nested block type.
bool IsRetrieval() const
Whether this is an iParameter retrieval record.
std::uint32_t urRecordLength
Record length in bytes.
Usi userStructureId
User Structure Identifier for this item.
std::uint16_t blockLength
Nested block length.
std::uint16_t blockVersion
Nested block version.