![]() |
RMVL
1.5.0
Robotic Manipulation and Vision Library
|
使用 UDP
协议以及 UADP
序列化方式的 Publisher 特化
更多...
#include <rmvl/opcua/publisher.hpp>
Public 成员函数 | |
Publisher (const std::string &pub_name, const std::string &address, uint16_t port=4840U, const std::vector< UserConfig > &users={}) | |
创建 OPC UA 发布者 | |
bool | publish (const std::vector< PublishedDataSet > &datas, double duration) |
发布数据集 | |
![]() | |
Server (uint16_t port, std::string_view name={}, const std::vector< UserConfig > &users={}) | |
创建 OPC UA 服务器 | |
Server (ServerUserConfig on_config, uint16_t port, std::string_view name={}, const std::vector< UserConfig > &users={}) | |
从服务器配置函数指针创建 OPC UA 服务器 | |
Server (const Server &)=delete | |
Server (Server &&srv)=delete | |
operator ServerView () const | |
void | start () |
运行服务器,调用方线程不阻塞 | |
void | stop () |
停止服务器 | |
void | join () |
阻塞 | |
~Server () | |
FindNodeInServer | find (std::string_view browse_name, uint16_t ns=1U) const |
获取路径搜索必要信息 | |
NodeId | addVariableTypeNode (const VariableType &vtype) const |
添加变量类型节点 VariableTypeNode 至 BaseDataVariableType 中 | |
NodeId | addVariableNode (const Variable &val, const NodeId &parent_id=nodeObjectsFolder) const noexcept |
添加变量节点 VariableNode 至指定父节点中,并指定引用类型 | |
bool | addVariableNodeValueCallback (NodeId id, ValueCallbackBeforeRead before_read, ValueCallbackAfterWrite after_write) const noexcept |
为既有的变量节点 VariableNode 添加值回调 | |
NodeId | addDataSourceVariableNode (const Variable &val, DataSourceRead on_read, DataSourceWrite on_write, NodeId parent_id=nodeObjectsFolder) const noexcept |
添加数据源变量节点 VariableNode 至指定父节点中 | |
Variable | read (const NodeId &node) const |
从指定的变量节点读数据 | |
bool | write (const NodeId &node, const Variable &val) const |
给指定的变量节点写数据 | |
NodeId | addMethodNode (const Method &method, const NodeId &parent_id=nodeObjectsFolder) const |
添加方法节点 MethodNode 至指定父节点中 | |
void | setMethodNodeCallBack (const NodeId &id, MethodCallback on_method) const |
为既有的方法节点 MethodNode 设置方法的回调函数 | |
NodeId | addObjectTypeNode (const ObjectType &otype) const |
添加对象类型节点 ObjectTypeNode 至 rm::nodeBaseObjectType 中 | |
NodeId | addObjectNode (const Object &obj, NodeId parent_id=nodeObjectsFolder) const |
添加对象节点 ObjectNode 至指定的父节点中 | |
NodeId | addViewNode (const View &view) const |
添加视图节点 ViewNode 至 rm::nodeViewsFolder 中 | |
NodeId | addEventTypeNode (const EventType &etype) const |
添加事件类型至 BaseEventType 中 | |
bool | triggerEvent (const NodeId &node_id, const Event &event) const |
创建并触发事件 | |
额外继承的成员函数 | |
![]() | |
using | ValueCallbackWrapper = std::pair<ValueCallbackBeforeRead, ValueCallbackAfterWrite> |
using | DataSourceCallbackWrapper = std::pair<DataSourceRead, DataSourceWrite> |
![]() | |
UA_Server * | _server |
OPC UA 服务器指针 | |
bool | _running {} |
服务器运行状态 | |
std::thread | _run |
服务器运行线程 | |
使用 UDP
协议以及 UADP
序列化方式的 Publisher 特化
rm::Publisher< TransportID::UDP_UADP >::Publisher | ( | const std::string & | pub_name, |
const std::string & | address, | ||
uint16_t | port = 4840U, | ||
const std::vector< UserConfig > & | users = {} ) |
创建 OPC UA 发布者
[in] | pub_name | 发布者名称 |
[in] | address | 不加端口的网络多播 IP 地址,形如 opc.udp://224.0.1.22 |
[in] | port | 端口号,并且作为多播 IP 地址的端口号,与 Server::Server 的端口号概念一致,默认为 4840U |
[in] | users | 用户列表,默认为空,可参考 UserConfig |
bool rm::Publisher< TransportID::UDP_UADP >::publish | ( | const std::vector< PublishedDataSet > & | datas, |
double | duration ) |
发布数据集
[in] | datas | 待发布的数据集列表 |
[in] | duration | 发布周期,单位为 ms |