|
PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
|
DCE/RPC PDU header used to carry PROFINET connect/read/write/control requests. More...
#include <protocol.h>
Collaboration diagram for profinet::PNRPCHeader:Public Member Functions | |
| Bytes | ToBytes () const |
| Serialize this header and body back to raw bytes. | |
Static Public Member Functions | |
| static std::array< std::uint8_t, uuidLenght > | IfaceUuidDevice () |
| Interface UUID identifying the IO-Device role. | |
| static std::array< std::uint8_t, uuidLenght > | IfaceUuidController () |
| Interface UUID identifying the IO-Controller role. | |
| static std::array< std::uint8_t, uuidLenght > | IfaceUuidSupervisor () |
| Interface UUID identifying the IO-Supervisor role. | |
| static std::array< std::uint8_t, uuidLenght > | IfaceUuidParamserver () |
| Interface UUID identifying the Parameter Server role. | |
| static PNRPCHeader | Parse (const Bytes &data) |
| Parse an RPC header and body from raw bytes. | |
Public Attributes | |
| std::uint8_t | version = 4 |
| DCE/RPC version (always 4 for PROFINET). | |
| std::uint8_t | packetType = 0 |
| Packet type (REQUEST/RESPONSE/FAULT/...). | |
| std::uint8_t | flags1 = 0 |
| Packet flags, first byte. | |
| std::uint8_t | flags2 = 0 |
| Packet flags, second byte. | |
| std::array< std::uint8_t, 3 > | dataRepresentation {} |
| Data representation format label. | |
| std::uint8_t | serialNrHigh = 0 |
| High byte of the serial number. | |
| std::array< std::uint8_t, uuidLenght > | objectUuid {} |
| Target object UUID. | |
| std::array< std::uint8_t, uuidLenght > | interfaceUuid {} |
| Target interface UUID (identifies device/controller/supervisor role). | |
| std::array< std::uint8_t, uuidLenght > | activityUuid {} |
| Activity (call) UUID correlating request/response pairs. | |
| std::uint32_t | serverBootTime = 0 |
| Server boot time counter. | |
| std::uint32_t | interfaceVersion = 1 |
| Interface version. | |
| std::uint32_t | sequenceNumber = 0 |
| Sequence number within the activity. | |
| std::uint16_t | operationNumber = 0 |
| Operation number (CONNECT/RELEASE/READ/WRITE/CONTROL/IMPLICIT_READ). | |
| std::uint16_t | interfaceHint = 0xFFFF |
| Interface hint (0xFFFF if unused). | |
| std::uint16_t | activityHint = 0xFFFF |
| Activity hint (0xFFFF if unused). | |
| std::uint16_t | lengthOfBody = 0 |
| Length in bytes of Payload. | |
| std::uint16_t | fragmentNumber = 0 |
| Fragment number for fragmented PDUs. | |
| std::uint8_t | authenticationProtocol = 0 |
| Authentication protocol identifier (unused by PROFINET). | |
| std::uint8_t | serialNrLow = 0 |
| Low byte of the serial number. | |
| Bytes | payload |
| PDU body (NRD data for read/write/control, etc.). | |
Static Public Attributes | |
| static constexpr std::uint8_t | REQUEST = 0x00 |
| Packet type: REQUEST. | |
| static constexpr std::uint8_t | PING = 0x01 |
| Packet type: PING. | |
| static constexpr std::uint8_t | RESPONSE = 0x02 |
| Packet type: RESPONSE. | |
| static constexpr std::uint8_t | FAULT = 0x03 |
| Packet type: FAULT. | |
| static constexpr std::uint8_t | WORKING = 0x04 |
| Packet type: WORKING. | |
| static constexpr std::uint8_t | PONG = 0x05 |
| Packet type: PONG. | |
| static constexpr std::uint8_t | REJECT = 0x06 |
| Packet type: REJECT. | |
| static constexpr std::uint8_t | ACK = 0x07 |
| Packet type: ACK. | |
| static constexpr std::uint8_t | CANCEL = 0x08 |
| Packet type: CANCEL. | |
| static constexpr std::uint8_t | FRAG_ACK = 0x09 |
| Packet type: FRAG_ACK. | |
| static constexpr std::uint8_t | CANCEL_ACK = 0x0A |
| Packet type: CANCEL_ACK. | |
| static constexpr std::uint16_t | CONNECT = 0x00 |
| Operation number: CONNECT. | |
| static constexpr std::uint16_t | RELEASE = 0x01 |
| Operation number: RELEASE. | |
| static constexpr std::uint16_t | READ = 0x02 |
| Operation number: READ. | |
| static constexpr std::uint16_t | WRITE = 0x03 |
| Operation number: WRITE. | |
| static constexpr std::uint16_t | CONTROL = 0x04 |
| Operation number: CONTROL. | |
| static constexpr std::uint16_t | IMPLICIT_READ = 0x05 |
| Operation number: IMPLICIT_READ. | |
| static constexpr std::size_t | kFixedSize = 80 |
| Size in bytes of the fixed portion of this header. | |
Static Private Member Functions | |
| static std::array< std::uint8_t, uuidLenght > | PrefixedUuid (std::uint8_t b2, std::uint8_t b3) |
| Build a 16-byte PROFINET interface/object UUID from its two distinguishing bytes. | |
DCE/RPC PDU header used to carry PROFINET connect/read/write/control requests.
Definition at line 464 of file protocol.h.
|
inlinestatic |
Interface UUID identifying the IO-Controller role.
Definition at line 592 of file protocol.h.
References PrefixedUuid().
Here is the call graph for this function:
|
inlinestatic |
Interface UUID identifying the IO-Device role.
Definition at line 585 of file protocol.h.
References PrefixedUuid().
Referenced by profinet::rpc::RPCCon::CreateRpc().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Interface UUID identifying the Parameter Server role.
Definition at line 606 of file protocol.h.
References PrefixedUuid().
Here is the call graph for this function:
|
inlinestatic |
Interface UUID identifying the IO-Supervisor role.
Definition at line 599 of file protocol.h.
References PrefixedUuid().
Here is the call graph for this function:
|
inlinestatic |
Parse an RPC header and body from raw bytes.
| data | Bytes starting at the Version field. |
Definition at line 614 of file protocol.h.
References activityHint, activityUuid, authenticationProtocol, dataRepresentation, profinet::wire::Reader::Fixed(), flags1, flags2, fragmentNumber, interfaceHint, interfaceUuid, interfaceVersion, kFixedSize, lengthOfBody, objectUuid, operationNumber, packetType, payload, profinet::wire::Reader::ReadBytes(), profinet::wire::Reader::Remaining(), sequenceNumber, serialNrHigh, serialNrLow, serverBootTime, profinet::wire::Reader::U16(), profinet::wire::Reader::U32(), profinet::wire::Reader::U8(), profinet::uuidLenght, and version.
Referenced by profinet::rpc::RPCCon::SendReceive().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestaticprivate |
Build a 16-byte PROFINET interface/object UUID from its two distinguishing bytes.
| b2 | Third UUID byte (role selector). |
| b3 | Fourth UUID byte (role selector). |
Definition at line 678 of file protocol.h.
References profinet::kPnUuidSuffix.
Referenced by IfaceUuidController(), IfaceUuidDevice(), IfaceUuidParamserver(), and IfaceUuidSupervisor().
Here is the caller graph for this function:
|
inline |
Serialize this header and body back to raw bytes.
Definition at line 647 of file protocol.h.
References activityHint, activityUuid, authenticationProtocol, dataRepresentation, flags1, flags2, fragmentNumber, interfaceHint, interfaceUuid, interfaceVersion, lengthOfBody, objectUuid, operationNumber, packetType, payload, profinet::wire::PutFixed(), profinet::wire::PutU16(), profinet::wire::PutU32(), profinet::wire::PutU8(), sequenceNumber, serialNrHigh, serialNrLow, serverBootTime, and version.
Referenced by profinet::rpc::RPCCon::Disconnect(), profinet::rpc::RPCCon::SendControl(), and profinet::rpc::RPCCon::SendReceive().
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticconstexpr |
Packet type: ACK.
Definition at line 489 of file protocol.h.
| std::uint16_t profinet::PNRPCHeader::activityHint = 0xFFFF |
Activity hint (0xFFFF if unused).
Definition at line 563 of file protocol.h.
Referenced by profinet::rpc::RPCCon::CreateRpc(), Parse(), and ToBytes().
| std::array<std::uint8_t, uuidLenght> profinet::PNRPCHeader::activityUuid {} |
Activity (call) UUID correlating request/response pairs.
Definition at line 545 of file protocol.h.
Referenced by profinet::rpc::RPCCon::CreateRpc(), Parse(), and ToBytes().
| std::uint8_t profinet::PNRPCHeader::authenticationProtocol = 0 |
Authentication protocol identifier (unused by PROFINET).
Definition at line 572 of file protocol.h.
Referenced by profinet::rpc::RPCCon::CreateRpc(), Parse(), and ToBytes().
|
staticconstexpr |
Packet type: CANCEL.
Definition at line 492 of file protocol.h.
|
staticconstexpr |
Packet type: CANCEL_ACK.
Definition at line 498 of file protocol.h.
|
staticconstexpr |
Operation number: CONNECT.
Definition at line 501 of file protocol.h.
Referenced by profinet::rpc::RPCCon::Connect().
|
staticconstexpr |
Operation number: CONTROL.
Definition at line 513 of file protocol.h.
Referenced by profinet::rpc::RPCCon::ApplicationReady(), and profinet::rpc::RPCCon::SendControl().
| std::array<std::uint8_t, 3> profinet::PNRPCHeader::dataRepresentation {} |
Data representation format label.
Definition at line 533 of file protocol.h.
Referenced by profinet::rpc::RPCCon::CreateRpc(), Parse(), and ToBytes().
|
staticconstexpr |
Packet type: FAULT.
Definition at line 477 of file protocol.h.
Referenced by profinet::rpc::RPCCon::SendReceive().
| std::uint8_t profinet::PNRPCHeader::flags1 = 0 |
Packet flags, first byte.
Definition at line 527 of file protocol.h.
Referenced by profinet::rpc::RPCCon::CreateRpc(), Parse(), and ToBytes().
| std::uint8_t profinet::PNRPCHeader::flags2 = 0 |
Packet flags, second byte.
Definition at line 530 of file protocol.h.
Referenced by profinet::rpc::RPCCon::CreateRpc(), Parse(), and ToBytes().
|
staticconstexpr |
Packet type: FRAG_ACK.
Definition at line 495 of file protocol.h.
| std::uint16_t profinet::PNRPCHeader::fragmentNumber = 0 |
Fragment number for fragmented PDUs.
Definition at line 569 of file protocol.h.
Referenced by profinet::rpc::RPCCon::CreateRpc(), Parse(), and ToBytes().
|
staticconstexpr |
Operation number: IMPLICIT_READ.
Definition at line 516 of file protocol.h.
Referenced by profinet::rpc::RPCCon::ReadImplicit().
| std::uint16_t profinet::PNRPCHeader::interfaceHint = 0xFFFF |
Interface hint (0xFFFF if unused).
Definition at line 560 of file protocol.h.
Referenced by profinet::rpc::RPCCon::CreateRpc(), Parse(), and ToBytes().
| std::array<std::uint8_t, uuidLenght> profinet::PNRPCHeader::interfaceUuid {} |
Target interface UUID (identifies device/controller/supervisor role).
Definition at line 542 of file protocol.h.
Referenced by profinet::rpc::RPCCon::CreateRpc(), Parse(), and ToBytes().
| std::uint32_t profinet::PNRPCHeader::interfaceVersion = 1 |
Interface version.
Definition at line 551 of file protocol.h.
Referenced by profinet::rpc::RPCCon::CreateRpc(), Parse(), and ToBytes().
|
staticconstexpr |
Size in bytes of the fixed portion of this header.
Definition at line 581 of file protocol.h.
Referenced by profinet::rpc::EpmLookup(), Parse(), and profinet::rpc::RPCCon::SendReceive().
| std::uint16_t profinet::PNRPCHeader::lengthOfBody = 0 |
Length in bytes of Payload.
Definition at line 566 of file protocol.h.
Referenced by profinet::rpc::RPCCon::CreateRpc(), Parse(), and ToBytes().
| std::array<std::uint8_t, uuidLenght> profinet::PNRPCHeader::objectUuid {} |
Target object UUID.
Definition at line 539 of file protocol.h.
Referenced by profinet::rpc::RPCCon::CreateRpc(), Parse(), and ToBytes().
| std::uint16_t profinet::PNRPCHeader::operationNumber = 0 |
Operation number (CONNECT/RELEASE/READ/WRITE/CONTROL/IMPLICIT_READ).
Definition at line 557 of file protocol.h.
Referenced by profinet::rpc::RPCCon::CreateRpc(), Parse(), profinet::rpc::RPCCon::SendReceive(), and ToBytes().
| std::uint8_t profinet::PNRPCHeader::packetType = 0 |
Packet type (REQUEST/RESPONSE/FAULT/...).
Definition at line 524 of file protocol.h.
Referenced by profinet::rpc::RPCCon::CreateRpc(), Parse(), profinet::rpc::RPCCon::SendReceive(), and ToBytes().
| Bytes profinet::PNRPCHeader::payload |
PDU body (NRD data for read/write/control, etc.).
Definition at line 578 of file protocol.h.
Referenced by profinet::rpc::RPCCon::Connect(), profinet::rpc::RPCCon::CreateRpc(), Parse(), profinet::rpc::RPCCon::Read(), profinet::rpc::RPCCon::ReadImplicit(), profinet::rpc::RPCCon::SendControl(), ToBytes(), profinet::rpc::RPCCon::Write(), and profinet::rpc::RPCCon::WriteMultiple().
|
staticconstexpr |
Packet type: PING.
Definition at line 471 of file protocol.h.
|
staticconstexpr |
Packet type: PONG.
Definition at line 483 of file protocol.h.
|
staticconstexpr |
Operation number: READ.
Definition at line 507 of file protocol.h.
Referenced by profinet::rpc::RPCCon::Read().
|
staticconstexpr |
Packet type: REJECT.
Definition at line 486 of file protocol.h.
Referenced by profinet::rpc::RPCCon::SendReceive().
|
staticconstexpr |
Operation number: RELEASE.
Definition at line 504 of file protocol.h.
Referenced by profinet::rpc::RPCCon::Disconnect().
|
staticconstexpr |
Packet type: REQUEST.
Definition at line 468 of file protocol.h.
Referenced by profinet::rpc::RPCCon::ApplicationReady(), profinet::rpc::RPCCon::CreateRpc(), profinet::rpc::EpmLookup(), and profinet::rpc::RPCCon::SendReceive().
|
staticconstexpr |
Packet type: RESPONSE.
Definition at line 474 of file protocol.h.
Referenced by profinet::rpc::RPCCon::ApplicationReady(), and profinet::rpc::RPCCon::SendReceive().
| std::uint32_t profinet::PNRPCHeader::sequenceNumber = 0 |
Sequence number within the activity.
Definition at line 554 of file protocol.h.
Referenced by profinet::rpc::RPCCon::CreateRpc(), Parse(), and ToBytes().
| std::uint8_t profinet::PNRPCHeader::serialNrHigh = 0 |
High byte of the serial number.
Definition at line 536 of file protocol.h.
Referenced by profinet::rpc::RPCCon::CreateRpc(), Parse(), and ToBytes().
| std::uint8_t profinet::PNRPCHeader::serialNrLow = 0 |
Low byte of the serial number.
Definition at line 575 of file protocol.h.
Referenced by profinet::rpc::RPCCon::CreateRpc(), Parse(), and ToBytes().
| std::uint32_t profinet::PNRPCHeader::serverBootTime = 0 |
Server boot time counter.
Definition at line 548 of file protocol.h.
Referenced by profinet::rpc::RPCCon::CreateRpc(), Parse(), and ToBytes().
| std::uint8_t profinet::PNRPCHeader::version = 4 |
DCE/RPC version (always 4 for PROFINET).
Definition at line 521 of file protocol.h.
Referenced by profinet::rpc::RPCCon::CreateRpc(), Parse(), and ToBytes().
|
staticconstexpr |
Packet type: WORKING.
Definition at line 480 of file protocol.h.
|
staticconstexpr |
Operation number: WRITE.
Definition at line 510 of file protocol.h.
Referenced by profinet::rpc::RPCCon::Write(), and profinet::rpc::RPCCon::WriteMultiple().