PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
Loading...
Searching...
No Matches
profinet::diagnosis::AnyChannelDiagnosis Struct Reference

Any diagnosis entry (USI 0x8000, 0x8002, or 0x8003). More...

#include <diagnosis.h>

+ Collaboration diagram for profinet::diagnosis::AnyChannelDiagnosis:

Public Member Functions

bool IsChannelDiagnosis () const
 Whether this is the plain ChannelDiagnosis variant.
 
bool IsExtChannelDiagnosis () const
 Whether this is the ExtChannelDiagnosis variant.
 
bool IsQualifiedChannelDiagnosis () const
 Whether this is the QualifiedChannelDiagnosis variant.
 
bool operator== (const AnyChannelDiagnosis &) const =default
 Compares two AnyChannelDiagnosis for equality.
 

Public Attributes

Usi usi = Usi::NoIdentifier
 The USI that determined which entry type was parsed.
 
ChannelDiagnosis base
 Common fields, always populated.
 
std::optional< ExtChannelDiagnosis > ext
 Extended fields, populated only for USI 0x8002/0x8003.
 
std::optional< QualifiedChannelDiagnosis > qualified
 Qualified fields, populated only for USI 0x8003.
 

Detailed Description

Any diagnosis entry (USI 0x8000, 0x8002, or 0x8003).

Use std::visit or downcasts – the Usi field identifies which type is active (0x8000, 0x8002, 0x8003, or 0 for the base ChannelDiagnosis used for unknown USIs).

Definition at line 229 of file diagnosis.h.

Member Function Documentation

◆ IsChannelDiagnosis()

bool profinet::diagnosis::AnyChannelDiagnosis::IsChannelDiagnosis ( ) const
inline

Whether this is the plain ChannelDiagnosis variant.

Returns
True if Usi is 0x8000 or an unrecognized value (0).

Definition at line 247 of file diagnosis.h.

References profinet::Bit15OfChannelNumber, profinet::NoIdentifier, and usi.

Referenced by TEST_F().

+ Here is the caller graph for this function:

◆ IsExtChannelDiagnosis()

bool profinet::diagnosis::AnyChannelDiagnosis::IsExtChannelDiagnosis ( ) const
inline

Whether this is the ExtChannelDiagnosis variant.

Returns
True if Usi == 0x8002.

Definition at line 254 of file diagnosis.h.

References profinet::Bit15AndExternalChannelDiagnosisOfChannelNumber, and usi.

Referenced by TEST_F().

+ Here is the caller graph for this function:

◆ IsQualifiedChannelDiagnosis()

bool profinet::diagnosis::AnyChannelDiagnosis::IsQualifiedChannelDiagnosis ( ) const
inline

Whether this is the QualifiedChannelDiagnosis variant.

Returns
True if Usi == 0x8003.

Definition at line 261 of file diagnosis.h.

References profinet::Bit15AndQualifiedChannelDiagnosisOfChannelNumber, and usi.

Referenced by TEST_F().

+ Here is the caller graph for this function:

◆ operator==()

bool profinet::diagnosis::AnyChannelDiagnosis::operator== ( const AnyChannelDiagnosis &  ) const
default

Compares two AnyChannelDiagnosis for equality.

Two AnyChannelDiagnosis are equal when all scalar configuration fields are equal.

Member Data Documentation

◆ base

ChannelDiagnosis profinet::diagnosis::AnyChannelDiagnosis::base

Common fields, always populated.

For Ext/Qualified entries, the same base fields are also set on Ext and Qualified respectively.

Definition at line 237 of file diagnosis.h.

Referenced by profinet::diagnosis::ParseDiagnosisBlock(), profinet::diagnosis::ParseDiagnosisSimple(), TEST_F(), TEST_F(), and TEST_F().

◆ ext

std::optional<ExtChannelDiagnosis> profinet::diagnosis::AnyChannelDiagnosis::ext

Extended fields, populated only for USI 0x8002/0x8003.

Definition at line 240 of file diagnosis.h.

Referenced by profinet::diagnosis::ParseDiagnosisBlock().

◆ qualified

std::optional<QualifiedChannelDiagnosis> profinet::diagnosis::AnyChannelDiagnosis::qualified

Qualified fields, populated only for USI 0x8003.

Definition at line 243 of file diagnosis.h.

Referenced by profinet::diagnosis::ParseDiagnosisBlock().

◆ usi

Usi profinet::diagnosis::AnyChannelDiagnosis::usi = Usi::NoIdentifier

The documentation for this struct was generated from the following file: