RMVL  1.3.0
Robotic Manipulation and Vision Library
载入中...
搜索中...
未找到
rm::Subscriber< TransportID::UDP_UADP >类 参考

使用 UDP 协议以及 UADP 序列化方式的订阅者特化 更多...

#include <rmvl/opcua/subscriber.hpp>

类 rm::Subscriber< TransportID::UDP_UADP > 继承关系图:
rm::Subscriber< TransportID::UDP_UADP > 的协作图:

Public 成员函数

 Subscriber (const std::string &sub_name, const std::string &address, uint16_t port=4850U, const std::vector< UserConfig > &users={})
 创建 OPC UA 订阅者
 
std::vector< UA_NodeId > subscribe (const std::string &pub_name, const std::vector< FieldMetaData > &fields)
 订阅数据集
 
- Public 成员函数 继承自 rm::Server
 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 &&)=delete
 
void start ()
 运行服务器,调用方线程不阻塞
 
void stop ()
 停止服务器
 
void join ()
 阻塞
 
 ~Server ()
 释放服务器资源
 
FindNodeInServer find (const std::string &browse_name, uint16_t ns=1U)
 获取路径搜索必要信息
 
UA_NodeId addVariableTypeNode (const VariableType &vtype)
 添加变量类型节点 VariableTypeNode 至 BaseDataVariableType
 
UA_NodeId addVariableNode (const Variable &val, const UA_NodeId &parent_id=nodeObjectsFolder)
 添加变量节点 VariableNode 至指定父节点中,并指定引用类型
 
bool addVariableNodeValueCallBack (UA_NodeId id, ValueCallBackBeforeRead before_read, ValueCallBackAfterWrite after_write)
 为既有的变量节点 VariableNode 添加值回调
 
UA_NodeId addDataSourceVariableNode (const Variable &val, DataSourceRead on_read, DataSourceWrite on_write, UA_NodeId parent_id=nodeObjectsFolder)
 添加数据源变量节点 VariableNode 至指定父节点中
 
Variable read (const UA_NodeId &node)
 从指定的变量节点读数据
 
bool write (const UA_NodeId &node, const Variable &val)
 给指定的变量节点写数据
 
UA_NodeId addMethodNode (const Method &method, const UA_NodeId &parent_id=nodeObjectsFolder)
 添加方法节点 MethodNode 至指定父节点中
 
void setMethodNodeCallBack (const UA_NodeId &id, UA_MethodCallback on_method)
 为既有的方法节点 MethodNode 设置方法的回调函数
 
UA_NodeId addObjectTypeNode (const ObjectType &otype)
 添加对象类型节点 ObjectTypeNode 至 rm::nodeBaseObjectType
 
UA_NodeId addObjectNode (const Object &obj, UA_NodeId parent_id=nodeObjectsFolder)
 添加对象节点 ObjectNode 至指定的父节点中
 
UA_NodeId addViewNode (const View &view)
 添加视图节点 ViewNode 至 rm::nodeViewsFolder
 
UA_NodeId addEventTypeNode (const EventType &etype)
 添加事件类型至 BaseEventType
 
bool triggerEvent (const UA_NodeId &node_id, const Event &event)
 创建并触发事件
 

额外继承的成员函数

- Protected 成员函数 继承自 rm::Server
void deleteServer ()
 释放服务器资源
 
- Protected 属性 继承自 rm::Server
UA_Server * _server
 OPC UA 服务器指针
 
bool _running {}
 服务器运行状态
 
std::thread _run
 服务器运行线程
 

详细描述

使用 UDP 协议以及 UADP 序列化方式的订阅者特化

构造及析构函数说明

◆ Subscriber()

rm::Subscriber< TransportID::UDP_UADP >::Subscriber ( const std::string & sub_name,
const std::string & address,
uint16_t port = 4850U,
const std::vector< UserConfig > & users = {} )

创建 OPC UA 订阅者

参数
[in]sub_name订阅者名称
[in]address订阅地址,形如 opc.udp://224.0.0.22:4840
[in]port端口号,与 Server::Server 的端口号概念一致,默认为 4850
[in]users用户列表,默认为空,可参考 UserConfig

成员函数说明

◆ subscribe()

std::vector< UA_NodeId > rm::Subscriber< TransportID::UDP_UADP >::subscribe ( const std::string & pub_name,
const std::vector< FieldMetaData > & fields )

订阅数据集

参数
[in]pub_name发布者名称
[in]fields数据集字段元数据列表
返回
订阅的变量对应的 UA_NodeId 列表,每个 UA_NodeId 均存在于订阅者自身的服务器中

该类的文档由以下文件生成: