|
PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
|
Abstract interface for a PROFINET RPC connection. More...
#include <IRPCCon.h>
Inheritance diagram for profinet::rpc::IRPCCon:
Collaboration diagram for profinet::rpc::IRPCCon:Public Member Functions | |
| virtual | ~IRPCCon ()=default |
| Virtual destructor. | |
| virtual std::optional< ConnectResult > | Connect (std::optional< MacAddress > srcMac=std::nullopt, bool withAlarmCr=false, std::optional< IOCRSetup > iocrSetup=std::nullopt)=0 |
| Establishes an Application Relationship with the IO-Device. | |
| virtual void | Disconnect ()=0 |
| Disconnects the Application Relationship. | |
| virtual void | Close () noexcept=0 |
| Disconnects and closes the underlying RPC sockets. | |
| virtual bool | IsConnected () const =0 |
| Indicates whether the Application Relationship is established. | |
| virtual PNIODHeader | Read (std::uint32_t api, std::uint16_t slot, std::uint16_t subslot, std::uint16_t idx)=0 |
| Reads a PROFINET data record through the established AR. | |
| virtual PNIODHeader | ReadImplicit (std::uint32_t api, std::uint16_t slot, std::uint16_t subslot, std::uint16_t idx)=0 |
| Reads a PROFINET data record without an established AR. | |
| virtual void | Write (std::uint32_t api, std::uint16_t slot, std::uint16_t subslot, std::uint16_t idx, const Bytes &data)=0 |
| Writes a PROFINET data record through the established AR. | |
| virtual std::vector< blocks::WriteMultipleResult > | WriteMultiple (const std::vector< WriteItem > &writes)=0 |
| Writes multiple PROFINET records in one operation. | |
| virtual PNInM0 | ReadIm0 (std::uint16_t slot=0, std::uint16_t subslot=1)=0 |
| Reads I&M0 identification data. | |
| virtual PNInM1 | ReadIm1 (std::uint16_t slot=0, std::uint16_t subslot=1)=0 |
| Reads I&M1 tag function and location data. | |
| virtual PNInM2 | ReadIm2 (std::uint16_t slot=0, std::uint16_t subslot=1)=0 |
| Reads I&M2 installation date data. | |
| virtual PNInM3 | ReadIm3 (std::uint16_t slot=0, std::uint16_t subslot=1)=0 |
| Reads I&M3 free-text descriptor data. | |
| virtual PNInM4 | ReadIm4 (std::uint16_t slot=0, std::uint16_t subslot=1)=0 |
| Reads I&M4 PROFIsafe signature data. | |
| virtual PNInM5 | ReadIm5 (std::uint16_t slot=0, std::uint16_t subslot=1)=0 |
| Reads I&M5 free-text annotation data. | |
| virtual PNInM6 | ReadIm6 (std::uint16_t slot=0, std::uint16_t subslot=1)=0 |
| Reads I&M6 data. | |
| virtual PNInM7 | ReadIm7 (std::uint16_t slot=0, std::uint16_t subslot=1)=0 |
| Reads I&M7 data. | |
| virtual PNInM8 | ReadIm8 (std::uint16_t slot=0, std::uint16_t subslot=1)=0 |
| Reads I&M8 data. | |
| virtual PNInM9 | ReadIm9 (std::uint16_t slot=0, std::uint16_t subslot=1)=0 |
| Reads I&M9 data. | |
| virtual PNInM10 | ReadIm10 (std::uint16_t slot=0, std::uint16_t subslot=1)=0 |
| Reads I&M10 data. | |
| virtual PNInM11 | ReadIm11 (std::uint16_t slot=0, std::uint16_t subslot=1)=0 |
| Reads I&M11 data. | |
| virtual PNInM12 | ReadIm12 (std::uint16_t slot=0, std::uint16_t subslot=1)=0 |
| Reads I&M12 data. | |
| virtual PNInM13 | ReadIm13 (std::uint16_t slot=0, std::uint16_t subslot=1)=0 |
| Reads I&M13 data. | |
| virtual PNInM14 | ReadIm14 (std::uint16_t slot=0, std::uint16_t subslot=1)=0 |
| Reads I&M14 data. | |
| virtual PNInM15 | ReadIm15 (std::uint16_t slot=0, std::uint16_t subslot=1)=0 |
| Reads I&M15 data. | |
| virtual AllIM | ReadAllIm (std::uint16_t slot=0, std::uint16_t subslot=1)=0 |
| Reads all supported I&M records. | |
| virtual blocks::ModuleDiffBlock | ReadModuleDiff ()=0 |
| Reads the ModuleDiffBlock. | |
| virtual diagnosis::DiagnosisData | ReadDiagnosis (std::uint16_t slot=0, std::uint16_t subslot=0, std::uint16_t index=0xF000)=0 |
| Reads diagnosis information. | |
| virtual std::map< std::uint16_t, diagnosis::DiagnosisData > | ReadAllDiagnosis ()=0 |
| Reads diagnosis information for all standard indices. | |
| virtual blocks::PDRealData | ReadPdRealData ()=0 |
| Reads physical-device topology information. | |
| virtual blocks::RealIdentificationData | ReadRealIdentificationData ()=0 |
| Reads logical slot and subslot information. | |
| virtual std::vector< blocks::SlotInfo > | DiscoverSlots ()=0 |
| Discovers the populated device slots. | |
| virtual std::pair< blocks::PDRealData, blocks::RealIdentificationData > | DiscoverTopology ()=0 |
| Reads physical and logical topology information. | |
| virtual std::map< std::uint16_t, IndexProbeResult > | EnumerateIndices (std::uint16_t slot=0, std::uint16_t subslot=1, std::optional< std::vector< std::uint16_t > > customIndices=std::nullopt)=0 |
| Enumerates readable PROFINET record indices. | |
| virtual Bytes | PrmBegin ()=0 |
| Sends the PrmBegin control operation. | |
| virtual Bytes | PrmEnd ()=0 |
| Sends the PrmEnd control operation. | |
| virtual Bytes | ReadyForRtClass3 ()=0 |
| Sends the ReadyForRTClass3 control operation. | |
| virtual Bytes | ApplicationReady (double timeoutSec=30.0)=0 |
| Waits for and confirms the ApplicationReady request. | |
| virtual asio::io_context & | IoContext ()=0 |
| Returns the underlying Asio I/O context. | |
| virtual const dcp::DCPDeviceDescription & | Info () const =0 |
| Returns the device's DCP description. | |
| virtual std::uint16_t | LocalAlarmRef () const =0 |
| Returns the controller's local alarm reference. | |
| virtual int | DeviceAlarmRef () const =0 |
| Returns the device's alarm reference. | |
| virtual bool | HasAlarmCr () const =0 |
| Indicates whether an AlarmCR was established. | |
Abstract interface for a PROFINET RPC connection.
IRPCCon abstracts the operations exposed by RPCCon that are required by higher-level components such as ProfinetDevice.
The interface separates device-level logic from the concrete RPC transport implementation. This allows unit tests to replace the real RPCCon with a mock implementation and verify delegation, argument mapping, error handling, and connection state without communicating with a physical PROFINET IO-Device.
RPCCon is the production implementation of this interface.
|
virtualdefault |
Virtual destructor.
Ensures that derived RPC implementations can be destroyed safely through an IRPCCon pointer.
|
pure virtual |
Waits for and confirms the ApplicationReady request.
| timeoutSec | Maximum time to wait for ApplicationReady. |
| RPCTimeoutError | If ApplicationReady is not received before timeout. |
Implemented in profinet::rpc::RPCCon.
|
pure virtualnoexcept |
Disconnects and closes the underlying RPC sockets.
Releases all resources associated with the RPC connection. The operation is safe to invoke during object cleanup.
Implemented in profinet::rpc::RPCCon.
Referenced by profinet::device::ProfinetDevice::ReleaseAr().
Here is the caller graph for this function:
|
pure virtual |
Establishes an Application Relationship with the IO-Device.
| srcMac | Source MAC address of the PROFINET controller. |
| withAlarmCr | Whether an AlarmCR should also be established. |
| iocrSetup | Optional cyclic IO configuration. |
| RPCConnectionError | If the Application Relationship cannot be established. |
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Returns the device's alarm reference.
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Disconnects the Application Relationship.
Sends the PROFINET Release operation when appropriate. The operation is best-effort and does not return a response.
Implemented in profinet::rpc::RPCCon.
Referenced by profinet::device::ProfinetDevice::ReleaseAr().
Here is the caller graph for this function:
|
pure virtual |
Discovers the populated device slots.
Implemented in profinet::rpc::RPCCon.
Referenced by profinet::device::ProfinetDevice::DiscoverSlots().
Here is the caller graph for this function:
|
pure virtual |
Reads physical and logical topology information.
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Enumerates readable PROFINET record indices.
| slot | Slot number to probe. |
| subslot | Subslot number to probe. |
| customIndices | Optional list of indices to probe. |
Implemented in profinet::rpc::RPCCon.
Referenced by profinet::device::ProfinetDevice::EnumerateIndices().
Here is the caller graph for this function:
|
pure virtual |
Indicates whether an AlarmCR was established.
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Returns the device's DCP description.
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Returns the underlying Asio I/O context.
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Indicates whether the Application Relationship is established.
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Returns the controller's local alarm reference.
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Sends the PrmBegin control operation.
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Sends the PrmEnd control operation.
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Reads a PROFINET data record through the established AR.
| api | Application Process Identifier. |
| slot | Slot number. |
| subslot | Subslot number. |
| idx | Record data index. |
| PNIOError | If the device reports a PROFINET error. |
| RPCTimeoutError | If no RPC response is received before timeout. |
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Reads diagnosis information for all standard indices.
Implemented in profinet::rpc::RPCCon.
Referenced by profinet::device::ProfinetDevice::ReadAllDiagnosis().
Here is the caller graph for this function:
|
pure virtual |
Reads all supported I&M records.
| slot | Slot number. |
| subslot | Subslot number. |
Implemented in profinet::rpc::RPCCon.
Referenced by profinet::device::ProfinetDevice::ReadAllIm().
Here is the caller graph for this function:
|
pure virtual |
Reads diagnosis information.
| slot | Slot number. |
| subslot | Subslot number. |
| index | Diagnosis record index. |
Implemented in profinet::rpc::RPCCon.
Referenced by profinet::device::ProfinetDevice::ReadDiagnosis().
Here is the caller graph for this function:
|
pure virtual |
Reads I&M0 identification data.
| slot | Slot number. |
| subslot | Subslot number. |
Implemented in profinet::rpc::RPCCon.
Referenced by profinet::device::ProfinetDevice::ReadIm0().
Here is the caller graph for this function:
|
pure virtual |
Reads I&M1 tag function and location data.
| slot | Slot number. |
| subslot | Subslot number. |
Implemented in profinet::rpc::RPCCon.
Referenced by profinet::device::ProfinetDevice::ReadIm1().
Here is the caller graph for this function:
|
pure virtual |
Reads I&M10 data.
| slot | Slot number. |
| subslot | Subslot number. |
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Reads I&M11 data.
| slot | Slot number. |
| subslot | Subslot number. |
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Reads I&M12 data.
| slot | Slot number. |
| subslot | Subslot number. |
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Reads I&M13 data.
| slot | Slot number. |
| subslot | Subslot number. |
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Reads I&M14 data.
| slot | Slot number. |
| subslot | Subslot number. |
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Reads I&M15 data.
| slot | Slot number. |
| subslot | Subslot number. |
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Reads I&M2 installation date data.
| slot | Slot number. |
| subslot | Subslot number. |
Implemented in profinet::rpc::RPCCon.
Referenced by profinet::device::ProfinetDevice::ReadIm2().
Here is the caller graph for this function:
|
pure virtual |
Reads I&M3 free-text descriptor data.
| slot | Slot number. |
| subslot | Subslot number. |
Implemented in profinet::rpc::RPCCon.
Referenced by profinet::device::ProfinetDevice::ReadIm3().
Here is the caller graph for this function:
|
pure virtual |
Reads I&M4 PROFIsafe signature data.
| slot | Slot number. |
| subslot | Subslot number. |
Implemented in profinet::rpc::RPCCon.
Referenced by profinet::device::ProfinetDevice::ReadIm4().
Here is the caller graph for this function:
|
pure virtual |
Reads I&M5 free-text annotation data.
| slot | Slot number. |
| subslot | Subslot number. |
Implemented in profinet::rpc::RPCCon.
Referenced by profinet::device::ProfinetDevice::ReadIm5().
Here is the caller graph for this function:
|
pure virtual |
Reads I&M6 data.
| slot | Slot number. |
| subslot | Subslot number. |
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Reads I&M7 data.
| slot | Slot number. |
| subslot | Subslot number. |
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Reads I&M8 data.
| slot | Slot number. |
| subslot | Subslot number. |
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Reads I&M9 data.
| slot | Slot number. |
| subslot | Subslot number. |
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Reads a PROFINET data record without an established AR.
| api | Application Process Identifier. |
| slot | Slot number. |
| subslot | Subslot number. |
| idx | Record data index. |
| PNIOError | If the device reports a PROFINET error. |
| RPCTimeoutError | If no RPC response is received before timeout. |
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Reads the ModuleDiffBlock.
Implemented in profinet::rpc::RPCCon.
Referenced by profinet::device::ProfinetDevice::ReadModuleDiff().
Here is the caller graph for this function:
|
pure virtual |
Reads physical-device topology information.
Implemented in profinet::rpc::RPCCon.
Referenced by profinet::device::ProfinetDevice::ReadTopology().
Here is the caller graph for this function:
|
pure virtual |
Reads logical slot and subslot information.
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Sends the ReadyForRTClass3 control operation.
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Writes a PROFINET data record through the established AR.
| api | Application Process Identifier. |
| slot | Slot number. |
| subslot | Subslot number. |
| idx | Record data index. |
| data | Record data to write. |
| PNIOError | If the device reports a PROFINET error. |
| RPCTimeoutError | If no RPC response is received before timeout. |
Implemented in profinet::rpc::RPCCon.
|
pure virtual |
Writes multiple PROFINET records in one operation.
| writes | Records to write. |
Implemented in profinet::rpc::RPCCon.