PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
Loading...
Searching...
No Matches
indices.cpp File Reference

Implements PROFINET index, block type, and protocol value utilities. More...

#include "profinet/indices.h"
#include <cstdio>
#include <map>
#include "profinet/util.h"
+ Include dependency graph for indices.cpp:

Go to the source code of this file.

Namespaces

namespace  profinet
 

Functions

std::string profinet::GetBlockTypeName (BlockType blockType)
 Get the human-readable name for a block type.
 
std::string profinet::GetAlarmTypeName (AlarmType alarmType)
 Get the human-readable name for an alarm type.
 
std::string profinet::GetIocrTypeName (IocrType iocrType)
 Get the human-readable name for an IOCR type.
 
std::string profinet::GetIocrRtClassName (IocrRtClass rtClass)
 Get the human-readable name for an IOCR real-time class.
 
std::string profinet::GetUsiName (Usi usi)
 Get the human-readable name for a User Structure Identifier.
 
std::string profinet::GetModuleStateName (std::uint16_t state)
 Get the human-readable name for a module state.
 
std::string profinet::GetSubmoduleStateName (std::uint16_t state)
 Get the human-readable name for a submodule state.
 
std::string profinet::GetPeModeName (std::uint8_t mode)
 Get the human-readable name for a PROFIenergy operational mode.
 
const IndexNamePairsprofinet::CriticalIndices ()
 Critical indices that should always be tested.
 
const IndexNamePairsprofinet::ImIndices ()
 I&M0-I&M15 indices.
 
const IndexNamePairsprofinet::DiagnosisIndices (const std::string &scope)
 Diagnosis indices for a given addressing scope.
 
const IndexNamePairsprofinet::PortIndices ()
 Port-level indices.
 
const IndexNamePairsprofinet::InterfaceIndices ()
 Interface-level indices.
 
const IndexNamePairsprofinet::DeviceIndices ()
 Device-level indices.
 
const IndexNamePairsprofinet::AllStandardIndices ()
 Union of every standard index category.
 
std::string profinet::GetIndexName (std::uint16_t index)
 Get the human-readable name for a record data index.
 
std::string profinet::GetScope (std::uint16_t index)
 Get the addressing scope for an index.
 

Detailed Description

Implements PROFINET index, block type, and protocol value utilities.

Implements the lookup and classification functions declared in indices.h. The implementation converts PROFINET enumeration values and numeric constants into human-readable names and provides categorized tables of standardized record-data indices.

The implementation provides:

  • Human-readable names for PROFINET block types.
  • Human-readable names for alarm types.
  • Human-readable names for IOCR types and real-time classes.
  • Human-readable decoding of User Structure Identifiers (USIs), including manufacturer-specific, profile-specific, and reserved ranges.
  • Human-readable module and submodule state names.
  • Human-readable PROFIenergy operational mode names.
  • Static tables of critical, I&M, diagnosis, port, interface, and device-level indices.
  • Construction of the complete standard-index table used for record-data enumeration.
  • Range-based index-name fallback handling for unlisted indices.
  • Addressing-scope classification for record-data indices.

Lookup tables are stored as function-local static objects so that the returned IndexNamePairs references remain valid for the lifetime of the application without repeated construction.

Definition in file indices.cpp.