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

DCP (Discovery and Configuration Protocol) frame header. More...

#include <protocol.h>

+ Collaboration diagram for profinet::PNDCPHeader:

Public Member Functions

Bytes ToBytes () const
 Serialize this header and its block-list payload back to raw bytes.
 

Static Public Member Functions

static PNDCPHeader Parse (const Bytes &data)
 Parse a DCP header and block-list payload from raw bytes.
 

Public Attributes

DcpFrameId frameId = DcpFrameId::Unknown
 DCP frame ID identifying the service/multicast group.
 
DcpServiceId serviceId = DcpServiceId::Unknown
 DCP service ID (GET/SET/IDENTIFY/HELLO).
 
DcpServiceType serviceType = DcpServiceType::Request
 DCP service type (REQUEST/RESPONSE/...).
 
std::uint32_t xId = 0
 Transaction ID correlating requests and responses.
 
std::uint16_t respDelay = 0
 Response delay factor (requests) or reserved (responses).
 
std::uint16_t length = 0
 Length in bytes of the block list that follows.
 
Bytes payload
 DCP block list payload.
 

Static Public Attributes

static constexpr std::uint16_t ETHER_TYPE = 0x8892
 EtherType used by DCP frames.
 
static constexpr std::size_t kFixedSize = 12
 Size in bytes of the fixed portion of this header.
 

Detailed Description

DCP (Discovery and Configuration Protocol) frame header.

Definition at line 583 of file protocol.h.

Member Function Documentation

◆ Parse()

static PNDCPHeader profinet::PNDCPHeader::Parse ( const Bytes &  data)
inlinestatic

Parse a DCP header and block-list payload from raw bytes.

Parameters
dataBytes starting at the DCP frame ID field.
Returns
The parsed header.

Definition at line 617 of file protocol.h.

References frameId, kFixedSize, length, payload, profinet::wire::Reader::ReadBytes(), profinet::wire::Reader::Remaining(), respDelay, serviceId, serviceType, profinet::wire::Reader::U16(), profinet::wire::Reader::U32(), profinet::wire::Reader::U8(), and xId.

Referenced by profinet::dcp::ParseSetResponse(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), TEST_F(), TEST_F(), TEST_F(), and profinet::rpc::TEST_F().

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

◆ ToBytes()

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

Serialize this header and its block-list payload back to raw bytes.

Returns
The encoded bytes.

Definition at line 637 of file protocol.h.

References frameId, length, payload, profinet::wire::PutU16(), profinet::wire::PutU32(), profinet::wire::PutU8(), respDelay, serviceId, serviceType, and xId.

Referenced by profinet::rpc::RpcTests::MakeDcpResponseFrame(), and TEST_F().

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

Member Data Documentation

◆ ETHER_TYPE

constexpr std::uint16_t profinet::PNDCPHeader::ETHER_TYPE = 0x8892
staticconstexpr

EtherType used by DCP frames.

Definition at line 587 of file protocol.h.

◆ frameId

◆ kFixedSize

constexpr std::size_t profinet::PNDCPHeader::kFixedSize = 12
staticconstexpr

Size in bytes of the fixed portion of this header.

Definition at line 612 of file protocol.h.

Referenced by Parse(), TEST_F(), and TEST_F().

◆ length

◆ payload

◆ respDelay

◆ serviceId

◆ serviceType

◆ xId


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