|
PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
|
Connection to a PROFINET IO-Device: establishes an AR (Application Relationship) and performs acyclic read/write and CONTROL operations. More...
#include <rpc.h>
Inheritance diagram for profinet::rpc::RPCCon:
Collaboration diagram for profinet::rpc::RPCCon:Public Member Functions | |
| RPCCon (RPCCon &&)=delete | |
| Deleted move constructor to prevent moving instances of this class. | |
| RPCCon & | operator= (RPCCon &&)=delete |
| Deleted move assignment operator to prevent moving instances of this class. | |
| RPCCon (const dcp::DCPDeviceDescription &info, RPCConOptions options={}) | |
| Prepare a PROFINET DCE/RPC connection object for an IO-device (does not connect yet). | |
| ~RPCCon () | |
| Disconnect (best-effort) and close the underlying sockets. | |
| RPCCon (const RPCCon &)=delete | |
| Not copyable because the connection owns non-copyable Asio sockets. | |
| RPCCon & | operator= (const RPCCon &)=delete |
| Not copyable because the connection owns non-copyable Asio sockets. | |
| std::optional< ConnectResult > | Connect (std::optional< MacAddress > srcMac=std::nullopt, bool withAlarmCr=false, std::optional< IOCRSetup > iocrSetup=std::nullopt) override |
| Establish (or re-establish) the AR with the device. | |
| PNIODHeader | Read (std::uint32_t api, std::uint16_t slot, std::uint16_t subslot, std::uint16_t idx) override |
| Read a data record via slot/subslot/index (AR must be connected). | |
| PNIODHeader | ReadImplicit (std::uint32_t api, std::uint16_t slot, std::uint16_t subslot, std::uint16_t idx) override |
| Read a data record without an established AR. | |
| void | Write (std::uint32_t api, std::uint16_t slot, std::uint16_t subslot, std::uint16_t idx, const Bytes &data) override |
| Write a data record via slot/subslot/index (AR must be connected). | |
| std::vector< blocks::WriteMultipleResult > | WriteMultiple (const std::vector< WriteItem > &writes) override |
| Write multiple records atomically via IODWriteMultipleReq (0xE040). | |
| Bytes | ReadRaw (std::uint16_t idx, std::uint16_t slot=0, std::uint16_t subslot=1) |
| Read a raw record payload by index (convenience wrapper over Read()). | |
| PNInM0 | ReadIm0 (std::uint16_t slot=0, std::uint16_t subslot=1) override |
| Read I&M0 (mandatory identification data). | |
| PNInM1 | ReadIm1 (std::uint16_t slot=0, std::uint16_t subslot=1) override |
| Read I&M1 (tag function/location). | |
| PNInM2 | ReadIm2 (std::uint16_t slot=0, std::uint16_t subslot=1) override |
| Read I&M2 (installation date). | |
| PNInM3 | ReadIm3 (std::uint16_t slot=0, std::uint16_t subslot=1) override |
| Read I&M3 (free-text descriptor). | |
| PNInM4 | ReadIm4 (std::uint16_t slot=0, std::uint16_t subslot=1) override |
| Read I&M4 (PROFIsafe signature). | |
| PNInM5 | ReadIm5 (std::uint16_t slot=0, std::uint16_t subslot=1) override |
| Read I&M5 (free-text annotation). | |
| PNInM6 | ReadIm6 (std::uint16_t slot=0, std::uint16_t subslot=1) override |
| Read I&M6 (reserved). | |
| PNInM7 | ReadIm7 (std::uint16_t slot=0, std::uint16_t subslot=1) override |
| Read I&M7 (reserved). | |
| PNInM8 | ReadIm8 (std::uint16_t slot=0, std::uint16_t subslot=1) override |
| Read I&M8 (reserved). | |
| PNInM9 | ReadIm9 (std::uint16_t slot=0, std::uint16_t subslot=1) override |
| Read I&M9 (reserved). | |
| PNInM10 | ReadIm10 (std::uint16_t slot=0, std::uint16_t subslot=1) override |
| Read I&M10 (reserved). | |
| PNInM11 | ReadIm11 (std::uint16_t slot=0, std::uint16_t subslot=1) override |
| Read I&M11 (reserved). | |
| PNInM12 | ReadIm12 (std::uint16_t slot=0, std::uint16_t subslot=1) override |
| Read I&M12 (reserved). | |
| PNInM13 | ReadIm13 (std::uint16_t slot=0, std::uint16_t subslot=1) override |
| Read I&M13 (reserved). | |
| PNInM14 | ReadIm14 (std::uint16_t slot=0, std::uint16_t subslot=1) override |
| Read I&M14 (reserved). | |
| PNInM15 | ReadIm15 (std::uint16_t slot=0, std::uint16_t subslot=1) override |
| Read I&M15 (reserved). | |
| AllIM | ReadAllIm (std::uint16_t slot=0, std::uint16_t subslot=1) override |
| Read all I&M records a device supports. | |
| blocks::ModuleDiffBlock | ReadModuleDiff () override |
| Read and parse the device's ModuleDiffBlock. | |
| diagnosis::DiagnosisData | ReadDiagnosis (std::uint16_t slot=0, std::uint16_t subslot=0, std::uint16_t index=0xF000) override |
| Read and parse diagnosis data at the given location/index. | |
| std::map< std::uint16_t, diagnosis::DiagnosisData > | ReadAllDiagnosis () override |
| Read diagnosis from all standard diagnosis indices. | |
| blocks::PDRealData | ReadPdRealData () override |
| Read and parse the device's PDRealData (physical topology). | |
| blocks::RealIdentificationData | ReadRealIdentificationData () override |
| Read and parse the device's RealIdentificationData (logical structure). | |
| std::vector< blocks::SlotInfo > | DiscoverSlots () override |
| Convenience accessor for ReadRealIdentificationData().Slots. | |
| std::pair< blocks::PDRealData, blocks::RealIdentificationData > | DiscoverTopology () override |
| Read both PDRealData and RealIdentificationData in one call. | |
| 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) override |
| Probe a set of indices and report which are readable/empty/erroring. | |
| Bytes | PrmBegin () override |
| Send PrmBegin (start of the parameterization phase). | |
| Bytes | PrmEnd () override |
| Send PrmEnd (end of the parameterization phase). | |
| Bytes | ReadyForRtClass3 () override |
| Send ReadyForRTClass3 (isochronous real-time readiness). | |
| Bytes | ApplicationReady (double timeoutSec=30.0) override |
| Wait for the device's CControl/ApplicationReady request and confirm it. | |
| void | Disconnect () override |
| Send Release to terminate the AR. | |
| void | Close () noexcept override |
| Disconnect() and close the underlying sockets. | |
| bool | IsConnected () const override |
| Whether the AR is currently established. | |
| const dcp::DCPDeviceDescription & | Info () const override |
| The device this connection targets. | |
| const std::array< std::uint8_t, uuidLenght > & | ArUuid () const |
| The AR UUID for this connection. | |
| std::uint16_t | SessionKey () const |
| The session key for this connection. | |
| std::uint16_t | LocalAlarmRef () const override |
| Controller's own local alarm reference. | |
| int | DeviceAlarmRef () const override |
| Device's local alarm reference, from AlarmCRBlockRes. | |
| bool | HasAlarmCr () const override |
| Whether an AlarmCR was successfully established. | |
| asio::io_context & | IoContext () override |
| Returns the underlying Asio I/O context. | |
Public Member Functions inherited from profinet::rpc::IRPCCon | |
| virtual | ~IRPCCon ()=default |
| Virtual destructor. | |
Private Member Functions | |
| PNRPCHeader | CreateRpc (std::uint16_t operation, const Bytes &nrd) |
| Build an RPC header for the given operation and NRD body. | |
| Bytes | BuildAlarmCrBlock (int transport=0, int priority=0) const |
| Build an AlarmCRBlockReq for inclusion in the CONNECT request. | |
| PNRPCHeader | SendReceive (const PNRPCHeader &request) |
| Send an RPC request and synchronously wait for its response. | |
| void | CloseSockets () noexcept |
| Close the RPC and CControl UDP sockets. | |
| void | CheckTimeout () |
| Reconnect if the AR has been idle longer than CONNECTION_TIMEOUT. | |
| Bytes | SendControl (BlockType blockType, ControlCommand controlCommand, bool waitResponse=true, const Bytes &subBlocks={}) |
| Send a CONTROL operation and optionally wait for its response. | |
Static Private Member Functions | |
| static PNNRDData | CreateNrd (const Bytes &payload) |
| Wrap a payload in an NRD (Network Representation Data) header. | |
| static int | ParseAlarmCrResponse (const Bytes &responseData) |
| Parse the AlarmCRBlockRes from a CONNECT response. | |
| static Bytes | BuildIocrBlock (int iocrType, int iocrReference, const IOCRSetup &setup) |
| Build an IOCRBlockReq (header + API object list) for the CONNECT request. | |
| static Bytes | BuildExpectedSubmoduleBlock (const IOCRSetup &setup) |
| Build an ExpectedSubmoduleBlockReq for the CONNECT request. | |
| static Bytes | BuildUnifiedExpectedSubmoduleBlock (const IOCRSetup &setup) |
| static std::uint16_t | ParseIocrResponse (const Bytes &responseData, int iocrType) |
| Parse an IOCRBlockRes from a CONNECT response. | |
Private Attributes | |
| dcp::DCPDeviceDescription | info |
| DCP-discovered description of the target device. | |
| double | timeout |
| Default RPC response timeout in seconds. | |
| std::array< std::uint8_t, uuidLenght > | arUuid {} |
| AR UUID for this connection. | |
| std::array< std::uint8_t, uuidLenght > | activityUuid {} |
| Activity UUID for the current RPC exchange. | |
| std::array< std::uint8_t, uuidLenght > | localObjectUuid {} |
| This controller's own object UUID. | |
| std::array< std::uint8_t, uuidLenght > | remoteObjectUuid {} |
| The target device's object UUID. | |
| bool | live = false |
| Whether the AR is currently established. | |
| std::chrono::steady_clock::time_point | liveMonotonic {} |
| Timestamp of the last successful RPC exchange, for CONNECTION_TIMEOUT tracking. | |
| std::optional< MacAddress > | srcMac |
| Source MAC address used to establish the AR. | |
| std::uint16_t | sessionKey = 0 |
| Session key for this connection. | |
| std::uint16_t | alarmRef = 0x8001 |
| Controller's own local alarm reference. | |
| int | deviceAlarmRef = 0 |
| Device's local alarm reference, if an AlarmCR was established. | |
| bool | alarmCrEnabled = false |
| Whether an AlarmCR was successfully established. | |
| std::uint32_t | sequenceNumber = 0 |
| Monotonically increasing RPC sequence number. | |
| int | iocrRefCounter = 1 |
| Counter used to allocate unique IOCR references. | |
| int | inputIocrRef = 0 |
| IOCR reference for the input (device -> controller) IOCR. | |
| int | outputIocrRef = 0 |
| IOCR reference for the output (controller -> device) IOCR. | |
| std::uint16_t | inputFrameId = 0 |
| Frame ID assigned to the input IOCR. | |
| std::uint16_t | outputFrameId = 0 |
| Frame ID assigned to the output IOCR. | |
| std::optional< IOCRSetup > | iocrSetup |
| Cyclic IO configuration used for the current AR, if any. | |
| asio::io_context | ioContext {} |
| Asio execution context used by the RPC transport. | |
| std::unique_ptr< RpcTransport > | rpcTransport |
| std::unique_ptr< RpcTransport > | ccontrolTransport |
Friends | |
| class | RpcTest |
| FRIEND_CLASS declaration granting access to the specific test case for validating CreateRpc. | |
Connection to a PROFINET IO-Device: establishes an AR (Application Relationship) and performs acyclic read/write and CONTROL operations.
Example:
|
delete |
Deleted move constructor to prevent moving instances of this class.
|
explicit |
Prepare a PROFINET DCE/RPC connection object for an IO-device (does not connect yet).
The constructor initializes the Asio UDP transports but does not establish a PROFINET Application Relationship. The AR is established by Connect().
| info | DCP-discovered description of the target device. |
| options | A configured RPCConOption in which you can set timeoutSec, Default RPC response timeout. |
Definition at line 652 of file rpc.cpp.
References activityUuid, arUuid, ccontrolTransport, profinet::dcp::DCPDeviceDescription::deviceHigh, profinet::dcp::DCPDeviceDescription::deviceLow, info, profinet::dcp::DCPDeviceDescription::ip, localObjectUuid, remoteObjectUuid, profinet::rpc::RPCConOptions::rpcPort, rpcTransport, profinet::dcp::DCPDeviceDescription::vendorHigh, and profinet::dcp::DCPDeviceDescription::vendorLow.
| profinet::rpc::RPCCon::~RPCCon | ( | ) |
|
delete |
Not copyable because the connection owns non-copyable Asio sockets.
|
overridevirtual |
Wait for the device's CControl/ApplicationReady request and confirm it.
| timeoutSec | How long to wait for the request. |
Sent by the device after PrmEnd. Throws RPCTimeoutError if nothing arrives within TimeoutSec.
Implements profinet::rpc::IRPCCon.
Definition at line 3306 of file rpc.cpp.
References profinet::PNIODReleaseBlock::arUuid, arUuid, profinet::rpc::BLOCK_IOD_CONTROL_APP_READY_REQ, profinet::PNIODReleaseBlock::blockHeader, profinet::blockHeaderLenght, profinet::PNBlockHeader::blockLength, profinet::PNBlockHeader::blockType, profinet::PNBlockHeader::blockVersionHigh, profinet::PNBlockHeader::blockVersionLow, ccontrolTransport, profinet::PNRPCHeader::CONTROL, profinet::ControlApplicationReadyResponse, profinet::PNIODReleaseBlock::controlBlockProperties, profinet::PNIODReleaseBlock::controlCommand, profinet::Done, live, liveMonotonic, profinet::OneOctetShift, profinet::PNIODReleaseBlock::padding1, profinet::PNIODReleaseBlock::padding2, profinet::wire::PutU16(), profinet::wire::PutU32(), profinet::PNRPCHeader::REQUEST, profinet::PNRPCHeader::RESPONSE, profinet::PNIODReleaseBlock::sessionKey, sessionKey, profinet::ThreeOctetsShift, profinet::PNBlockHeader::ToBytes(), profinet::PNIODReleaseBlock::ToBytes(), and profinet::TwoOctetsShift.
Here is the call graph for this function:
|
inline |
|
private |
Build an AlarmCRBlockReq for inclusion in the CONNECT request.
| transport | Transport type (0 = RTA over Ethernet). |
| priority | Alarm priority. |
Definition at line 714 of file rpc.cpp.
References profinet::PNAlarmCRBlockReq::alarmCrProperties, profinet::PNAlarmCRBlockReq::alarmCrTagHeaderHigh, profinet::PNAlarmCRBlockReq::alarmCrTagHeaderLow, profinet::PNAlarmCRBlockReq::alarmCrType, alarmRef, profinet::PNAlarmCRBlockReq::BLOCK_TYPE, profinet::PNAlarmCRBlockReq::blockHeader, profinet::blockHeaderLenght, profinet::PNBlockHeader::blockLength, profinet::PNBlockHeader::blockType, profinet::PNBlockHeader::blockVersionHigh, profinet::PNBlockHeader::blockVersionLow, profinet::PNAlarmCRBlockReq::DEFAULT_MAX_ALARM_DATA_LENGTH, profinet::PNAlarmCRBlockReq::DEFAULT_RTA_RETRIES, profinet::PNAlarmCRBlockReq::DEFAULT_RTA_TIMEOUT_FACTOR, profinet::PNAlarmCRBlockReq::DEFAULT_TAG_HEADER_HIGH, profinet::PNAlarmCRBlockReq::DEFAULT_TAG_HEADER_LOW, profinet::PNAlarmCRBlockReq::etherTypeLT, profinet::IP_ETHERTYPE, profinet::PNAlarmCRBlockReq::kSize, profinet::PNAlarmCRBlockReq::localAlarmReference, profinet::PNAlarmCRBlockReq::maxAlarmDataLength, profinet::PROFINET_ETHERTYPE, profinet::PNAlarmCRBlockReq::rtaRetries, profinet::PNAlarmCRBlockReq::rtaTimeoutFactor, profinet::PNBlockHeader::ToBytes(), profinet::PNAlarmCRBlockReq::ToBytes(), profinet::rpc::VERSION_HIGH, and profinet::rpc::VERSION_LOW.
Referenced by Connect().
Here is the call graph for this function:
Here is the caller graph for this function:Build an ExpectedSubmoduleBlockReq for the CONNECT request.
| setup | Cyclic IO configuration describing the expected slots. |
Definition at line 2439 of file rpc.cpp.
References profinet::blocks::ExpectedSubmoduleBlockReq::AddSubmodule(), profinet::blocks::InputAndOutput, profinet::blocks::InputOnly, profinet::blocks::None, profinet::blocks::OutputOnly, profinet::rpc::IOCRSetup::slots, and profinet::blocks::ExpectedSubmoduleBlockReq::ToBytes().
Referenced by Connect().
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticprivate |
Build an IOCRBlockReq (header + API object list) for the CONNECT request.
| iocrType | IOCR type (Input/Output). |
| iocrReference | IOCR reference chosen by the controller. |
| setup | Cyclic IO configuration. |
Definition at line 1690 of file rpc.cpp.
References profinet::PNIOCRBlockReqHeader::BLOCK_TYPE, profinet::PNIOCRBlockReqHeader::blockHeader, profinet::PNBlockHeader::blockLength, profinet::PNBlockHeader::blockType, profinet::PNBlockHeader::blockVersionHigh, profinet::PNBlockHeader::blockVersionLow, profinet::PNIOCRBlockReqHeader::dataHoldFactor, profinet::rpc::IOCRSetup::dataHoldFactor, profinet::PNIOCRBlockReqHeader::dataLength, profinet::rpc::IOCRSetup::dataLength, profinet::PNIOCRBlockReqHeader::etherTypeLT, profinet::PNIOCRBlockReqHeader::frameId, profinet::PNIOCRBlockReqHeader::frameSendOffset, profinet::rpc::IOSlot::inputLength, profinet::PNIOCRBlockReqHeader::iocrMulticastMac, profinet::PNIOCRBlockReqHeader::iocrProperties, profinet::PNIOCRBlockReqHeader::iocrReference, profinet::PNIOCRBlockReqHeader::iocrTagHeader, profinet::PNIOCRBlockReqHeader::iocrType, profinet::PNIOCRBlockReqHeader::kSize, profinet::PNIOCRBlockReqHeader::numberOfApis, profinet::rpc::IOSlot::outputLength, profinet::PNIOCRBlockReqHeader::phase, profinet::PROFINET_ETHERTYPE, profinet::wire::PutU16(), profinet::wire::PutU32(), profinet::PNIOCRBlockReqHeader::reductionRatio, profinet::rpc::IOCRSetup::reductionRatio, profinet::PNIOCRBlockReqHeader::sendClockFactor, profinet::rpc::IOCRSetup::sendClockFactor, profinet::PNIOCRBlockReqHeader::sequence, profinet::rpc::IOSlot::slot, profinet::rpc::IOCRSetup::slots, profinet::rpc::IOSlot::subslot, profinet::PNBlockHeader::ToBytes(), profinet::PNIOCRBlockReqHeader::ToBytes(), profinet::rpc::VERSION_HIGH, profinet::rpc::VERSION_LOW, profinet::PNIOCRBlockReqHeader::watchdogFactor, and profinet::rpc::IOCRSetup::watchdogFactor.
Referenced by Connect().
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticprivate |
Definition at line 2482 of file rpc.cpp.
References profinet::blocks::ExpectedSubmoduleBlockReq::AddSubmodule(), profinet::rpc::IOCRSetup::slots, and profinet::blocks::ExpectedSubmoduleBlockReq::ToBytes().
Here is the call graph for this function:
|
private |
Reconnect if the AR has been idle longer than CONNECTION_TIMEOUT.
Definition at line 2600 of file rpc.cpp.
References Connect(), profinet::rpc::CONNECTION_TIMEOUT, live, and liveMonotonic.
Referenced by Read(), Write(), and WriteMultiple().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtualnoexcept |
Disconnect() and close the underlying sockets.
Called automatically by the destructor (RAII equivalent of rpc.py's context-manager exit).
Implements profinet::rpc::IRPCCon.
Definition at line 3521 of file rpc.cpp.
References ccontrolTransport, Disconnect(), and rpcTransport.
Referenced by ~RPCCon(), and profinet::device::ProfinetDevice::ReadImplicit().
Here is the call graph for this function:
Here is the caller graph for this function:
|
privatenoexcept |
Close the RPC and CControl UDP sockets.
|
overridevirtual |
Establish (or re-establish) the AR with the device.
| srcMac | Source MAC address; required on the first call. |
| withAlarmCr | Whether to also request an AlarmCR (not all devices support it). |
| iocrSetup | If set, also establish cyclic IO (EXPERIMENTAL). |
Throws RPCConnectionError on failure.
Implements profinet::rpc::IRPCCon.
Definition at line 2612 of file rpc.cpp.
References activityUuid, alarmCrEnabled, profinet::ApplicationRelationRequest, profinet::PNNRDData::argsMaximumStatus, profinet::PNARBlockRequest::arProperties, profinet::PNARBlockRequest::arType, profinet::PNARBlockRequest::arUuid, arUuid, profinet::rpc::ConnectResult::arUuid, profinet::PNARBlockRequest::blockHeader, profinet::blockHeaderLenght, profinet::PNBlockHeader::blockLength, profinet::PNBlockHeader::blockType, profinet::PNBlockHeader::blockVersionHigh, profinet::PNBlockHeader::blockVersionLow, BuildAlarmCrBlock(), BuildExpectedSubmoduleBlock(), BuildIocrBlock(), profinet::PNARBlockRequest::cmInitiatorActivityTimeoutFactor, profinet::PNARBlockRequest::cmInitiatorMacAddress, profinet::PNARBlockRequest::cmInitiatorObjectUuid, profinet::PNARBlockRequest::cmInitiatorStationName, profinet::PNRPCHeader::CONNECT, CreateNrd(), CreateRpc(), deviceAlarmRef, profinet::PNIOError::FromArgsStatus(), profinet::PNARBlockRequest::initiatorUdpRtport, inputFrameId, inputIocrRef, iocrRefCounter, iocrSetup, profinet::PNARBlockRequest::kFixedSize, live, localObjectUuid, outputFrameId, outputIocrRef, profinet::PNNRDData::Parse(), ParseAlarmCrResponse(), ParseIocrResponse(), profinet::PNRPCHeader::payload, profinet::PNNRDData::payload, profinet::PROFINET_ETHERTYPE, SendReceive(), profinet::PNARBlockRequest::sessionKey, sessionKey, srcMac, profinet::PNARBlockRequest::stationNameLength, profinet::PNNRDData::ToBytes(), profinet::PNBlockHeader::ToBytes(), profinet::PNARBlockRequest::ToBytes(), profinet::rpc::VERSION_HIGH, and profinet::rpc::VERSION_LOW.
Referenced by CheckTimeout().
Here is the call graph for this function:
Here is the caller graph for this function:Wrap a payload in an NRD (Network Representation Data) header.
| payload | Payload to wrap. |
Definition at line 702 of file rpc.cpp.
References profinet::PNNRDData::actualCount, profinet::PNNRDData::argsLength, profinet::PNNRDData::argsMaximumStatus, profinet::PNNRDData::maximumCount, profinet::PNNRDData::offset, profinet::PNNRDData::payload, and payload.
Referenced by Connect(), Disconnect(), Read(), ReadImplicit(), SendControl(), Write(), and WriteMultiple().
Here is the caller graph for this function:
|
private |
Build an RPC header for the given operation and NRD body.
| operation | RPC operation number. |
| nrd | Serialized NRD body. |
Definition at line 676 of file rpc.cpp.
References profinet::PNRPCHeader::activityHint, profinet::PNRPCHeader::activityUuid, activityUuid, profinet::PNRPCHeader::authenticationProtocol, profinet::PNRPCHeader::dataRepresentation, profinet::PNRPCHeader::flags1, profinet::PNRPCHeader::flags2, profinet::PNRPCHeader::fragmentNumber, profinet::PNRPCHeader::IfaceUuidDevice(), profinet::PNRPCHeader::interfaceHint, profinet::PNRPCHeader::interfaceUuid, profinet::PNRPCHeader::interfaceVersion, profinet::PNRPCHeader::lengthOfBody, profinet::PNRPCHeader::objectUuid, profinet::PNRPCHeader::operationNumber, profinet::PNRPCHeader::packetType, profinet::PNRPCHeader::payload, remoteObjectUuid, profinet::PNRPCHeader::REQUEST, profinet::PNRPCHeader::sequenceNumber, sequenceNumber, profinet::PNRPCHeader::serialNrHigh, profinet::PNRPCHeader::serialNrLow, profinet::PNRPCHeader::serverBootTime, and profinet::PNRPCHeader::version.
Referenced by Connect(), Disconnect(), Read(), ReadImplicit(), SendControl(), Write(), and WriteMultiple().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineoverridevirtual |
Device's local alarm reference, from AlarmCRBlockRes.
Needed by AlarmEndpoint::DeviceRef regardless of whether cyclic IO (and thus a ConnectResult) was also requested.
Implements profinet::rpc::IRPCCon.
Definition at line 455 of file rpc.h.
References deviceAlarmRef.
|
overridevirtual |
Send Release to terminate the AR.
Best-effort, does not wait for a response. Safe to call when not connected (no-op).
Implements profinet::rpc::IRPCCon.
Definition at line 3483 of file rpc.cpp.
References profinet::PNIODReleaseBlock::arUuid, arUuid, profinet::PNIODReleaseBlock::blockHeader, profinet::blockHeaderLenght, profinet::PNBlockHeader::blockLength, profinet::PNBlockHeader::blockType, profinet::PNBlockHeader::blockVersionHigh, profinet::PNBlockHeader::blockVersionLow, profinet::PNIODReleaseBlock::controlBlockProperties, profinet::PNIODReleaseBlock::controlCommand, CreateNrd(), CreateRpc(), live, profinet::PNIODReleaseBlock::padding1, profinet::PNIODReleaseBlock::padding2, profinet::Release, profinet::PNRPCHeader::RELEASE, profinet::ReleaseRequest, rpcTransport, profinet::PNIODReleaseBlock::sessionKey, sessionKey, profinet::PNRPCHeader::ToBytes(), profinet::PNNRDData::ToBytes(), profinet::PNBlockHeader::ToBytes(), and profinet::PNIODReleaseBlock::ToBytes().
Referenced by Close().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Convenience accessor for ReadRealIdentificationData().Slots.
Implements profinet::rpc::IRPCCon.
Definition at line 3097 of file rpc.cpp.
References ReadRealIdentificationData(), and profinet::blocks::RealIdentificationData::slots.
Here is the call graph for this function:
|
overridevirtual |
Read both PDRealData and RealIdentificationData in one call.
Implements profinet::rpc::IRPCCon.
Definition at line 3102 of file rpc.cpp.
References ReadPdRealData(), and ReadRealIdentificationData().
Here is the call graph for this function:
|
overridevirtual |
Probe a set of indices and report which are readable/empty/erroring.
| slot | Slot number to probe. |
| subslot | Subslot number to probe. |
| customIndices | If provided, only these indices are probed; otherwise the standard catalog (I&M, diagnosis, port/interface, device) is used, matching rpc.py's default probe list. |
Implements profinet::rpc::IRPCCon.
Definition at line 3107 of file rpc.cpp.
References profinet::DeviceIndices(), profinet::DiagnosisIndices(), profinet::rpc::IndexProbeResult::error, profinet::PNIOError::errorCode1, profinet::rpc::IndexProbeResult::errorCode1, profinet::PNIOError::errorCode2, profinet::rpc::IndexProbeResult::errorCode2, profinet::EXPECTED_ID_SUBSLOT, profinet::GetIndexName(), profinet::ImIndices(), profinet::InterfaceIndices(), profinet::MODULE_DIFF_BLOCK, profinet::rpc::IndexProbeResult::name, profinet::PNIODHeader::payload, profinet::PortIndices(), Read(), profinet::REAL_ID_SUBSLOT, profinet::RECORD_INPUT_DATA, profinet::RECORD_OUTPUT_DATA, profinet::rpc::IndexProbeResult::size, and profinet::rpc::IndexProbeResult::status.
Here is the call graph for this function:
|
inlineoverridevirtual |
Whether an AlarmCR was successfully established.
Implements profinet::rpc::IRPCCon.
Definition at line 462 of file rpc.h.
References alarmCrEnabled.
|
inlineoverridevirtual |
The device this connection targets.
Implements profinet::rpc::IRPCCon.
Definition at line 423 of file rpc.h.
References info.
|
inlineoverridevirtual |
Returns the underlying Asio I/O context.
Implements profinet::rpc::IRPCCon.
Definition at line 467 of file rpc.h.
References ioContext.
|
inlineoverridevirtual |
Whether the AR is currently established.
Implements profinet::rpc::IRPCCon.
Definition at line 416 of file rpc.h.
References live.
|
inlineoverridevirtual |
Controller's own local alarm reference.
Implements profinet::rpc::IRPCCon.
Definition at line 444 of file rpc.h.
References alarmRef.
Not copyable because the connection owns non-copyable Asio sockets.
Deleted move assignment operator to prevent moving instances of this class.
|
staticprivate |
Parse the AlarmCRBlockRes from a CONNECT response.
| responseData | Raw CONNECT response NRD payload. |
Definition at line 739 of file rpc.cpp.
References profinet::PNAlarmCRBlockRes::BLOCK_TYPE, profinet::blockHeaderLenght, profinet::PNAlarmCRBlockRes::Parse(), and profinet::rpc::PeekBlockHeader().
Referenced by Connect().
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticprivate |
Parse an IOCRBlockRes from a CONNECT response.
| responseData | Raw CONNECT response NRD payload. |
| iocrType | IOCR type to look for (Input or Output). |
Definition at line 2519 of file rpc.cpp.
References profinet::PNIOCRBlockRes::BLOCK_TYPE, profinet::blockHeaderLenght, profinet::PNIOCRBlockRes::Parse(), and profinet::rpc::PeekBlockHeader().
Referenced by Connect().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Send PrmBegin (start of the parameterization phase).
Implements profinet::rpc::IRPCCon.
Definition at line 3226 of file rpc.cpp.
References profinet::ParameterizationBeginRequest, profinet::PrmBegin, and SendControl().
Here is the call graph for this function:
|
overridevirtual |
Send PrmEnd (end of the parameterization phase).
Implements profinet::rpc::IRPCCon.
Definition at line 3230 of file rpc.cpp.
References profinet::ControlPrmEndRequest, profinet::PrmEnd, and SendControl().
Here is the call graph for this function:
|
overridevirtual |
Read a data record via slot/subslot/index (AR must be connected).
| api | API number. |
| slot | Slot number. |
| subslot | Subslot number. |
| idx | Record data index to read. |
Throws PNIOError on a device-reported error, RPCTimeoutError on timeout.
Implements profinet::rpc::IRPCCon.
Definition at line 2748 of file rpc.cpp.
References profinet::PNIODHeader::api, profinet::PNNRDData::argsMaximumStatus, profinet::PNIODHeader::arUuid, arUuid, profinet::PNIODHeader::blockHeader, profinet::blockHeaderLenght, profinet::PNBlockHeader::blockLength, profinet::PNBlockHeader::blockType, profinet::PNBlockHeader::blockVersionHigh, profinet::PNBlockHeader::blockVersionLow, CheckTimeout(), CreateNrd(), CreateRpc(), profinet::PNBlockHeader::DEFAULT_BLOCK_LENGTH, profinet::PNIOError::FromArgsStatus(), profinet::PNIODHeader::index, profinet::PNBlockHeader::IODReadRequestHeader, profinet::PNIODHeader::length, profinet::PNIODHeader::padding1, profinet::PNIODHeader::padding2, profinet::PNNRDData::Parse(), profinet::PNIODHeader::Parse(), profinet::PNRPCHeader::payload, profinet::PNNRDData::payload, profinet::PNRPCHeader::READ, SendReceive(), profinet::PNIODHeader::sequenceNumber, profinet::PNIODHeader::slot, profinet::PNIODHeader::subslot, profinet::PNIODHeader::targetArUuid, profinet::PNNRDData::ToBytes(), profinet::PNIODHeader::ToBytes(), profinet::PNBlockHeader::ToBytes(), profinet::rpc::VERSION_HIGH, and profinet::rpc::VERSION_LOW.
Referenced by EnumerateIndices(), ReadDiagnosis(), ReadIm0(), ReadIm1(), ReadIm10(), ReadIm11(), ReadIm12(), ReadIm13(), ReadIm14(), ReadIm15(), ReadIm2(), ReadIm3(), ReadIm4(), ReadIm5(), ReadIm6(), ReadIm7(), ReadIm8(), ReadIm9(), ReadModuleDiff(), ReadPdRealData(), ReadRaw(), and ReadRealIdentificationData().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Read diagnosis from all standard diagnosis indices.
Covers subslot/device/API-level indices.
Implements profinet::rpc::IRPCCon.
Definition at line 3055 of file rpc.cpp.
References profinet::diagnosis::DiagnosisData::entries, and ReadDiagnosis().
Here is the call graph for this function:
|
overridevirtual |
Read all I&M records a device supports.
| slot | Slot number (defaults to 0, the device's DAP). |
| subslot | Subslot number (defaults to 1). |
Implements profinet::rpc::IRPCCon.
Definition at line 2924 of file rpc.cpp.
References profinet::rpc::AllIM::im0, profinet::rpc::AllIM::im1, profinet::rpc::AllIM::im10, profinet::rpc::AllIM::im11, profinet::rpc::AllIM::im12, profinet::rpc::AllIM::im13, profinet::rpc::AllIM::im14, profinet::rpc::AllIM::im15, profinet::rpc::AllIM::im2, profinet::rpc::AllIM::im3, profinet::rpc::AllIM::im4, profinet::rpc::AllIM::im5, profinet::rpc::AllIM::im6, profinet::rpc::AllIM::im7, profinet::rpc::AllIM::im8, profinet::rpc::AllIM::im9, ReadIm0(), ReadIm1(), ReadIm10(), ReadIm11(), ReadIm12(), ReadIm13(), ReadIm14(), ReadIm15(), ReadIm2(), ReadIm3(), ReadIm4(), ReadIm5(), ReadIm6(), ReadIm7(), ReadIm8(), and ReadIm9().
Here is the call graph for this function:
|
overridevirtual |
Read and parse diagnosis data at the given location/index.
| slot | Slot number to read diagnosis for. |
| subslot | Subslot number to read diagnosis for. |
| index | Diagnosis record index to read. |
Falls back from the full block parser to the simple parser if the full parse yields no entries, matching rpc.py. Returns an empty DiagnosisData (does not throw) on any RPCError, matching rpc.py's own "log and return empty" behavior.
Implements profinet::rpc::IRPCCon.
Definition at line 3022 of file rpc.cpp.
References profinet::diagnosis::DiagnosisData::api, profinet::diagnosis::DiagnosisData::entries, profinet::diagnosis::ParseDiagnosisBlock(), profinet::diagnosis::ParseDiagnosisSimple(), profinet::PNIODHeader::payload, profinet::diagnosis::DiagnosisData::rawData, Read(), profinet::diagnosis::DiagnosisData::slot, and profinet::diagnosis::DiagnosisData::subslot.
Referenced by ReadAllDiagnosis().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Read I&M0 (mandatory identification data).
| slot | Slot number (defaults to 0, the device's DAP). |
| subslot | Subslot number (defaults to 1). |
Implements profinet::rpc::IRPCCon.
Definition at line 2859 of file rpc.cpp.
References profinet::PNInM0::IDX, profinet::PNInM0::Parse(), payload, and Read().
Referenced by ReadAllIm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Read I&M1 (tag function/location).
| slot | Slot number (defaults to 0, the device's DAP). |
| subslot | Subslot number (defaults to 1). |
Implements profinet::rpc::IRPCCon.
Definition at line 2863 of file rpc.cpp.
References profinet::PNInM1::IDX, profinet::PNInM1::Parse(), payload, and Read().
Referenced by ReadAllIm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Read I&M10 (reserved).
| slot | Slot number (defaults to 0, the device's DAP). |
| subslot | Subslot number (defaults to 1). |
Implements profinet::rpc::IRPCCon.
Definition at line 2899 of file rpc.cpp.
References profinet::PNInMReserved< Idx >::IDX, profinet::PNInMReserved< Idx >::Parse(), payload, and Read().
Referenced by ReadAllIm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Read I&M11 (reserved).
| slot | Slot number (defaults to 0, the device's DAP). |
| subslot | Subslot number (defaults to 1). |
Implements profinet::rpc::IRPCCon.
Definition at line 2903 of file rpc.cpp.
References profinet::PNInMReserved< Idx >::IDX, profinet::PNInMReserved< Idx >::Parse(), payload, and Read().
Referenced by ReadAllIm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Read I&M12 (reserved).
| slot | Slot number (defaults to 0, the device's DAP). |
| subslot | Subslot number (defaults to 1). |
Implements profinet::rpc::IRPCCon.
Definition at line 2907 of file rpc.cpp.
References profinet::PNInMReserved< Idx >::IDX, profinet::PNInMReserved< Idx >::Parse(), payload, and Read().
Referenced by ReadAllIm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Read I&M13 (reserved).
| slot | Slot number (defaults to 0, the device's DAP). |
| subslot | Subslot number (defaults to 1). |
Implements profinet::rpc::IRPCCon.
Definition at line 2911 of file rpc.cpp.
References profinet::PNInMReserved< Idx >::IDX, profinet::PNInMReserved< Idx >::Parse(), payload, and Read().
Referenced by ReadAllIm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Read I&M14 (reserved).
| slot | Slot number (defaults to 0, the device's DAP). |
| subslot | Subslot number (defaults to 1). |
Implements profinet::rpc::IRPCCon.
Definition at line 2915 of file rpc.cpp.
References profinet::PNInMReserved< Idx >::IDX, profinet::PNInMReserved< Idx >::Parse(), payload, and Read().
Referenced by ReadAllIm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Read I&M15 (reserved).
| slot | Slot number (defaults to 0, the device's DAP). |
| subslot | Subslot number (defaults to 1). |
Implements profinet::rpc::IRPCCon.
Definition at line 2919 of file rpc.cpp.
References profinet::PNInMReserved< Idx >::IDX, profinet::PNInMReserved< Idx >::Parse(), payload, and Read().
Referenced by ReadAllIm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Read I&M2 (installation date).
| slot | Slot number (defaults to 0, the device's DAP). |
| subslot | Subslot number (defaults to 1). |
Implements profinet::rpc::IRPCCon.
Definition at line 2867 of file rpc.cpp.
References profinet::PNInM2::IDX, profinet::PNInM2::Parse(), payload, and Read().
Referenced by ReadAllIm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Read I&M3 (free-text descriptor).
| slot | Slot number (defaults to 0, the device's DAP). |
| subslot | Subslot number (defaults to 1). |
Implements profinet::rpc::IRPCCon.
Definition at line 2871 of file rpc.cpp.
References profinet::PNInM3::IDX, profinet::PNInM3::Parse(), payload, and Read().
Referenced by ReadAllIm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Read I&M4 (PROFIsafe signature).
| slot | Slot number (defaults to 0, the device's DAP). |
| subslot | Subslot number (defaults to 1). |
Implements profinet::rpc::IRPCCon.
Definition at line 2875 of file rpc.cpp.
References profinet::PNInM4::IDX, profinet::PNInM4::Parse(), payload, and Read().
Referenced by ReadAllIm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Read I&M5 (free-text annotation).
| slot | Slot number (defaults to 0, the device's DAP). |
| subslot | Subslot number (defaults to 1). |
Implements profinet::rpc::IRPCCon.
Definition at line 2879 of file rpc.cpp.
References profinet::PNInM5::IDX, profinet::PNInM5::Parse(), payload, and Read().
Referenced by ReadAllIm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Read I&M6 (reserved).
| slot | Slot number (defaults to 0, the device's DAP). |
| subslot | Subslot number (defaults to 1). |
Implements profinet::rpc::IRPCCon.
Definition at line 2883 of file rpc.cpp.
References profinet::PNInMReserved< Idx >::IDX, profinet::PNInMReserved< Idx >::Parse(), payload, and Read().
Referenced by ReadAllIm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Read I&M7 (reserved).
| slot | Slot number (defaults to 0, the device's DAP). |
| subslot | Subslot number (defaults to 1). |
Implements profinet::rpc::IRPCCon.
Definition at line 2887 of file rpc.cpp.
References profinet::PNInMReserved< Idx >::IDX, profinet::PNInMReserved< Idx >::Parse(), payload, and Read().
Referenced by ReadAllIm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Read I&M8 (reserved).
| slot | Slot number (defaults to 0, the device's DAP). |
| subslot | Subslot number (defaults to 1). |
Implements profinet::rpc::IRPCCon.
Definition at line 2891 of file rpc.cpp.
References profinet::PNInMReserved< Idx >::IDX, profinet::PNInMReserved< Idx >::Parse(), payload, and Read().
Referenced by ReadAllIm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Read I&M9 (reserved).
| slot | Slot number (defaults to 0, the device's DAP). |
| subslot | Subslot number (defaults to 1). |
Implements profinet::rpc::IRPCCon.
Definition at line 2895 of file rpc.cpp.
References profinet::PNInMReserved< Idx >::IDX, profinet::PNInMReserved< Idx >::Parse(), payload, and Read().
Referenced by ReadAllIm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Read a data record without an established AR.
| api | API number. |
| slot | Slot number. |
| subslot | Subslot number. |
| idx | Record data index to read. |
Implements profinet::rpc::IRPCCon.
Definition at line 2784 of file rpc.cpp.
References profinet::PNIODHeader::api, profinet::PNNRDData::argsMaximumStatus, profinet::PNIODHeader::arUuid, profinet::PNIODHeader::blockHeader, profinet::blockHeaderLenght, profinet::PNBlockHeader::blockLength, profinet::PNBlockHeader::blockType, profinet::PNBlockHeader::blockVersionHigh, profinet::PNBlockHeader::blockVersionLow, CreateNrd(), CreateRpc(), profinet::PNIOError::FromArgsStatus(), profinet::PNRPCHeader::IMPLICIT_READ, profinet::PNIODHeader::index, profinet::PNBlockHeader::IODReadRequestHeader, profinet::PNIODHeader::length, profinet::PNIODHeader::padding1, profinet::PNIODHeader::padding2, profinet::PNNRDData::Parse(), profinet::PNIODHeader::Parse(), profinet::PNRPCHeader::payload, profinet::PNNRDData::payload, SendReceive(), profinet::PNIODHeader::sequenceNumber, profinet::PNIODHeader::slot, profinet::PNIODHeader::subslot, profinet::PNIODHeader::targetArUuid, profinet::PNNRDData::ToBytes(), profinet::PNIODHeader::ToBytes(), and profinet::PNBlockHeader::ToBytes().
Referenced by profinet::device::ProfinetDevice::ReadImplicit().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Read and parse the device's ModuleDiffBlock.
Implements profinet::rpc::IRPCCon.
Definition at line 3016 of file rpc.cpp.
References profinet::MODULE_DIFF_BLOCK, profinet::blocks::ParseModuleDiffBlock(), profinet::PNIODHeader::payload, and Read().
Here is the call graph for this function:
|
overridevirtual |
Read and parse the device's PDRealData (physical topology).
Implements profinet::rpc::IRPCCon.
Definition at line 3085 of file rpc.cpp.
References profinet::blocks::ParsePdRealData(), profinet::PNIODHeader::payload, profinet::PD_REAL_DATA, and Read().
Referenced by DiscoverTopology().
Here is the call graph for this function:
Here is the caller graph for this function:| Bytes profinet::rpc::RPCCon::ReadRaw | ( | std::uint16_t | idx, |
| std::uint16_t | slot = 0, |
||
| std::uint16_t | subslot = 1 |
||
| ) |
Read a raw record payload by index (convenience wrapper over Read()).
| idx | Record data index to read. |
| slot | Slot number. |
| subslot | Subslot number. |
Definition at line 2854 of file rpc.cpp.
References profinet::PNIODHeader::payload, and Read().
Here is the call graph for this function:
|
overridevirtual |
Read and parse the device's RealIdentificationData (logical structure).
Implements profinet::rpc::IRPCCon.
Definition at line 3091 of file rpc.cpp.
References profinet::blocks::ParseRealIdentificationData(), profinet::PNIODHeader::payload, Read(), and profinet::REAL_ID_API.
Referenced by DiscoverSlots(), and DiscoverTopology().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Send ReadyForRTClass3 (isochronous real-time readiness).
Implements profinet::rpc::IRPCCon.
Definition at line 3234 of file rpc.cpp.
References profinet::ControlRtClass3Request, profinet::ReadyForRtClass3, and SendControl().
Here is the call graph for this function:
|
private |
Send a CONTROL operation and optionally wait for its response.
| blockType | Control block type. |
| controlCommand | Control command bitmask. |
| waitResponse | Whether to wait for and return the response. |
| subBlocks | Additional blocks to append after the control block. |
Definition at line 3181 of file rpc.cpp.
References profinet::PNNRDData::argsMaximumStatus, profinet::PNIODReleaseBlock::arUuid, arUuid, profinet::PNIODReleaseBlock::blockHeader, profinet::blockHeaderLenght, profinet::PNBlockHeader::blockLength, profinet::PNBlockHeader::blockType, profinet::PNBlockHeader::blockVersionHigh, profinet::PNBlockHeader::blockVersionLow, profinet::PNRPCHeader::CONTROL, profinet::PNIODReleaseBlock::controlBlockProperties, profinet::PNIODReleaseBlock::controlCommand, CreateNrd(), CreateRpc(), profinet::PNIOError::FromArgsStatus(), live, profinet::PNIODReleaseBlock::padding1, profinet::PNIODReleaseBlock::padding2, profinet::PNNRDData::Parse(), profinet::PNRPCHeader::payload, profinet::PNNRDData::payload, rpcTransport, SendReceive(), profinet::PNIODReleaseBlock::sessionKey, sessionKey, profinet::PNRPCHeader::ToBytes(), profinet::PNNRDData::ToBytes(), profinet::PNBlockHeader::ToBytes(), and profinet::PNIODReleaseBlock::ToBytes().
Referenced by PrmBegin(), PrmEnd(), and ReadyForRtClass3().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Send an RPC request and synchronously wait for its response.
| request | RPC request packet to transmit. |
| RPCTimeoutError | when no response arrives before the configured timeout. |
| RPCError | when the socket or RPC response is invalid. |
Definition at line 2547 of file rpc.cpp.
References profinet::PNRPCHeader::FAULT, info, profinet::PNRPCHeader::kFixedSize, live, liveMonotonic, profinet::dcp::DCPDeviceDescription::name, profinet::PNRPCHeader::operationNumber, profinet::PNRPCHeader::packetType, profinet::PNRPCHeader::Parse(), profinet::PNRPCHeader::REJECT, profinet::PNRPCHeader::REQUEST, profinet::PNRPCHeader::RESPONSE, rpcTransport, timeout, and profinet::PNRPCHeader::ToBytes().
Referenced by Connect(), Read(), ReadImplicit(), SendControl(), Write(), and WriteMultiple().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
The session key for this connection.
Definition at line 437 of file rpc.h.
References sessionKey.
|
overridevirtual |
Write a data record via slot/subslot/index (AR must be connected).
| api | API number. |
| slot | Slot number. |
| subslot | Subslot number. |
| idx | Record data index to write. |
| data | Record data to write. |
Implements profinet::rpc::IRPCCon.
Definition at line 2818 of file rpc.cpp.
References profinet::PNIODHeader::api, profinet::PNNRDData::argsMaximumStatus, profinet::PNIODHeader::arUuid, arUuid, profinet::PNIODHeader::blockHeader, profinet::blockHeaderLenght, profinet::PNBlockHeader::blockLength, profinet::PNBlockHeader::blockType, profinet::PNBlockHeader::blockVersionHigh, profinet::PNBlockHeader::blockVersionLow, CheckTimeout(), CreateNrd(), CreateRpc(), profinet::PNIOError::FromArgsStatus(), profinet::PNIODHeader::index, profinet::IoDataWriteRequest, profinet::PNIODHeader::length, profinet::PNIODHeader::padding1, profinet::PNIODHeader::padding2, profinet::PNNRDData::Parse(), profinet::PNRPCHeader::payload, profinet::PNIODHeader::payload, SendReceive(), profinet::PNIODHeader::sequenceNumber, profinet::PNIODHeader::slot, profinet::PNIODHeader::subslot, profinet::PNIODHeader::targetArUuid, profinet::PNNRDData::ToBytes(), profinet::PNIODHeader::ToBytes(), profinet::PNBlockHeader::ToBytes(), and profinet::PNRPCHeader::WRITE.
Here is the call graph for this function:
|
overridevirtual |
Write multiple records atomically via IODWriteMultipleReq (0xE040).
| writes | The individual write operations to perform. |
Throws PNIOError/RPCError if the overall request fails; individual per-write results are returned rather than thrown.
Implements profinet::rpc::IRPCCon.
Definition at line 2968 of file rpc.cpp.
References profinet::blocks::IODWriteMultipleBuilder::AddWrite(), profinet::PNIODHeader::api, profinet::PNNRDData::argsMaximumStatus, profinet::PNIODHeader::arUuid, arUuid, profinet::PNIODHeader::blockHeader, profinet::blockHeaderLenght, profinet::PNBlockHeader::blockLength, profinet::PNBlockHeader::blockType, profinet::PNBlockHeader::blockVersionHigh, profinet::PNBlockHeader::blockVersionLow, profinet::blocks::IODWriteMultipleBuilder::Build(), CheckTimeout(), CreateNrd(), CreateRpc(), profinet::PNIOError::FromArgsStatus(), profinet::PNIODHeader::index, profinet::IoDataWriteRequest, profinet::PNIODHeader::length, profinet::PNIODHeader::padding1, profinet::PNIODHeader::padding2, profinet::PNNRDData::Parse(), profinet::blocks::ParseWriteMultipleResponse(), profinet::PNRPCHeader::payload, profinet::PNNRDData::payload, profinet::PNIODHeader::payload, payload, SendReceive(), profinet::PNIODHeader::sequenceNumber, profinet::PNIODHeader::slot, profinet::PNIODHeader::subslot, profinet::PNIODHeader::targetArUuid, profinet::PNNRDData::ToBytes(), profinet::PNIODHeader::ToBytes(), profinet::PNBlockHeader::ToBytes(), profinet::PNRPCHeader::WRITE, and profinet::blocks::IODWriteMultipleBuilder::writeMultipleIndex.
Here is the call graph for this function:
|
friend |
|
private |
Activity UUID for the current RPC exchange.
Definition at line 548 of file rpc.h.
Referenced by RPCCon(), Connect(), and CreateRpc().
|
private |
Whether an AlarmCR was successfully established.
Definition at line 576 of file rpc.h.
Referenced by Connect(), and HasAlarmCr().
|
private |
Controller's own local alarm reference.
Definition at line 570 of file rpc.h.
Referenced by BuildAlarmCrBlock(), and LocalAlarmRef().
|
private |
AR UUID for this connection.
Definition at line 545 of file rpc.h.
Referenced by RPCCon(), ApplicationReady(), ArUuid(), Connect(), Disconnect(), Read(), SendControl(), Write(), and WriteMultiple().
|
private |
Definition at line 603 of file rpc.h.
Referenced by RPCCon(), ApplicationReady(), and Close().
|
private |
Device's local alarm reference, if an AlarmCR was established.
Definition at line 573 of file rpc.h.
Referenced by Connect(), and DeviceAlarmRef().
|
private |
DCP-discovered description of the target device.
Definition at line 539 of file rpc.h.
Referenced by RPCCon(), Info(), and SendReceive().
|
private |
|
private |
|
private |
Asio execution context used by the RPC transport.
Definition at line 600 of file rpc.h.
Referenced by IoContext().
|
private |
|
private |
|
private |
Whether the AR is currently established.
Definition at line 557 of file rpc.h.
Referenced by ApplicationReady(), CheckTimeout(), Connect(), Disconnect(), IsConnected(), SendControl(), and SendReceive().
|
private |
Timestamp of the last successful RPC exchange, for CONNECTION_TIMEOUT tracking.
Definition at line 560 of file rpc.h.
Referenced by ApplicationReady(), CheckTimeout(), and SendReceive().
|
private |
|
private |
|
private |
|
private |
The target device's object UUID.
Definition at line 554 of file rpc.h.
Referenced by RPCCon(), and CreateRpc().
|
private |
Definition at line 602 of file rpc.h.
Referenced by RPCCon(), Close(), Disconnect(), SendControl(), and SendReceive().
|
private |
Monotonically increasing RPC sequence number.
Definition at line 579 of file rpc.h.
Referenced by CreateRpc().
|
private |
Session key for this connection.
Definition at line 566 of file rpc.h.
Referenced by ApplicationReady(), Connect(), Disconnect(), SendControl(), and SessionKey().
|
private |
|
private |
Default RPC response timeout in seconds.
Definition at line 542 of file rpc.h.
Referenced by SendReceive().