PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
Loading...
Searching...
No Matches
rpc.cpp File Reference

Implements PROFINET DCE/RPC connection management and AR lifecycle operations. More...

#include "profinet/rpc.h"
#include <arpa/inet.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <random>
#include <ranges>
#include <sstream>
#include "profinet/cyclic.h"
+ Include dependency graph for rpc.cpp:

Go to the source code of this file.

Namespaces

namespace  profinet
 
namespace  profinet::rpc
 

Functions

std::string profinet::rpc::UuidBytesToString (const std::array< std::uint8_t, uuidLenght > &data)
 Format a 16-byte DCE/RPC UUID as a canonical string.
 
std::array< std::uint8_t, uuidLenghtprofinet::rpc::StringToUuidBytes (const std::string &uuidStr)
 Parse a canonical UUID string into 16 raw DCE/RPC UUID bytes.
 
std::vector< EPMEndpointprofinet::rpc::EpmLookup (asio::io_context &ioContext, const std::string &ip, std::uint16_t port=RPC_PORT, double timeoutSec=DEFAULT_TIMEOUT, std::optional< std::string > interfaceFilter=std::nullopt)
 Query a device's Endpoint Mapper for available RPC endpoints.
 
dcp::DCPDeviceDescription profinet::rpc::GetStationInfo (const EthernetSocket &sock, const MacAddress &src, const std::string &name, int timeoutSec=static_cast< int >(DEFAULT_TIMEOUT *2))
 Resolve a device by PROFINET station name via DCP.
 

Variables

constexpr std::uint8_t profinet::rpc::VERSION_HIGH = 0x01
 Version high.
 
constexpr std::uint8_t profinet::rpc::VERSION_LOW = 0x00
 Version low.
 

Detailed Description

Implements PROFINET DCE/RPC connection management and AR lifecycle operations.

Handles Application Relation establishment, parameterization, IOCR and AlarmCR configuration, acyclic record access, Application Ready and Application Relation release. The implementation serializes protocol blocks explicitly and delegates network transport to the RPC transport layer.

Definition in file rpc.cpp.

Variable Documentation

◆ activityUuid

std::array<std::uint8_t, uuidLenght> activityUuid {}

Definition at line 3249 of file rpc.cpp.

◆ drep

std::array<std::uint8_t, 4> drep {}

Definition at line 3248 of file rpc.cpp.

◆ flags1

std::uint8_t flags1 {}

Definition at line 3247 of file rpc.cpp.

◆ flags2

std::uint8_t flags2 {}

Definition at line 3247 of file rpc.cpp.

◆ interfaceUuid

std::array<std::uint8_t, uuidLenght> interfaceUuid {}

Definition at line 3249 of file rpc.cpp.

◆ interfaceVersion

std::uint32_t interfaceVersion {}

Definition at line 3250 of file rpc.cpp.

◆ isLittleEndian

bool isLittleEndian {}

Definition at line 3253 of file rpc.cpp.

◆ objectUuid

std::array<std::uint8_t, uuidLenght> objectUuid {}

Definition at line 3249 of file rpc.cpp.

◆ operationNumber

std::uint16_t operationNumber {}

Definition at line 3251 of file rpc.cpp.

◆ packetType

std::uint8_t packetType {}

Definition at line 3247 of file rpc.cpp.

◆ payload

◆ sequenceNumber

std::uint32_t sequenceNumber {}

Definition at line 3250 of file rpc.cpp.

◆ serialHigh

std::uint8_t serialHigh {}

Definition at line 3247 of file rpc.cpp.

◆ serialLow

std::uint8_t serialLow {}

Definition at line 3252 of file rpc.cpp.

◆ version

std::uint8_t version {}

Definition at line 3247 of file rpc.cpp.

Referenced by profinet::AlarmListener::ProcessAlarm().