|
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, profinet::OneOctetShift, payload, and transferStatus.
Referenced by profinet::rt::ParseEthernetFrame(), and profinet::cyclic::CyclicController::ProcessInputFrame().
Here is the caller graph for this function:
|
inline |
Whether the DataStatus station-OK bit is set.
Definition at line 253 of file rt.h.
References profinet::rt::DATA_STATUS_STATION_OK, and dataStatus.
Referenced by ToString().
Here is the caller graph for this function:
|
inline |
Whether the DataStatus state bit indicates Primary.
Definition at line 260 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 246 of file rt.h.
References profinet::rt::DATA_STATUS_PROVIDER_RUN, and dataStatus.
Referenced by ToString().
Here is the caller graph for this function:
|
inline |
Whether the DataStatus valid bit is set.
Definition at line 239 of file rt.h.
References profinet::rt::DATA_STATUS_VALID, and dataStatus.
Referenced by profinet::cyclic::CyclicController::ProcessInputFrame(), 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 32 of file rt.cpp.
References cycleCounter, dataStatus, frameId, profinet::LowByteMask, profinet::OneOctetShift, payload, and transferStatus.
Referenced by profinet::rt::BuildEthernetFrame().
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 45 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 202 of file rt.h.
Referenced by FromBytes(), profinet::cyclic::CyclicController::ProcessInputFrame(), profinet::cyclic::CyclicController::SendOutputFrame(), ToBytes(), and ToString().
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
| std::uint8_t profinet::rt::RTFrame::dataStatus = 0 |
Data status bitmask (see DATA_STATUS_* constants).
Definition at line 205 of file rt.h.
Referenced by FromBytes(), IsOk(), IsPrimary(), IsRunning(), IsValid(), profinet::cyclic::CyclicController::SendOutputFrame(), and ToBytes().
| std::uint16_t profinet::rt::RTFrame::frameId = 0 |
Frame ID identifying which IOCR this frame belongs to.
Definition at line 199 of file rt.h.
Referenced by FromBytes(), profinet::cyclic::CyclicController::ProcessInputFrame(), profinet::cyclic::CyclicController::SendOutputFrame(), ToBytes(), and ToString().
| Bytes profinet::rt::RTFrame::payload |
C_SDU payload: process data plus IOPS/IOCS trailers.
Definition at line 211 of file rt.h.
Referenced by FromBytes(), profinet::cyclic::CyclicController::ProcessInputFrame(), profinet::cyclic::CyclicController::SendOutputFrame(), ToBytes(), and ToString().
| std::uint8_t profinet::rt::RTFrame::transferStatus = 0 |
Transfer status (0 = OK).
Definition at line 208 of file rt.h.
Referenced by FromBytes(), profinet::cyclic::CyclicController::ProcessInputFrame(), profinet::cyclic::CyclicController::SendOutputFrame(), and ToBytes().