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

NRD (Network Representation Data) wrapper carrying the actual IOD payload. More...

#include <protocol.h>

+ Collaboration diagram for profinet::PNNRDData:

Public Member Functions

Bytes ToBytes () const
 Serialize this wrapper and payload back to raw bytes.
 

Static Public Member Functions

static PNNRDData Parse (const Bytes &data)
 Parse an NRD wrapper and payload from raw bytes.
 

Public Attributes

std::uint32_t argsMaximumStatus = 0
 Maximum status/argument buffer size accepted by the caller.
 
std::uint32_t argsLength = 0
 Length in bytes of the arguments (usually equals ActualCount).
 
std::uint32_t maximumCount = 0
 Maximum number of bytes the caller can accept.
 
std::uint32_t offset = 0
 Byte offset into the logical result (0 unless fragmented).
 
std::uint32_t actualCount = 0
 Actual length in bytes of Payload.
 
Bytes payload
 The wrapped IOD data.
 

Static Public Attributes

static constexpr std::size_t kFixedSize = 20
 Size in bytes of the fixed portion of this wrapper.
 

Detailed Description

NRD (Network Representation Data) wrapper carrying the actual IOD payload.

On the wire, Payload follows the 20-byte fixed header directly; ActualCount records its length (mirrors protocol.py's payload_size_field="actual_count" convention).

Definition at line 694 of file protocol.h.

Member Function Documentation

◆ Parse()

static PNNRDData profinet::PNNRDData::Parse ( const Bytes data)
inlinestatic

Parse an NRD wrapper and payload from raw bytes.

Parameters
dataBytes starting at the ArgsMaximumStatus field.
Returns
The parsed wrapper.

Definition at line 720 of file protocol.h.

References actualCount, argsLength, argsMaximumStatus, kFixedSize, maximumCount, offset, payload, profinet::wire::Reader::ReadBytes(), profinet::wire::Reader::Remaining(), and profinet::wire::Reader::U32().

Referenced by profinet::rpc::RPCCon::Connect(), profinet::rpc::RPCCon::Read(), profinet::rpc::RPCCon::ReadImplicit(), profinet::rpc::RPCCon::SendControl(), profinet::rpc::RPCCon::Write(), and profinet::rpc::RPCCon::WriteMultiple().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ToBytes()

Bytes profinet::PNNRDData::ToBytes ( ) const
inline

Serialize this wrapper and payload back to raw bytes.

Returns
The encoded bytes.

Definition at line 743 of file protocol.h.

References actualCount, argsLength, argsMaximumStatus, maximumCount, offset, payload, and profinet::wire::PutU32().

Referenced by profinet::rpc::RPCCon::Connect(), profinet::rpc::RPCCon::Disconnect(), profinet::rpc::RPCCon::Read(), profinet::rpc::RPCCon::ReadImplicit(), profinet::rpc::RPCCon::SendControl(), profinet::rpc::RPCCon::Write(), and profinet::rpc::RPCCon::WriteMultiple().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ actualCount

std::uint32_t profinet::PNNRDData::actualCount = 0

Actual length in bytes of Payload.

Definition at line 709 of file protocol.h.

Referenced by profinet::rpc::RPCCon::CreateNrd(), Parse(), and ToBytes().

◆ argsLength

std::uint32_t profinet::PNNRDData::argsLength = 0

Length in bytes of the arguments (usually equals ActualCount).

Definition at line 700 of file protocol.h.

Referenced by profinet::rpc::RPCCon::CreateNrd(), Parse(), and ToBytes().

◆ argsMaximumStatus

std::uint32_t profinet::PNNRDData::argsMaximumStatus = 0

◆ kFixedSize

constexpr std::size_t profinet::PNNRDData::kFixedSize = 20
staticconstexpr

Size in bytes of the fixed portion of this wrapper.

Definition at line 715 of file protocol.h.

Referenced by Parse().

◆ maximumCount

std::uint32_t profinet::PNNRDData::maximumCount = 0

Maximum number of bytes the caller can accept.

Definition at line 703 of file protocol.h.

Referenced by profinet::rpc::RPCCon::CreateNrd(), Parse(), and ToBytes().

◆ offset

std::uint32_t profinet::PNNRDData::offset = 0

Byte offset into the logical result (0 unless fragmented).

Definition at line 706 of file protocol.h.

Referenced by profinet::rpc::RPCCon::CreateNrd(), Parse(), and ToBytes().

◆ payload


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