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

std::uint16_t frameId = 0
 DCP frame ID identifying the service/multicast group.
 
std::uint8_t serviceId = 0
 DCP service ID (GET/SET/IDENTIFY/HELLO).
 
std::uint8_t serviceType = 0
 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::uint8_t GET = 3
 Service ID: GET.
 
static constexpr std::uint8_t SET = 4
 Service ID: SET.
 
static constexpr std::uint8_t IDENTIFY = 5
 Service ID: IDENTIFY.
 
static constexpr std::uint8_t HELLO = 6
 Service ID: HELLO.
 
static constexpr std::uint8_t REQUEST = 0
 Service Type: REQUEST.
 
static constexpr std::uint8_t RESPONSE = 1
 Service Type: RESPONSE (success).
 
static constexpr std::uint8_t RESPONSE_UNSUPPORTED = 5
 Service Type: RESPONSE (unsupported service).
 
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 167 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 222 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().

+ 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 242 of file protocol.h.

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

+ Here is the call 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 171 of file protocol.h.

◆ frameId

◆ GET

constexpr std::uint8_t profinet::PNDCPHeader::GET = 3
staticconstexpr

Service ID: GET.

Definition at line 174 of file protocol.h.

◆ HELLO

constexpr std::uint8_t profinet::PNDCPHeader::HELLO = 6
staticconstexpr

Service ID: HELLO.

Definition at line 183 of file protocol.h.

◆ IDENTIFY

constexpr std::uint8_t profinet::PNDCPHeader::IDENTIFY = 5
staticconstexpr

Service ID: IDENTIFY.

Definition at line 180 of file protocol.h.

◆ kFixedSize

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

Size in bytes of the fixed portion of this header.

Definition at line 217 of file protocol.h.

Referenced by Parse().

◆ length

◆ payload

◆ REQUEST

constexpr std::uint8_t profinet::PNDCPHeader::REQUEST = 0
staticconstexpr

Service Type: REQUEST.

Definition at line 186 of file protocol.h.

◆ respDelay

std::uint16_t profinet::PNDCPHeader::respDelay = 0

◆ RESPONSE

constexpr std::uint8_t profinet::PNDCPHeader::RESPONSE = 1
staticconstexpr

Service Type: RESPONSE (success).

Definition at line 189 of file protocol.h.

◆ RESPONSE_UNSUPPORTED

constexpr std::uint8_t profinet::PNDCPHeader::RESPONSE_UNSUPPORTED = 5
staticconstexpr

Service Type: RESPONSE (unsupported service).

Definition at line 192 of file protocol.h.

◆ serviceId

◆ serviceType

◆ SET

constexpr std::uint8_t profinet::PNDCPHeader::SET = 4
staticconstexpr

Service ID: SET.

Definition at line 177 of file protocol.h.

◆ xId


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