28inline constexpr std::uint16_t
RPC_PORT = 0x8894;
33inline const std::string
UUID_NULL =
"00000000-0000-0000-0000-000000000000";
35inline const std::string
UUID_EPM_V4 =
"e1af8308-5d1f-11c9-91a4-08002b14a0fa";
183 [[nodiscard]] std::vector<std::string>
Validate()
const;
231 return static_cast<Flags1>(
static_cast<std::uint8_t
>(lhs) |
static_cast<std::uint8_t
>(rhs));
240 return static_cast<Flags1>(
static_cast<std::uint8_t
>(lhs) &
static_cast<std::uint8_t
>(rhs));
249 return lhs &
static_cast<std::uint8_t
>(rhs);
258 return static_cast<std::uint8_t
>(lhs) & rhs;
267 return lhs |
static_cast<std::uint8_t
>(rhs);
276 return static_cast<std::uint8_t
>(lhs) | rhs;
285 return (flags & test) == test;
292[[nodiscard]]
constexpr bool HasFlag(std::uint8_t flags,
Flags1 test)
noexcept
294 const auto testVal =
static_cast<std::uint8_t
>(test);
295 return (flags & testVal) == testVal;
302[[nodiscard]]
constexpr bool HasFlag(
Flags1 flags, std::uint8_t test)
noexcept
304 return (
static_cast<std::uint8_t
>(flags) & test) == test;
333 std::array<std::uint8_t, 3>
drep{};
404 std::array<std::uint8_t, uuidLenght>
arUuid{};
453 std::optional<PNInM0>
im0;
455 std::optional<PNInM1>
im1;
457 std::optional<PNInM2>
im2;
459 std::optional<PNInM3>
im3;
461 std::optional<PNInM4>
im4;
463 std::optional<PNInM5>
im5;
465 std::optional<PNInM6>
im6;
467 std::optional<PNInM7>
im7;
469 std::optional<PNInM8>
im8;
471 std::optional<PNInM9>
im9;
Declares PROFINET IO connection-management block structures and wire serialization.
PROFINET DCP discovery and device configuration interface.
constexpr bool HasFlag(Flags1 flags, Flags1 test) noexcept
Checks if all flag bits in 'test' are set within 'flags'.
std::optional< RawRpcHeader > ParseRawRpcHeader(const Bytes &data)
Parses a raw network byte vector into a structured DCE/RPC v4 Connectionless Header.
constexpr Flags1 operator&(Flags1 lhs, Flags1 rhs) noexcept
Bitwise AND operator for intersecting two ApplicationReadyResponseFlags1 values.
constexpr Flags1 operator|(Flags1 lhs, Flags1 rhs) noexcept
Bitwise OR operator for combining two ApplicationReadyResponseFlags1 values.
Flags1
Represents bitwise flags for Application Ready Response header options (byte 1).
@ Fragment
Bit 2 (0x04): Packet is a fragment of a larger body.
@ Reserved0
Bit 0 (0x01): Reserved for implementation.
@ LastFragment
Bit 1 (0x02): Final fragment in the sequence.
@ Maybe
Bit 4 (0x10): No response or acknowledgment expected from server.
@ Reserved1
Bit 7 (0x80): Reserved for implementation.
@ Idempotent
Bit 5 (0x20): Activity call is idempotent (safe to retry).
@ Broadcast
Bit 6 (0x40): Packet was sent as a broadcast.
@ NoFack
Bit 3 (0x08): Do not send FACK (fragment acknowledgment) frames.
const std::string UUID_PNIO_PARAMETER_SERVER
PROFINET IO-ParameterServer interface UUID.
constexpr std::uint16_t BLOCK_IOD_CONTROL_APP_READY_REQ
Block type: IODControlReqAppReady.
constexpr std::uint16_t CONTROL_CMD_DONE
Control command bit: Done.
constexpr std::uint16_t BLOCK_PRM_BEGIN_REQ
Block type: PrmBeginReq.
const std::string UUID_PNIO_SUPERVISOR
PROFINET IO-Supervisor interface UUID.
constexpr std::uint16_t CONTROL_CMD_PRM_BEGIN
Control command bit: PrmBegin.
const std::string UUID_PNIO_CONTROLLER
PROFINET IO-Controller interface UUID.
const std::string UUID_EPM_V4
Endpoint Mapper interface UUID.
constexpr double DEFAULT_TIMEOUT
Default RPC response timeout in seconds.
constexpr std::uint16_t BLOCK_IOD_CONTROL_RT_CLASS_3_REQ
Block type: IODControlReqRTClass3.
constexpr std::uint32_t PNIO_DEVICE_INTERFACE_VERSION
Interface version used for the PNIO device interface.
constexpr std::uint16_t BLOCK_IOD_CONTROL_PRM_END_REQ
Block type: IODControlReqPrmEnd.
constexpr std::uint16_t RPC_PORT
PROFINET IO RPC port (34964).
constexpr std::uint16_t BLOCK_RELEASE_REQ
Block type: IODReleaseReq.
constexpr std::uint16_t CONTROL_CMD_RELEASE
Control command bit: Release.
constexpr std::uint16_t CONTROL_CMD_READY_FOR_COMPANION
Control command bit: ReadyForCompanion.
constexpr std::uint16_t CONTROL_CMD_PRM_END
Control command bit: PrmEnd.
const std::string UUID_NULL
Null (all-zero) DCE/RPC UUID string.
constexpr std::uint16_t RPC_BIND_PORT
PROFINET IO RPC bind port (34965).
constexpr std::uint32_t EPM_INQUIRY_ALL
EPM inquiry type: all interfaces.
const std::string UUID_PNIO_DEVICE
PROFINET IO-Device interface UUID.
constexpr double CONNECTION_TIMEOUT
Maximum idle time in seconds before an AR is considered to need re-connection.
constexpr std::uint16_t CONTROL_CMD_APP_READY
Control command bit: ApplicationReady.
constexpr std::uint32_t EPM_INQUIRY_INTERFACE
EPM inquiry type: specific interface.
constexpr std::uint16_t CONTROL_CMD_READY_FOR_RT_CLASS_3
Control command bit: ReadyForRTClass3.
constexpr std::uint16_t BLOCK_IOD_CONTROL_APP_READY_RES
Block type: IODControlResAppReady.
constexpr std::uint32_t EPM_LOOKUP
EPM operation: Lookup.
std::vector< std::uint8_t > Bytes
Generic byte buffer alias used throughout the library for raw wire data.
All I&M records a device supports, read in one call.
std::optional< PNInM7 > im7
I&M7 (reserved), if supported.
std::optional< PNInM15 > im15
I&M15 (reserved), if supported.
std::optional< PNInM9 > im9
I&M9 (reserved), if supported.
std::optional< PNInM14 > im14
I&M14 (reserved), if supported.
std::optional< PNInM1 > im1
I&M1 (tag function/location), if supported.
std::optional< PNInM5 > im5
I&M5 (free-text annotation), if supported.
std::optional< PNInM10 > im10
I&M10 (reserved), if supported.
std::optional< PNInM3 > im3
I&M3 (free-text descriptor), if supported.
std::optional< PNInM6 > im6
I&M6 (reserved), if supported.
std::optional< PNInM13 > im13
I&M13 (reserved), if supported.
std::optional< PNInM11 > im11
I&M11 (reserved), if supported.
bool operator==(const AllIM &) const =default
Compares two AllIM for equality.
std::optional< PNInM2 > im2
I&M2 (installation date), if supported.
std::optional< PNInM12 > im12
I&M12 (reserved), if supported.
std::optional< PNInM4 > im4
I&M4 (PROFIsafe signature), if supported.
std::optional< PNInM0 > im0
I&M0 (mandatory identification data).
std::optional< PNInM8 > im8
I&M8 (reserved), if supported.
bool operator==(const ApplicationRelations &) const =default
Compares two application relations for equality.
std::vector< std::uint16_t > reductionRatioTimingProperties
std::vector< std::uint16_t > sendClockTimingProperties
Result of a successful RPCCon::Connect() that also established cyclic IO.
std::array< std::uint8_t, uuidLenght > arUuid
AR UUID assigned to this connection.
bool HasCyclic() const
Whether cyclic IO was actually established.
int deviceAlarmRef
Device's local alarm reference, if an AlarmCR was also established.
std::uint16_t outputFrameId
Frame ID assigned to the output (controller -> device) IOCR.
std::uint16_t sessionKey
Session key for this connection.
std::optional< raw::RawRpcHeader > header
The DCE/RPC header.
std::uint16_t inputFrameId
Frame ID assigned to the input (device -> controller) IOCR.
Configuration for establishing cyclic IO alongside an AR.
std::uint16_t watchdogFactor
Watchdog factor (missed-frame tolerance before a timeout fault).
std::uint16_t dataHoldFactor
Data hold factor (how long to keep the last good frame's data).
std::vector< IOSlot > slots
Slots to include in the cyclic data frames.
bool operator==(const IOCRSetup &) const =default
Compares two IOCR configurations for equality.
std::vector< std::string > Validate() const
Sanity-check this configuration.
double CycleTimeMs() const
Compute the cycle time in milliseconds.
std::uint16_t reductionRatio
Reduction ratio relative to the send clock.
std::uint16_t sendClockFactor
Send clock base factor (31.25us units).
ApplicationRelations applicationRelations
std::uint32_t CycleTimeUs() const
Compute the cycle time in microseconds from SendClockFactor/ReductionRatio.
One slot/subslot's expected module configuration and IO data sizes.
bool operator==(const IOSlot &) const =default
Compares two IO slot configurations for equality.
std::uint16_t inputLength
Expected input data length in bytes (0 if no input data).
std::uint16_t slot
Slot number.
std::uint16_t outputLength
Expected output data length in bytes (0 if no output data).
std::uint32_t moduleIdent
Expected module ident number.
std::uint32_t submoduleIdent
Expected submodule ident number.
std::uint16_t subslot
Subslot number.
Result of probing one index in EnumerateIndices().
std::uint8_t errorCode1
PNIOError ErrorCode1, if the error was a PNIOError.
std::string name
Human-readable name of the index.
std::size_t size
Payload size in bytes; valid when Status == "readable".
std::uint8_t errorCode2
PNIOError ErrorCode2, if the error was a PNIOError.
std::string error
Error message; valid when Status == "error".
std::string status
Probe outcome: "readable", "empty", or "error".
Configuration options for an RPC connection.
double timeoutSec
Timeout in seconds for RPC operations.
std::uint16_t rpcPort
UDP port used for RPC communication.
A single write operation for WriteMultiple().
std::uint16_t slot
Slot number.
Bytes data
Record data to write.
std::uint32_t api
API number.
std::uint16_t subslot
Subslot number.
std::uint16_t index
Record data index to write.