![]() |
RMVL
1.2.1
Robotic Manipulation and Vision Library
|
使用 UDP
协议以及 UADP
序列化方式的订阅者特化
更多...
#include <rmvl/opcua/subscriber.hpp>
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) |
订阅数据集 | |
![]() | |
Server (uint16_t port, const std::vector< UserConfig > &users={}) | |
创建 OPC UA 服务器 | |
Server (ServerUserConfig on_config, uint16_t port, 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) |
获取路径搜索必要信息 | |
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) |
创建并触发事件 | |
额外继承的成员函数 | |
![]() | |
void | deleteServer () |
释放服务器资源 | |
![]() | |
UA_Server * | _server |
OPC UA 服务器指针 | |
bool | _running {} |
服务器运行状态 | |
std::thread | _run |
服务器运行线程 | |
使用 UDP
协议以及 UADP
序列化方式的订阅者特化
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 |
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
均存在于订阅者自身的服务器中