|
PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
|
DCP response block: Option(1) + SubOption(1) + Length(2) + Status(2) + payload. More...
#include <protocol.h>
Collaboration diagram for profinet::PNDCPBlock:Public Member Functions | |
| Bytes | ToBytes () const |
| Serialize this block back to raw bytes. | |
| IPConfiguration | ParseIp () const |
| Interpret this block's payload as an IP configuration triple. | |
Static Public Member Functions | |
| static PNDCPBlock | Parse (const Bytes &data) |
| Parse a DCP response block from raw bytes. | |
Public Attributes | |
| std::uint8_t | option = 0 |
| DCP option code. | |
| std::uint8_t | suboption = 0 |
| DCP suboption code. | |
| std::uint16_t | length = 0 |
| Length in bytes of Status plus Payload (see class. | |
| std::uint16_t | status = 0 |
| Per-block status/error code. | |
| Bytes | payload |
| Block payload (excludes Status). | |
Static Public Attributes | |
| static constexpr std::pair< std::uint8_t, std::uint8_t > | IP_MAC {1, 1} |
| Block option/suboption: IP/MAC address. | |
| static constexpr std::pair< std::uint8_t, std::uint8_t > | IP_ADDRESS {1, 2} |
| Block option/suboption: IP address/netmask/gateway. | |
| static constexpr std::pair< std::uint8_t, std::uint8_t > | IP_FULL_SUITE {1, 3} |
| Block option/suboption: full IP suite. | |
| static constexpr std::pair< std::uint8_t, std::uint8_t > | DEVICE_TYPE {2, 1} |
| Block option/suboption: device type string. | |
| static constexpr std::pair< std::uint8_t, std::uint8_t > | NAME_OF_STATION {2, 2} |
| Block option/suboption: station name. | |
| static constexpr std::pair< std::uint8_t, std::uint8_t > | DEVICE_ID {2, 3} |
| Block option/suboption: vendor/device ID. | |
| static constexpr std::pair< std::uint8_t, std::uint8_t > | DEVICE_ROLE {2, 4} |
| Block option/suboption: device role bitmask. | |
| static constexpr std::pair< std::uint8_t, std::uint8_t > | DEVICE_OPTIONS {2, 5} |
| Block option/suboption: supported option list. | |
| static constexpr std::pair< std::uint8_t, std::uint8_t > | DEVICE_ALIAS {2, 6} |
| Block option/suboption: device alias name. | |
| static constexpr std::pair< std::uint8_t, std::uint8_t > | DEVICE_INSTANCE {2, 7} |
| Block option/suboption: device instance. | |
| static constexpr std::pair< std::uint8_t, std::uint8_t > | DEVICE_OEM_ID {2, 8} |
| Block option/suboption: OEM vendor/device ID. | |
| static constexpr std::pair< std::uint8_t, std::uint8_t > | ALL {0xFF, 0xFF} |
| Block option/suboption wildcard: all blocks. | |
| static constexpr std::size_t | kFixedSize = 6 |
| Size in bytes of the fixed portion of this block. | |
DCP response block: Option(1) + SubOption(1) + Length(2) + Status(2) + payload.
Length counts the 2-byte Status field plus the payload, matching protocol.py's payload_offset=-2 convention.
Definition at line 341 of file protocol.h.
|
inlinestatic |
Parse a DCP response block from raw bytes.
| data | Bytes starting at the Option field. |
Definition at line 402 of file protocol.h.
References kFixedSize, length, option, payload, profinet::wire::Reader::ReadBytes(), profinet::wire::Reader::Remaining(), status, suboption, profinet::wire::Reader::U16(), and profinet::wire::Reader::U8().
Here is the call graph for this function:
|
inline |
Interpret this block's payload as an IP configuration triple.
Throws std::runtime_error if the payload is shorter than 12 bytes.
Definition at line 438 of file protocol.h.
References payload, and profinet::String2Ip().
Here is the call graph for this function:
|
inline |
Serialize this block back to raw bytes.
Definition at line 424 of file protocol.h.
References length, option, payload, profinet::wire::PutU16(), profinet::wire::PutU8(), status, and suboption.
Here is the call graph for this function:
|
staticconstexpr |
Block option/suboption wildcard: all blocks.
Definition at line 393 of file protocol.h.
|
staticconstexpr |
Block option/suboption: device alias name.
Definition at line 384 of file protocol.h.
|
staticconstexpr |
Block option/suboption: vendor/device ID.
Definition at line 375 of file protocol.h.
|
staticconstexpr |
Block option/suboption: device instance.
Definition at line 387 of file protocol.h.
|
staticconstexpr |
Block option/suboption: OEM vendor/device ID.
Definition at line 390 of file protocol.h.
|
staticconstexpr |
Block option/suboption: supported option list.
Definition at line 381 of file protocol.h.
|
staticconstexpr |
Block option/suboption: device role bitmask.
Definition at line 378 of file protocol.h.
|
staticconstexpr |
Block option/suboption: device type string.
Definition at line 369 of file protocol.h.
|
staticconstexpr |
Block option/suboption: IP address/netmask/gateway.
Definition at line 363 of file protocol.h.
|
staticconstexpr |
Block option/suboption: full IP suite.
Definition at line 366 of file protocol.h.
|
staticconstexpr |
Block option/suboption: IP/MAC address.
Definition at line 360 of file protocol.h.
|
staticconstexpr |
Size in bytes of the fixed portion of this block.
Definition at line 397 of file protocol.h.
Referenced by Parse().
| std::uint16_t profinet::PNDCPBlock::length = 0 |
|
staticconstexpr |
Block option/suboption: station name.
Definition at line 372 of file protocol.h.
Referenced by profinet::rpc::GetStationInfo().
| std::uint8_t profinet::PNDCPBlock::option = 0 |
| Bytes profinet::PNDCPBlock::payload |
Block payload (excludes Status).
Definition at line 356 of file protocol.h.
| std::uint16_t profinet::PNDCPBlock::status = 0 |
Per-block status/error code.
Definition at line 353 of file protocol.h.
| std::uint8_t profinet::PNDCPBlock::suboption = 0 |
DCP suboption code.
Definition at line 347 of file protocol.h.