|
PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
|
Builder for IODWriteMultipleReq packets (index 0xE040). More...
#include <blocks.h>
Collaboration diagram for profinet::blocks::IODWriteMultipleBuilder:Classes | |
| struct | Write |
| One queued write operation. More... | |
Public Member Functions | |
| IODWriteMultipleBuilder (std::array< std::uint8_t, uuidLenght > arUuid, std::uint16_t seqNum=0) | |
| Construct a builder for the given AR. | |
| IODWriteMultipleBuilder & | AddWrite (std::uint16_t slot, std::uint16_t subslot, std::uint16_t index, Bytes data, std::uint32_t api=0) |
| Add a write operation. | |
| Bytes | Build () const |
| Build the complete IODWriteMultipleReq packet. | |
Static Public Attributes | |
| static constexpr std::uint16_t | writeMultipleIndex = 0xE040 |
| Record data index for WriteMultiple (0xE040). | |
| static constexpr std::uint16_t | writeMultipleBlockType = 0x0008 |
| Block type used for each nested write block. | |
Private Member Functions | |
| Bytes | BuildWriteBlock (std::uint16_t seq, std::uint32_t api, std::uint16_t slot, std::uint16_t subslot, std::uint16_t index, const Bytes &data) const |
| Serialize a single nested write block. | |
| Bytes | BuildHeader (std::size_t blocksLen) const |
| Serialize the outer IODWriteMultipleReq header. | |
Private Attributes | |
| std::array< std::uint8_t, uuidLenght > | arUuid {} |
| AR UUID the writes belong to. | |
| std::uint16_t | seqNum = 0 |
| Starting sequence number for the outer header. | |
| std::vector< Write > | writes |
| Queued write operations, in the order they'll be serialized. | |
Builder for IODWriteMultipleReq packets (index 0xE040).
Handles the 4-byte padding required between write blocks per IEC 61158-6-10.
|
inlineexplicit |
| IODWriteMultipleBuilder & profinet::blocks::IODWriteMultipleBuilder::AddWrite | ( | std::uint16_t | slot, |
| std::uint16_t | subslot, | ||
| std::uint16_t | index, | ||
| Bytes | data, | ||
| std::uint32_t | api = 0 |
||
| ) |
Add a write operation.
| slot | Slot number. |
| subslot | Subslot number. |
| index | Record data index to write. |
| data | Record data to write. |
| api | API number. |
Definition at line 667 of file blocks.cpp.
References writes.
Referenced by profinet::rpc::RPCCon::WriteMultiple().
Here is the caller graph for this function:| Bytes profinet::blocks::IODWriteMultipleBuilder::Build | ( | ) | const |
Build the complete IODWriteMultipleReq packet.
Definition at line 717 of file blocks.cpp.
References BuildHeader(), BuildWriteBlock(), and writes.
Referenced by profinet::rpc::RPCCon::WriteMultiple().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Serialize the outer IODWriteMultipleReq header.
| blocksLen | Total length in bytes of the nested write blocks. |
Definition at line 697 of file blocks.cpp.
References arUuid, profinet::wire::PutFixed(), profinet::wire::PutU16(), profinet::wire::PutU32(), profinet::wire::PutU8(), seqNum, writeMultipleBlockType, and writeMultipleIndex.
Referenced by Build().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Serialize a single nested write block.
| seq | Sequence number for this write. |
| api | API number. |
| slot | Slot number. |
| subslot | Subslot number. |
| index | Record data index to write. |
| data | Record data to write. |
Definition at line 674 of file blocks.cpp.
References arUuid, profinet::wire::PutFixed(), profinet::wire::PutU16(), profinet::wire::PutU32(), profinet::wire::PutU8(), and writeMultipleBlockType.
Referenced by Build().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
AR UUID the writes belong to.
Definition at line 536 of file blocks.h.
Referenced by BuildHeader(), and BuildWriteBlock().
|
private |
Starting sequence number for the outer header.
Definition at line 539 of file blocks.h.
Referenced by BuildHeader().
|
staticconstexpr |
Block type used for each nested write block.
Definition at line 494 of file blocks.h.
Referenced by BuildHeader(), and BuildWriteBlock().
|
staticconstexpr |
Record data index for WriteMultiple (0xE040).
Definition at line 491 of file blocks.h.
Referenced by BuildHeader(), and profinet::rpc::RPCCon::WriteMultiple().
|
private |
Queued write operations, in the order they'll be serialized.
Definition at line 557 of file blocks.h.
Referenced by AddWrite(), and Build().