|
PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
|
ExpectedSubmoduleBlockReq (0x0104) builder. More...
#include <blocks.h>
Collaboration diagram for profinet::blocks::ExpectedSubmoduleBlockReq:Public Member Functions | |
| ExpectedSubmoduleBlockReq & | AddSubmodule (std::uint32_t api, std::uint16_t slot, std::uint16_t subslot, std::uint32_t moduleIdent, std::uint32_t submoduleIdent, std::uint16_t submoduleType=0, std::uint16_t inputLength=0, std::uint16_t outputLength=0) |
| Add a single submodule. | |
| Bytes | ToBytes () const |
| Serialize the complete block to raw bytes. | |
Static Public Attributes | |
| static constexpr std::uint16_t | expectedSubmoduleBlockReqBlockType = 0x0104 |
| Block type identifier for ExpectedSubmoduleBlockReq. | |
Private Attributes | |
| std::vector< ExpectedSubmoduleAPI > | apis |
| APIs added so far, each with its own module/submodule list. | |
ExpectedSubmoduleBlockReq (0x0104) builder.
Per IEC 61158-6-10 and the Wireshark/p-net reference implementations, there is NO NumberOfDataDescriptions field: the data descriptions follow SubmoduleProperties directly, and their count is implied by SubmoduleProperties.type (NO_IO: 1 zero-length Input description; INPUT: 1 Input; OUTPUT: 1 Output; INPUT_OUTPUT: Input then Output).
Note: rpc.cpp's RPCCon::buildExpectedSubmoduleBlock() has its own simplified inline builder for the flattened rpc::IOSlot model used by RPCCon::Connect()'s cyclic-IO setup path; this class is the more general, directly-ported version and is the one to prefer for new code that needs multiple APIs or more control over module/submodule properties.
| ExpectedSubmoduleBlockReq & profinet::blocks::ExpectedSubmoduleBlockReq::AddSubmodule | ( | std::uint32_t | api, |
| std::uint16_t | slot, | ||
| std::uint16_t | subslot, | ||
| std::uint32_t | moduleIdent, | ||
| std::uint32_t | submoduleIdent, | ||
| std::uint16_t | submoduleType = 0, |
||
| std::uint16_t | inputLength = 0, |
||
| std::uint16_t | outputLength = 0 |
||
| ) |
Add a single submodule.
| api | API number. |
| slot | Slot number. |
| subslot | Subslot number. |
| moduleIdent | Expected module ident number. |
| submoduleIdent | Expected submodule ident number. |
| submoduleType | 0=NO_IO, 1=INPUT, 2=OUTPUT, or 3=INPUT_OUTPUT. |
| inputLength | Input data length in bytes (used if SubmoduleType includes INPUT). |
| outputLength | Output data length in bytes (used if SubmoduleType includes OUTPUT). |
Definition at line 860 of file blocks.cpp.
References profinet::blocks::ExpectedSubmoduleSlot::api, profinet::blocks::ExpectedSubmoduleAPI::api, apis, profinet::blocks::ExpectedSubmodule::dataDescriptions, profinet::blocks::ExpectedSubmoduleAPI::slots, profinet::blocks::ExpectedSubmodule::submoduleIdentNumber, profinet::blocks::ExpectedSubmodule::submoduleProperties, and profinet::blocks::ExpectedSubmodule::subslotNumber.
Referenced by profinet::rpc::RPCCon::BuildExpectedSubmoduleBlock(), and profinet::rpc::RPCCon::BuildUnifiedExpectedSubmoduleBlock().
Here is the caller graph for this function:| Bytes profinet::blocks::ExpectedSubmoduleBlockReq::ToBytes | ( | ) | const |
Serialize the complete block to raw bytes.
Definition at line 934 of file blocks.cpp.
References apis, expectedSubmoduleBlockReqBlockType, profinet::wire::PutU16(), and profinet::wire::PutU8().
Referenced by profinet::rpc::RPCCon::BuildExpectedSubmoduleBlock(), and profinet::rpc::RPCCon::BuildUnifiedExpectedSubmoduleBlock().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
APIs added so far, each with its own module/submodule list.
Definition at line 701 of file blocks.h.
Referenced by AddSubmodule(), and ToBytes().
|
staticconstexpr |
Block type identifier for ExpectedSubmoduleBlockReq.
Definition at line 678 of file blocks.h.
Referenced by ToBytes().