|
PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
|
A single PROFINET Real-Time cyclic frame: Frame ID + C_SDU payload + cycle counter/status trailer. More...
#include <rt.h>
Collaboration diagram for profinet::rt::RTFrame:Public Member Functions | |
| Bytes | ToBytes () const |
| Serialize this frame back to raw bytes. | |
| bool | IsValid () const |
| Whether the DataStatus valid bit is set. | |
| bool | IsRunning () const |
| Whether the DataStatus provider-run bit is set. | |
| bool | IsOk () const |
| Whether the DataStatus station-OK bit is set. | |
| bool | IsPrimary () const |
| Whether the DataStatus state bit indicates Primary. | |
| std::string | ToString () const |
| Human-readable summary of this frame, for logging/debugging. | |
Static Public Member Functions | |
| static RTFrame | FromBytes (const Bytes &data) |
| Parse an RT frame from raw bytes (after the Ethernet header). | |
Public Attributes | |
| std::uint16_t | frameId = 0 |
| Frame ID identifying which IOCR this frame belongs to. | |
| std::uint16_t | cycleCounter = 0 |
| Cycle counter, incremented each transmission. | |
| std::uint8_t | dataStatus = 0 |
| Data status bitmask (see DATA_STATUS_* constants). | |
| std::uint8_t | transferStatus = 0 |
| Transfer status (0 = OK). | |
| Bytes | payload |
| C_SDU payload: process data plus IOPS/IOCS trailers. | |
Static Public Attributes | |
| static constexpr std::uint8_t | DATA_VALID = DATA_STATUS_VALID |
| Alias for DATA_STATUS_VALID, for readability at call sites. | |
| static constexpr std::uint8_t | DATA_PRIMARY = DATA_STATUS_STATE |
| Alias for DATA_STATUS_STATE, for readability at call sites. | |
| static constexpr std::uint8_t | DATA_RUN = DATA_STATUS_PROVIDER_RUN |
| Alias for DATA_STATUS_PROVIDER_RUN, for readability at call sites. | |
| static constexpr std::uint8_t | DATA_OK = DATA_STATUS_STATION_OK |
| Alias for DATA_STATUS_STATION_OK, for readability at call sites. | |
A single PROFINET Real-Time cyclic frame: Frame ID + C_SDU payload + cycle counter/status trailer.
Parse an RT frame from raw bytes (after the Ethernet header).
| data | Bytes starting at the Frame ID field. |
Throws std::runtime_error if Data is too short (< 6 bytes).
Definition at line 14 of file rt.cpp.
References cycleCounter, dataStatus, frameId, payload, profinet::wire::Reader::ReadBytes(), profinet::wire::Reader::Remaining(), transferStatus, profinet::wire::Reader::U16(), and profinet::wire::Reader::U8().
Referenced by profinet::rt::ParseEthernetFrame(), profinet::cyclic::CyclicController::ProcessInputFrame(), profinet::TEST(), profinet::TEST(), profinet::cyclic::TEST_F(), profinet::cyclic::TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Whether the DataStatus station-OK bit is set.
Definition at line 264 of file rt.h.
References profinet::rt::DATA_STATUS_STATION_OK, and dataStatus.
Referenced by TEST_F(), and ToString().
Here is the caller graph for this function:
|
inline |
Whether the DataStatus state bit indicates Primary.
Definition at line 271 of file rt.h.
References profinet::rt::DATA_STATUS_STATE, and dataStatus.
Referenced by ToString().
Here is the caller graph for this function:
|
inline |
Whether the DataStatus provider-run bit is set.
Definition at line 257 of file rt.h.
References profinet::rt::DATA_STATUS_PROVIDER_RUN, and dataStatus.
Referenced by TEST_F(), and ToString().
Here is the caller graph for this function:
|
inline |
Whether the DataStatus valid bit is set.
Definition at line 250 of file rt.h.
References profinet::rt::DATA_STATUS_VALID, and dataStatus.
Referenced by TEST_F(), and ToString().
Here is the caller graph for this function:| Bytes profinet::rt::RTFrame::ToBytes | ( | ) | const |
Serialize this frame back to raw bytes.
Definition at line 37 of file rt.cpp.
References cycleCounter, dataStatus, frameId, payload, profinet::wire::PutBigEndian(), and transferStatus.
Referenced by profinet::rt::BuildEthernetFrame(), and profinet::cyclic::ReceivedIopsTest::BuildInputFrame().
Here is the call graph for this function:
Here is the caller graph for this function:| std::string profinet::rt::RTFrame::ToString | ( | ) | const |
Human-readable summary of this frame, for logging/debugging.
Definition at line 48 of file rt.cpp.
References cycleCounter, frameId, IsOk(), IsPrimary(), IsRunning(), IsValid(), and payload.
Here is the call graph for this function:| std::uint16_t profinet::rt::RTFrame::cycleCounter = 0 |
Cycle counter, incremented each transmission.
Definition at line 213 of file rt.h.
Referenced by profinet::cyclic::ReceivedIopsTest::BuildInputFrame(), FromBytes(), profinet::sim::TEST(), profinet::sim::TEST(), TEST_F(), ToBytes(), and ToString().
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
Alias for DATA_STATUS_PROVIDER_RUN, for readability at call sites.
Definition at line 232 of file rt.h.
Referenced by profinet::cyclic::ReceivedIopsTest::BuildInputFrame(), profinet::cyclic::CyclicDataTests::DeliverInput(), profinet::cyclic::CyclicCallbackTests::DeliverInput(), profinet::rt::RtFrameTest::MakeFrame(), and profinet::cyclic::TEST_F().
|
staticconstexpr |
Alias for DATA_STATUS_VALID, for readability at call sites.
Definition at line 226 of file rt.h.
Referenced by profinet::cyclic::ReceivedIopsTest::BuildInputFrame(), profinet::cyclic::CyclicDataTests::DeliverInput(), profinet::cyclic::CyclicCallbackTests::DeliverInput(), profinet::rt::RtFrameTest::MakeFrame(), and profinet::cyclic::TEST_F().
| std::uint8_t profinet::rt::RTFrame::dataStatus = 0 |
Data status bitmask (see DATA_STATUS_* constants).
Definition at line 216 of file rt.h.
Referenced by profinet::cyclic::ReceivedIopsTest::BuildInputFrame(), FromBytes(), IsOk(), IsPrimary(), IsRunning(), IsValid(), profinet::sim::TEST(), profinet::sim::TEST(), TEST_F(), and ToBytes().
| std::uint16_t profinet::rt::RTFrame::frameId = 0 |
Frame ID identifying which IOCR this frame belongs to.
Definition at line 210 of file rt.h.
Referenced by profinet::cyclic::ReceivedIopsTest::BuildInputFrame(), FromBytes(), profinet::rt::RtFrameTest::MakeFrame(), profinet::sim::VirtualAumaValve::SendInputFrame(), profinet::cyclic::CyclicController::SendOutputFrame(), profinet::TEST(), profinet::TEST(), profinet::sim::TEST(), profinet::sim::TEST(), profinet::sim::TEST(), profinet::sim::TEST(), profinet::sim::TEST(), profinet::sim::TEST(), profinet::sim::TEST(), profinet::sim::TEST(), TEST_F(), TEST_F(), ToBytes(), and ToString().
| Bytes profinet::rt::RTFrame::payload |
C_SDU payload: process data plus IOPS/IOCS trailers.
Definition at line 222 of file rt.h.
Referenced by profinet::cyclic::ReceivedIopsTest::BuildInputFrame(), FromBytes(), profinet::sim::TEST(), profinet::sim::TEST(), TEST_F(), ToBytes(), and ToString().
| std::uint8_t profinet::rt::RTFrame::transferStatus = 0 |
Transfer status (0 = OK).
Definition at line 219 of file rt.h.
Referenced by profinet::cyclic::ReceivedIopsTest::BuildInputFrame(), FromBytes(), profinet::sim::TEST(), and ToBytes().