|
PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
|
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, blockHeaderLength > | blockHeader {} |
| Nested 6-byte block header (type + length + version). | |
| std::uint16_t | sequenceNumber = 0 |
| Sequence number for tracking retries. | |
| std::array< std::uint8_t, uuidLenght > | arUuid {} |
| 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, uuidLenght > | targetArUuid {} |
| 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::uint16_t | kContolCommandOffset = 28U |
| ControlCommand is located at offset 28 inside PNIODControlBlockReq (Block Header: 6 bytes + ARUUID: 16 bytes + SessionKey: 2 bytes + Reserved: 4 bytes = 28 bytes) | |
| static constexpr std::size_t | kFixedSize = 64 |
| Size in bytes of the fixed portion of this header. | |
IOD read/write request/response header (RPC body for READ/WRITE/IMPLICIT_READ).
Definition at line 1189 of file protocol.h.
|
inlinestatic |
Parse an IOD header and payload from raw bytes.
| data | Bytes starting at the BlockHeader field. |
Definition at line 1237 of file protocol.h.
References api, arUuid, blockHeader, profinet::blockHeaderLength, 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 TestRpcDevice::HandleRead(), TestRpcDevice::HandleWrite(), profinet::rpc::RPCCon::Read(), profinet::rpc::RPCCon::ReadImplicit(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), and profinet::rpc::TEST_F().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Serialize this header and payload back to raw bytes.
Definition at line 1262 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 TestRpcDevice::HandleRead(), profinet::rpc::RpcTests::MakeIodResponsePayload(), 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:| std::uint32_t profinet::PNIODHeader::api = 0 |
API number.
Definition at line 1205 of file protocol.h.
Referenced by profinet::rpc::RpcTests::MakeIodResponsePayload(), Parse(), profinet::rpc::RPCCon::Read(), profinet::rpc::RPCCon::ReadImplicit(), profinet::rpc::TEST_F(), ToBytes(), profinet::rpc::RPCCon::Write(), and profinet::rpc::RPCCon::WriteMultiple().
| std::array<std::uint8_t, uuidLenght> profinet::PNIODHeader::arUuid {} |
AR (Application Relationship) UUID this record belongs to.
Definition at line 1202 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().
| std::array<std::uint8_t, blockHeaderLength> profinet::PNIODHeader::blockHeader {} |
Nested 6-byte block header (type + length + version).
Definition at line 1196 of file protocol.h.
Referenced by profinet::rpc::RpcTests::MakeIodResponsePayload(), Parse(), profinet::rpc::RPCCon::Read(), profinet::rpc::RPCCon::ReadImplicit(), ToBytes(), profinet::rpc::RPCCon::Write(), and profinet::rpc::RPCCon::WriteMultiple().
| std::uint16_t profinet::PNIODHeader::index = 0 |
Record data index being read or written.
Definition at line 1217 of file protocol.h.
Referenced by TestRpcDevice::HandleRead(), TestRpcDevice::HandleWrite(), profinet::rpc::RpcTests::MakeIodResponsePayload(), Parse(), profinet::rpc::RPCCon::Read(), profinet::rpc::RPCCon::ReadImplicit(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), ToBytes(), profinet::rpc::RPCCon::Write(), and profinet::rpc::RPCCon::WriteMultiple().
|
staticconstexpr |
ControlCommand is located at offset 28 inside PNIODControlBlockReq (Block Header: 6 bytes + ARUUID: 16 bytes + SessionKey: 2 bytes + Reserved: 4 bytes = 28 bytes)
Definition at line 1193 of file protocol.h.
Referenced by profinet::rpc::RPCCon::ApplicationReady(), and profinet::sim::VirtualProfinetRpcDevice::HandleControl().
|
staticconstexpr |
Size in bytes of the fixed portion of this header.
Definition at line 1232 of file protocol.h.
Referenced by profinet::rpc::RpcTests::MakeIodResponsePayload(), Parse(), and TEST_F().
| std::uint32_t profinet::PNIODHeader::length = 0 |
Length in bytes of Payload.
Definition at line 1220 of file protocol.h.
Referenced by TestRpcDevice::HandleRead(), profinet::rpc::RpcTests::MakeIodResponsePayload(), Parse(), profinet::rpc::RPCCon::Read(), profinet::rpc::RPCCon::ReadImplicit(), ToBytes(), profinet::rpc::RPCCon::Write(), and profinet::rpc::RPCCon::WriteMultiple().
| std::uint16_t profinet::PNIODHeader::padding1 = 0 |
Reserved/padding.
Definition at line 1214 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().
| std::array<std::uint8_t, 8> profinet::PNIODHeader::padding2 {} |
Reserved/padding.
Definition at line 1226 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().
| Bytes profinet::PNIODHeader::payload |
Record data payload.
Definition at line 1229 of file protocol.h.
Referenced by profinet::rpc::RPCCon::EnumerateIndices(), TestRpcDevice::HandleRead(), TestRpcDevice::HandleWrite(), profinet::rpc::RpcTests::MakeIodResponsePayload(), Parse(), profinet::rpc::RPCCon::ReadDiagnosis(), profinet::device::ProfinetDevice::ReadImplicit(), profinet::rpc::RPCCon::ReadModuleDiff(), profinet::rpc::RPCCon::ReadPdRealData(), profinet::rpc::RPCCon::ReadRaw(), profinet::rpc::RPCCon::ReadRealIdentificationData(), profinet::device::TEST_F(), profinet::device::TEST_F(), profinet::device::TEST_F(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), ToBytes(), profinet::rpc::RPCCon::Write(), and profinet::rpc::RPCCon::WriteMultiple().
| std::uint16_t profinet::PNIODHeader::sequenceNumber = 0 |
Sequence number for tracking retries.
Definition at line 1199 of file protocol.h.
Referenced by profinet::rpc::RpcTests::MakeIodResponsePayload(), Parse(), profinet::rpc::RPCCon::Read(), profinet::rpc::RPCCon::ReadImplicit(), ToBytes(), profinet::rpc::RPCCon::Write(), and profinet::rpc::RPCCon::WriteMultiple().
| std::uint16_t profinet::PNIODHeader::slot = 0 |
Slot number.
Definition at line 1208 of file protocol.h.
Referenced by profinet::rpc::RpcTests::MakeIodResponsePayload(), Parse(), profinet::rpc::RPCCon::Read(), profinet::rpc::RPCCon::ReadImplicit(), profinet::rpc::TEST_F(), ToBytes(), profinet::rpc::RPCCon::Write(), and profinet::rpc::RPCCon::WriteMultiple().
| std::uint16_t profinet::PNIODHeader::subslot = 0 |
Subslot number.
Definition at line 1211 of file protocol.h.
Referenced by profinet::rpc::RpcTests::MakeIodResponsePayload(), Parse(), profinet::rpc::RPCCon::Read(), profinet::rpc::RPCCon::ReadImplicit(), profinet::rpc::TEST_F(), ToBytes(), profinet::rpc::RPCCon::Write(), and profinet::rpc::RPCCon::WriteMultiple().
| std::array<std::uint8_t, uuidLenght> profinet::PNIODHeader::targetArUuid {} |
Target AR UUID for AR handover scenarios (usually zero).
Definition at line 1223 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().