PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
Loading...
Searching...
No Matches
profinet::blocks::IODWriteMultipleBuilder Class Reference

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.
 
IODWriteMultipleBuilderAddWrite (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, uuidLenghtarUuid {}
 AR UUID the writes belong to.
 
std::uint16_t seqNum = 0
 Starting sequence number for the outer header.
 
std::vector< Writewrites
 Queued write operations, in the order they'll be serialized.
 

Detailed Description

Builder for IODWriteMultipleReq packets (index 0xE040).

Handles the 4-byte padding required between write blocks per IEC 61158-6-10.

Definition at line 487 of file blocks.h.

Constructor & Destructor Documentation

◆ IODWriteMultipleBuilder()

profinet::blocks::IODWriteMultipleBuilder::IODWriteMultipleBuilder ( std::array< std::uint8_t, uuidLenght arUuid,
std::uint16_t  seqNum = 0 
)
inlineexplicit

Construct a builder for the given AR.

Parameters
arUuidAR UUID the writes belong to.
seqNumStarting sequence number for the outer header.

Definition at line 499 of file blocks.h.

Member Function Documentation

◆ AddWrite()

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.

Parameters
slotSlot number.
subslotSubslot number.
indexRecord data index to write.
dataRecord data to write.
apiAPI number.
Returns
*this, for chaining.

Definition at line 667 of file blocks.cpp.

References writes.

Referenced by profinet::rpc::RPCCon::WriteMultiple().

+ Here is the caller graph for this function:

◆ Build()

Bytes profinet::blocks::IODWriteMultipleBuilder::Build ( ) const

Build the complete IODWriteMultipleReq packet.

Returns
The serialized packet bytes.

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:

◆ BuildHeader()

Bytes profinet::blocks::IODWriteMultipleBuilder::BuildHeader ( std::size_t  blocksLen) const
private

Serialize the outer IODWriteMultipleReq header.

Parameters
blocksLenTotal length in bytes of the nested write blocks.
Returns
The serialized header bytes.

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:

◆ BuildWriteBlock()

Bytes profinet::blocks::IODWriteMultipleBuilder::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
private

Serialize a single nested write block.

Parameters
seqSequence number for this write.
apiAPI number.
slotSlot number.
subslotSubslot number.
indexRecord data index to write.
dataRecord data to write.
Returns
The serialized block bytes.

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:

Member Data Documentation

◆ arUuid

std::array<std::uint8_t, uuidLenght> profinet::blocks::IODWriteMultipleBuilder::arUuid {}
private

AR UUID the writes belong to.

Definition at line 536 of file blocks.h.

Referenced by BuildHeader(), and BuildWriteBlock().

◆ seqNum

std::uint16_t profinet::blocks::IODWriteMultipleBuilder::seqNum = 0
private

Starting sequence number for the outer header.

Definition at line 539 of file blocks.h.

Referenced by BuildHeader().

◆ writeMultipleBlockType

constexpr std::uint16_t profinet::blocks::IODWriteMultipleBuilder::writeMultipleBlockType = 0x0008
staticconstexpr

Block type used for each nested write block.

Definition at line 494 of file blocks.h.

Referenced by BuildHeader(), and BuildWriteBlock().

◆ writeMultipleIndex

constexpr std::uint16_t profinet::blocks::IODWriteMultipleBuilder::writeMultipleIndex = 0xE040
staticconstexpr

Record data index for WriteMultiple (0xE040).

Definition at line 491 of file blocks.h.

Referenced by BuildHeader(), and profinet::rpc::RPCCon::WriteMultiple().

◆ writes

std::vector<Write> profinet::blocks::IODWriteMultipleBuilder::writes
private

Queued write operations, in the order they'll be serialized.

Definition at line 557 of file blocks.h.

Referenced by AddWrite(), and Build().


The documentation for this class was generated from the following files: