12#include <gmock/gmock.h>
34 MOCK_METHOD(
void,
Start, (std::unique_ptr<IRawEthernetSocket>, std::unique_ptr<IRawEthernetSocket>), (
override));
Abstract interface for controlling cyclic PROFINET communication.
virtual Bytes GetOutputData(int slot, int subslot) const =0
Read the currently configured output data for one slot/subslot.
virtual CyclicState State() const =0
The controller's current lifecycle state.
virtual void Stop()=0
Stops cyclic PROFINET communication.
virtual std::optional< Bytes > GetInputData(int slot, int subslot, bool allowBad=false) const =0
Get the latest valid input process data.
virtual void SetOutputData(int slot, int subslot, const Bytes &data)=0
Set complete process output data for one slot/subslot.
virtual bool IsRunning() const =0
Whether the controller is actively exchanging cyclic data.
Google Mock implementation of ICyclicController.
MOCK_METHOD(std::optional< Bytes >, GetInputData,(int, int, bool),(const, override))
Mocks the State() retrieval functionality.
MOCK_METHOD(bool, IsRunning,(),(const, override))
Mocks the IsRunning() check.
MOCK_METHOD(void, SetOutputData,(int, int, const Bytes &),(override))
Mocks the State() retrieval functionality.
MOCK_METHOD(CyclicState, State,(),(const, override))
Mocks the State() retrieval functionality.
MOCK_METHOD(Bytes, GetOutputData,(int, int),(const, override))
Mocks the State() retrieval functionality.
MockCyclicController()=default
Constructs a mock cyclic controller.
MOCK_METHOD(void, Stop,(),(override))
Mocks the Stop() operation.
MOCK_METHOD(void, Start,(std::unique_ptr< IRawEthernetSocket >, std::unique_ptr< IRawEthernetSocket >),(override))
Mocks the Start() operation.
~MockCyclicController() override=default
Destroys the mock cyclic controller.
Declares the PROFINET RTC1 cyclic IO controller and process-data exchange API.
CyclicState
Lifecycle state of a CyclicController.
std::vector< std::uint8_t > Bytes
Generic byte buffer alias used throughout the library for raw wire data.