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

IOD read/write request/response header (RPC body for READ/WRITE/IMPLICIT_READ). More...

#include <protocol.h>

+ Collaboration diagram for profinet::PNIODHeader:

Public Member Functions

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

Static Public Member Functions

static PNIODHeader Parse (const Bytes &data)
 Parse an IOD header and payload from raw bytes.
 

Public Attributes

std::array< std::uint8_t, blockHeaderLenghtblockHeader {}
 Nested 6-byte block header (type + length + version).
 
std::uint16_t sequenceNumber = 0
 Sequence number for tracking retries.
 
std::array< std::uint8_t, uuidLenghtarUuid {}
 AR (Application Relationship) UUID this record belongs to.
 
std::uint32_t api = 0
 API number.
 
std::uint16_t slot = 0
 Slot number.
 
std::uint16_t subslot = 0
 Subslot number.
 
std::uint16_t padding1 = 0
 Reserved/padding.
 
std::uint16_t index = 0
 Record data index being read or written.
 
std::uint32_t length = 0
 Length in bytes of Payload.
 
std::array< std::uint8_t, uuidLenghttargetArUuid {}
 Target AR UUID for AR handover scenarios (usually zero).
 
std::array< std::uint8_t, 8 > padding2 {}
 Reserved/padding.
 
Bytes payload
 Record data payload.
 

Static Public Attributes

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

Detailed Description

IOD read/write request/response header (RPC body for READ/WRITE/IMPLICIT_READ).

Definition at line 757 of file protocol.h.

Member Function Documentation

◆ Parse()

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

Parse an IOD header and payload from raw bytes.

Parameters
dataBytes starting at the BlockHeader field.
Returns
The parsed header.

Definition at line 801 of file protocol.h.

References api, arUuid, blockHeader, profinet::blockHeaderLenght, profinet::wire::Reader::Fixed(), index, kFixedSize, length, padding1, padding2, payload, profinet::wire::Reader::ReadBytes(), profinet::wire::Reader::Remaining(), sequenceNumber, slot, subslot, targetArUuid, profinet::wire::Reader::U16(), profinet::wire::Reader::U32(), and profinet::uuidLenght.

Referenced by profinet::rpc::RPCCon::Read(), and profinet::rpc::RPCCon::ReadImplicit().

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

◆ ToBytes()

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

Serialize this header and payload back to raw bytes.

Returns
The encoded bytes.

Definition at line 826 of file protocol.h.

References api, arUuid, blockHeader, index, length, padding1, padding2, payload, profinet::wire::PutFixed(), profinet::wire::PutU16(), profinet::wire::PutU32(), sequenceNumber, slot, subslot, and targetArUuid.

Referenced by profinet::rpc::RPCCon::Read(), profinet::rpc::RPCCon::ReadImplicit(), 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

◆ api

std::uint32_t profinet::PNIODHeader::api = 0

◆ arUuid

std::array<std::uint8_t, uuidLenght> profinet::PNIODHeader::arUuid {}

AR (Application Relationship) UUID this record belongs to.

Definition at line 766 of file protocol.h.

Referenced by Parse(), profinet::rpc::RPCCon::Read(), profinet::rpc::RPCCon::ReadImplicit(), ToBytes(), profinet::rpc::RPCCon::Write(), and profinet::rpc::RPCCon::WriteMultiple().

◆ blockHeader

std::array<std::uint8_t, blockHeaderLenght> profinet::PNIODHeader::blockHeader {}

Nested 6-byte block header (type + length + version).

Definition at line 760 of file protocol.h.

Referenced by Parse(), profinet::rpc::RPCCon::Read(), profinet::rpc::RPCCon::ReadImplicit(), ToBytes(), profinet::rpc::RPCCon::Write(), and profinet::rpc::RPCCon::WriteMultiple().

◆ index

std::uint16_t profinet::PNIODHeader::index = 0

◆ kFixedSize

constexpr std::size_t profinet::PNIODHeader::kFixedSize = 64
staticconstexpr

Size in bytes of the fixed portion of this header.

Definition at line 796 of file protocol.h.

Referenced by Parse().

◆ length

std::uint32_t profinet::PNIODHeader::length = 0

◆ padding1

std::uint16_t profinet::PNIODHeader::padding1 = 0

◆ padding2

std::array<std::uint8_t, 8> profinet::PNIODHeader::padding2 {}

◆ payload

◆ sequenceNumber

std::uint16_t profinet::PNIODHeader::sequenceNumber = 0

◆ slot

std::uint16_t profinet::PNIODHeader::slot = 0

◆ subslot

std::uint16_t profinet::PNIODHeader::subslot = 0

◆ targetArUuid

std::array<std::uint8_t, uuidLenght> profinet::PNIODHeader::targetArUuid {}

Target AR UUID for AR handover scenarios (usually zero).

Definition at line 787 of file protocol.h.

Referenced by Parse(), profinet::rpc::RPCCon::Read(), profinet::rpc::RPCCon::ReadImplicit(), ToBytes(), profinet::rpc::RPCCon::Write(), and profinet::rpc::RPCCon::WriteMultiple().


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