|
PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
|
RTA-PDU Header - Real-Time Acyclic PDU for Layer 2 alarm transport. More...
#include <protocol.h>
Collaboration diagram for profinet::PNRTAHeader:Public Member Functions | |
| Bytes | ToBytes () const |
| Serialize this header and variable part back to raw bytes. | |
Static Public Member Functions | |
| static PNRTAHeader | Parse (const Bytes &data) |
| Parse an RTA header and variable part from raw bytes. | |
Public Attributes | |
| std::uint16_t | alarmDstEndpoint = 0 |
| Destination alarm endpoint (AlarmCR reference on the receiver). | |
| std::uint16_t | alarmSrcEndpoint = 0 |
| Source alarm endpoint (AlarmCR reference on the sender). | |
| std::uint8_t | pduType = 0 |
| PDU type and protocol version, packed as type(bits 4-7) + version(bits 0-3). | |
| std::uint8_t | addFlags = 0 |
| Additional flags (window size, TACK flag). | |
| std::uint16_t | sendSeqNum = 0 |
| Sender's sequence number for this PDU. | |
| std::uint16_t | ackSeqNum = 0 |
| Sequence number being acknowledged. | |
| std::uint16_t | variablePartLenght = 0 |
| Length in bytes of the variable part (Payload). | |
| Bytes | payload |
| RTA variable part (e.g. an AlarmNotification-PDU or AlarmAck-PDU). | |
Static Public Attributes | |
| static constexpr std::uint8_t | RTA_TYPE_DATA = 0x01 |
| PDU type: DATA. | |
| static constexpr std::uint8_t | RTA_TYPE_NACK = 0x02 |
| PDU type: NACK. | |
| static constexpr std::uint8_t | RTA_TYPE_ACK = 0x03 |
| PDU type: ACK. | |
| static constexpr std::uint8_t | RTA_TYPE_ERR = 0x04 |
| PDU type: ERR. | |
| static constexpr std::uint8_t | VERSION_1 = 0x01 |
| RTA protocol version 1. | |
| static constexpr std::uint8_t | VERSION_2 = 0x02 |
| RTA protocol version 2. | |
| static constexpr std::uint8_t | ADD_FLAGS_WINDOW_1 = 0x01 |
| RTA AddFlags bits: window size in bits 0-3. | |
| static constexpr std::uint8_t | ADD_FLAGS_TACK = 0x10 |
| TACK(transport ack request) in bit 4(IEC 61158-6-10; cf. p-net pf_put_alarm_fixed) | |
| static constexpr std::size_t | kFixedSize = 12 |
| Size in bytes of the fixed portion of this header. | |
RTA-PDU Header - Real-Time Acyclic PDU for Layer 2 alarm transport.
Definition at line 1903 of file protocol.h.
|
inlinestatic |
Parse an RTA header and variable part from raw bytes.
| data | Bytes starting at the AlarmDstEndpoint field. |
Definition at line 1962 of file protocol.h.
References ackSeqNum, addFlags, alarmDstEndpoint, alarmSrcEndpoint, kFixedSize, payload, pduType, profinet::wire::Reader::ReadBytes(), profinet::wire::Reader::Remaining(), sendSeqNum, profinet::wire::Reader::U16(), profinet::wire::Reader::U8(), and variablePartLenght.
Referenced by profinet::AlarmListener::ProcessAlarm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Serialize this header and variable part back to raw bytes.
Definition at line 1983 of file protocol.h.
References ackSeqNum, addFlags, alarmDstEndpoint, alarmSrcEndpoint, payload, pduType, profinet::wire::PutU16(), profinet::wire::PutU8(), sendSeqNum, and variablePartLenght.
Referenced by profinet::AlarmListener::SendLayer2Ack().
Here is the call graph for this function:
Here is the caller graph for this function:| std::uint16_t profinet::PNRTAHeader::ackSeqNum = 0 |
Sequence number being acknowledged.
Definition at line 1948 of file protocol.h.
Referenced by Parse(), profinet::AlarmListener::SendLayer2Ack(), and ToBytes().
|
staticconstexpr |
TACK(transport ack request) in bit 4(IEC 61158-6-10; cf. p-net pf_put_alarm_fixed)
Definition at line 1928 of file protocol.h.
Referenced by profinet::AlarmListener::ProcessAlarm(), and profinet::AlarmListener::SendLayer2Ack().
|
staticconstexpr |
RTA AddFlags bits: window size in bits 0-3.
Definition at line 1925 of file protocol.h.
Referenced by profinet::AlarmListener::SendLayer2Ack().
| std::uint8_t profinet::PNRTAHeader::addFlags = 0 |
Additional flags (window size, TACK flag).
Definition at line 1942 of file protocol.h.
Referenced by Parse(), profinet::AlarmListener::ProcessAlarm(), profinet::AlarmListener::SendLayer2Ack(), and ToBytes().
| std::uint16_t profinet::PNRTAHeader::alarmDstEndpoint = 0 |
Destination alarm endpoint (AlarmCR reference on the receiver).
Definition at line 1933 of file protocol.h.
Referenced by Parse(), profinet::AlarmListener::ProcessAlarm(), profinet::AlarmListener::SendLayer2Ack(), and ToBytes().
| std::uint16_t profinet::PNRTAHeader::alarmSrcEndpoint = 0 |
Source alarm endpoint (AlarmCR reference on the sender).
Definition at line 1936 of file protocol.h.
Referenced by Parse(), profinet::AlarmListener::SendLayer2Ack(), and ToBytes().
|
staticconstexpr |
Size in bytes of the fixed portion of this header.
Definition at line 1957 of file protocol.h.
Referenced by Parse().
| Bytes profinet::PNRTAHeader::payload |
RTA variable part (e.g. an AlarmNotification-PDU or AlarmAck-PDU).
Definition at line 1954 of file protocol.h.
| std::uint8_t profinet::PNRTAHeader::pduType = 0 |
PDU type and protocol version, packed as type(bits 4-7) + version(bits 0-3).
Definition at line 1939 of file protocol.h.
Referenced by Parse(), profinet::AlarmListener::ProcessAlarm(), profinet::AlarmListener::SendLayer2Ack(), and ToBytes().
|
staticconstexpr |
PDU type: ACK.
Definition at line 1913 of file protocol.h.
|
staticconstexpr |
PDU type: DATA.
Definition at line 1907 of file protocol.h.
Referenced by profinet::AlarmListener::SendLayer2Ack().
|
staticconstexpr |
PDU type: ERR.
Definition at line 1916 of file protocol.h.
|
staticconstexpr |
PDU type: NACK.
Definition at line 1910 of file protocol.h.
| std::uint16_t profinet::PNRTAHeader::sendSeqNum = 0 |
Sender's sequence number for this PDU.
Definition at line 1945 of file protocol.h.
Referenced by Parse(), profinet::AlarmListener::ProcessAlarm(), profinet::AlarmListener::SendLayer2Ack(), and ToBytes().
| std::uint16_t profinet::PNRTAHeader::variablePartLenght = 0 |
Length in bytes of the variable part (Payload).
Definition at line 1951 of file protocol.h.
Referenced by Parse(), profinet::AlarmListener::SendLayer2Ack(), and ToBytes().
|
staticconstexpr |
RTA protocol version 1.
Definition at line 1919 of file protocol.h.
Referenced by profinet::AlarmListener::ProcessAlarm(), and profinet::AlarmListener::SendLayer2Ack().
|
staticconstexpr |
RTA protocol version 2.
Definition at line 1922 of file protocol.h.