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

Test fixture for received cyclic input IOPS behavior. More...

+ Inheritance diagram for profinet::cyclic::ReceivedIopsTest:
+ Collaboration diagram for profinet::cyclic::ReceivedIopsTest:

Protected Member Functions

void SetUp () override
 
void InvokeProcessInputFrame (const Bytes &data)
 
Bytes MakePayload (const Bytes &data, std::uint8_t iops) const
 Build a cyclic payload containing input data and IOPS.
 
Bytes BuildInputFrame (const Bytes &payload) const
 Build an untagged input RT Ethernet frame.
 

Static Protected Member Functions

static std::unique_ptr< profinet::cyclic::CyclicController > MakeController ()
 Construct the cyclic controller used by the tests.
 

Protected Attributes

std::unique_ptr< CyclicController > controller
 The controller under test used to verify the private functionality.
 

Detailed Description

Test fixture for received cyclic input IOPS behavior.

Provides common controller configuration and frame-building helpers for tests covering GOOD/BAD provider status, stale input data, and transition notifications.

Definition at line 40 of file test_receivedIops.cpp.

Member Function Documentation

◆ BuildInputFrame()

Bytes profinet::cyclic::ReceivedIopsTest::BuildInputFrame ( const Bytes &  payload) const
inlineprotected

Build an untagged input RT Ethernet frame.

Parameters
payloadCyclic RT payload.
Returns
Complete Ethernet frame.

Definition at line 76 of file test_receivedIops.cpp.

References profinet::rt::RTFrame::cycleCounter, profinet::rt::RTFrame::DATA_RUN, profinet::rt::RTFrame::DATA_VALID, profinet::rt::RTFrame::dataStatus, frame, profinet::rt::RTFrame::frameId, profinet::rt::RTFrame::payload, payload, profinet::rt::RTFrame::ToBytes(), and profinet::rt::RTFrame::transferStatus.

+ Here is the call graph for this function:

◆ InvokeProcessInputFrame()

void profinet::cyclic::ReceivedIopsTest::InvokeProcessInputFrame ( const Bytes &  data)
inlineprotected

Definition at line 48 of file test_receivedIops.cpp.

References controller.

◆ MakeController()

static std::unique_ptr< profinet::cyclic::CyclicController > profinet::cyclic::ReceivedIopsTest::MakeController ( )
inlinestaticprotected

Construct the cyclic controller used by the tests.

Returns
Configured cyclic controller.

Definition at line 102 of file test_receivedIops.cpp.

References profinet::rt::IOCRConfig::dataLength, profinet::rt::IOCRConfig::frameId, ioContext, profinet::rt::IOCR_TYPE_INPUT, profinet::rt::IOCR_TYPE_OUTPUT, profinet::rt::IOCRConfig::objects, profinet::rt::IOCRConfig::reductionRatio, profinet::rt::IOCRConfig::referenceIOCR, profinet::rt::IOCRConfig::sendClockFactor, profinet::rt::IODataObject::slot, profinet::rt::IOCRConfig::typeIOCR, and profinet::rt::IOCRConfig::watchdogFactor.

Referenced by SetUp().

+ Here is the caller graph for this function:

◆ MakePayload()

Bytes profinet::cyclic::ReceivedIopsTest::MakePayload ( const Bytes &  data,
std::uint8_t  iops 
) const
inlineprotected

Build a cyclic payload containing input data and IOPS.

Parameters
dataInput data bytes.
iopsRaw IOPS byte.
Returns
Serialized cyclic payload containing input data, IOPS, and required padding.

Definition at line 63 of file test_receivedIops.cpp.

References payload.

◆ SetUp()

void profinet::cyclic::ReceivedIopsTest::SetUp ( )
inlineoverrideprotected

Definition at line 43 of file test_receivedIops.cpp.

References controller, and MakeController().

+ Here is the call graph for this function:

Member Data Documentation

◆ controller

std::unique_ptr<CyclicController> profinet::cyclic::ReceivedIopsTest::controller
protected

The controller under test used to verify the private functionality.

Definition at line 54 of file test_receivedIops.cpp.

Referenced by InvokeProcessInputFrame(), and SetUp().


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