|
PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
|
Classes | |
| struct | AnyChannelDiagnosis |
| Any diagnosis entry (USI 0x8000, 0x8002, or 0x8003). More... | |
| struct | ChannelDiagnosis |
| ChannelDiagnosis entry (USI 0x8000). More... | |
| struct | ChannelProperties |
| Parsed ChannelProperties word (16 bits). More... | |
| struct | DiagnosisData |
| Complete diagnosis data for one slot/subslot. More... | |
| struct | ExtChannelDiagnosis |
| ExtChannelDiagnosis entry (USI 0x8002). More... | |
| struct | QualifiedChannelDiagnosis |
| QualifiedChannelDiagnosis entry (USI 0x8003). More... | |
Enumerations | |
| enum class | ChannelType : std::uint8_t { Reserved = 0 , Specific = 1 , All = 2 , Submodule = 3 } |
| Channel type, packed into ChannelProperties bits 0-1. More... | |
| enum class | ChannelAccumulative : std::uint8_t { No = 0 , MainFault = 1 , AdditionalFault = 2 } |
| Accumulative info, packed into ChannelProperties bits 2-4. More... | |
| enum class | ChannelSpecifier : std::uint8_t { AllDisappears = 0 , Appears = 1 , Disappears = 2 , DisappearsOther = 3 } |
| Diagnosis specifier, packed into ChannelProperties bits 8-10. More... | |
| enum class | ChannelDirection : std::uint8_t { Manufacturer = 0 , Input = 1 , Output = 2 , Bidirectional = 3 } |
| Data direction, packed into ChannelProperties bits 11-12. More... | |
Functions | |
| std::string | DecodeChannelErrorType (std::uint16_t errorType) |
| Decode a ChannelErrorType to a human-readable string. | |
| std::string | DecodeExtChannelErrorType (std::uint16_t channelErrorType, std::uint16_t extErrorType) |
| Decode an ExtChannelErrorType given its ChannelErrorType context. | |
| DiagnosisData | ParseDiagnosisBlock (const Bytes &data, std::uint32_t api=0, std::uint16_t slot=0, std::uint16_t subslot=0) |
| Parse a full DiagnosisData block from raw bytes. | |
| DiagnosisData | ParseDiagnosisSimple (const Bytes &data, std::uint32_t api=0, std::uint16_t slot=0, std::uint16_t subslot=0) |
| Parse a simple, fixed-format diagnosis block. | |
|
strong |
Accumulative info, packed into ChannelProperties bits 2-4.
| Enumerator | |
|---|---|
| No | Not accumulative. |
| MainFault | Main fault. |
| AdditionalFault | Additional fault. |
Definition at line 58 of file diagnosis.h.
|
strong |
Data direction, packed into ChannelProperties bits 11-12.
| Enumerator | |
|---|---|
| Manufacturer | Manufacturer-specific direction. |
| Input | Input direction. |
| Output | Output direction. |
| Bidirectional | Bidirectional. |
Definition at line 82 of file diagnosis.h.
|
strong |
Diagnosis specifier, packed into ChannelProperties bits 8-10.
| Enumerator | |
|---|---|
| AllDisappears | All diagnosis of the submodule disappears. |
| Appears | Diagnosis appears. |
| Disappears | Diagnosis disappears. |
| DisappearsOther | Diagnosis disappears but others remain. |
Definition at line 69 of file diagnosis.h.
|
strong |
Channel type, packed into ChannelProperties bits 0-1.
| Enumerator | |
|---|---|
| Reserved | Reserved value. |
| Specific | A specific, individually addressed channel. |
| All | All channels of the submodule. |
| Submodule | The whole submodule. |
Definition at line 45 of file diagnosis.h.
| std::string profinet::diagnosis::DecodeChannelErrorType | ( | std::uint16_t | errorType | ) |
Decode a ChannelErrorType to a human-readable string.
| errorType | Raw channel error type value. |
Covers standard types (0x0001-0x001F), network/system types (0x8000+), IO-Link (0x9500+) and range-based fallbacks for manufacturer-specific, reserved, and profile-specific ranges.
Definition at line 183 of file diagnosis.cpp.
References profinet::Hex4().
Referenced by ParseDiagnosisBlock(), and ParseDiagnosisSimple().
Here is the call graph for this function:
Here is the caller graph for this function:| std::string profinet::diagnosis::DecodeExtChannelErrorType | ( | std::uint16_t | channelErrorType, |
| std::uint16_t | extErrorType | ||
| ) |
Decode an ExtChannelErrorType given its ChannelErrorType context.
| channelErrorType | The channel error type this ext error type belongs to. |
| extErrorType | Raw extended channel error type value. |
Different ChannelErrorTypes have different ExtChannelErrorType tables (e.g. 0x8001 "Remote mismatch" has "Peer name of station mismatch" at ExtErrorType 0x8000, while 0x8000 "Data transmission impossible" has "Link state mismatch" at 0x8000). Falls through to a general table for error types without a dedicated ext-type map.
Definition at line 217 of file diagnosis.cpp.
References profinet::Hex4().
Referenced by ParseDiagnosisBlock().
Here is the call graph for this function:
Here is the caller graph for this function:| DiagnosisData profinet::diagnosis::ParseDiagnosisBlock | ( | const Bytes & | data, |
| std::uint32_t | api = 0, |
||
| std::uint16_t | slot = 0, |
||
| std::uint16_t | subslot = 0 |
||
| ) |
Parse a full DiagnosisData block from raw bytes.
| data | Buffer containing the diagnosis data. |
| api | Default API number, used unless a location header overrides it. |
| slot | Default slot number, used unless a location header overrides it. |
| subslot | Default subslot number, used unless a location header overrides it. |
Handles three cases:
Stops (without throwing) when data is exhausted, an entry would be truncated, or a sanity check fails – matching diagnosis.py's loop which catches ValueError and breaks.
Definition at line 248 of file diagnosis.cpp.
References profinet::diagnosis::ChannelDiagnosis::api, profinet::diagnosis::DiagnosisData::api, profinet::diagnosis::AnyChannelDiagnosis::base, profinet::diagnosis::ChannelDiagnosis::channelNumber, DecodeChannelErrorType(), DecodeExtChannelErrorType(), profinet::diagnosis::DiagnosisData::entries, profinet::diagnosis::ChannelDiagnosis::errorType, profinet::diagnosis::ChannelDiagnosis::errorTypeName, profinet::diagnosis::AnyChannelDiagnosis::ext, profinet::diagnosis::ExtChannelDiagnosis::extAddValue, profinet::diagnosis::ExtChannelDiagnosis::extErrorType, profinet::diagnosis::ExtChannelDiagnosis::extErrorTypeName, profinet::diagnosis::ChannelProperties::FromUint16(), profinet::OneOctetShift, profinet::diagnosis::ChannelDiagnosis::properties, profinet::diagnosis::AnyChannelDiagnosis::qualified, profinet::diagnosis::QualifiedChannelDiagnosis::qualifier, profinet::diagnosis::DiagnosisData::rawData, profinet::diagnosis::ChannelDiagnosis::slot, profinet::diagnosis::DiagnosisData::slot, profinet::diagnosis::ChannelDiagnosis::subslot, profinet::diagnosis::DiagnosisData::subslot, profinet::ThreeOctetsShift, profinet::TwoOctetsShift, and profinet::diagnosis::AnyChannelDiagnosis::usi.
Referenced by profinet::rpc::RPCCon::ReadDiagnosis().
Here is the call graph for this function:
Here is the caller graph for this function:| DiagnosisData profinet::diagnosis::ParseDiagnosisSimple | ( | const Bytes & | data, |
| std::uint32_t | api = 0, |
||
| std::uint16_t | slot = 0, |
||
| std::uint16_t | subslot = 0 |
||
| ) |
Parse a simple, fixed-format diagnosis block.
| data | Buffer containing the diagnosis data. |
| api | API number to attach to every parsed entry. |
| slot | Slot number to attach to every parsed entry. |
| subslot | Subslot number to attach to every parsed entry. |
Skips a 6-byte block header unconditionally, then parses raw ChannelNumber(2)+ChannelProperties(2)+ChannelErrorType(2) entries (no USI, no location sub-header) until data is exhausted or a zero-filled entry is found. Treats all entries as ChannelDiagnosis (USI 0x8000 format without the USI field itself).
Definition at line 396 of file diagnosis.cpp.
References profinet::diagnosis::ChannelDiagnosis::api, profinet::diagnosis::DiagnosisData::api, profinet::diagnosis::AnyChannelDiagnosis::base, profinet::diagnosis::ChannelDiagnosis::channelNumber, DecodeChannelErrorType(), profinet::diagnosis::DiagnosisData::entries, profinet::diagnosis::ChannelDiagnosis::errorType, profinet::diagnosis::ChannelDiagnosis::errorTypeName, profinet::diagnosis::ChannelProperties::FromUint16(), profinet::OneOctetShift, profinet::diagnosis::ChannelDiagnosis::properties, profinet::diagnosis::DiagnosisData::rawData, profinet::diagnosis::ChannelDiagnosis::slot, profinet::diagnosis::DiagnosisData::slot, profinet::diagnosis::ChannelDiagnosis::subslot, profinet::diagnosis::DiagnosisData::subslot, and profinet::diagnosis::AnyChannelDiagnosis::usi.
Referenced by profinet::rpc::RPCCon::ReadDiagnosis().
Here is the call graph for this function:
Here is the caller graph for this function: