![]() |
RMVL
2.5.0-dev
Robotic Manipulation and Vision Library
|
OPC UA 发布者 更多...
#include <rmvl/opcua/publisher.hpp>
Public 成员函数 | |
| Publisher (std::string_view pub_name, const std::string &addr, uint16_t port=4840U, const std::vector< UserConfig > &users={}) | |
| 创建 OPC UA 发布者 | |
| bool | publish (const std::vector< PublishedDataSet > &datas, double duration) |
| 发布数据集 | |
| Public 成员函数 继承自 rm::ua::Server | |
| Server (uint16_t port, std::string_view name={}, const std::vector< UserConfig > &users={}) | |
| 创建 OPC UA 服务器 | |
| Server (UA_StatusCode(*on_config)(UA_Server *), uint16_t port, std::string_view name={}, const std::vector< UserConfig > &users={}) | |
| 从服务器配置函数指针创建 OPC UA 服务器 | |
| operator ServerView () const | |
| void | spin () |
| 启动服务器并阻塞 | |
| void | spinOnce () |
| 单次处理网络层中的重复回调和事件(单次处理服务器的 epoll 或者 IOCP) | |
| void | shutdown () |
| 停止服务器 | |
| ~Server () | |
| FindNodeInServer | node (std::string_view browse_name, uint16_t ns=1U) const |
| 获取路径搜索必要信息 | |
| NodeId | find (std::string_view browse_path, const NodeId &src_nd=nodeObjectsFolder) const noexcept |
| 通过 BrowseName 的路径搜索命名空间 ns 为 1 的节点 | |
| NodeId | addVariableTypeNode (const VariableType &vtype) |
| 添加变量类型节点 VariableTypeNode 至 BaseDataVariableType 中 | |
| NodeId | addVariableNode (const Variable &val, const NodeId &parent_nd=nodeObjectsFolder) noexcept |
| 添加变量节点 VariableNode 至指定父节点中,并指定引用类型 | |
| bool | addVariableNodeValueCallback (NodeId nd, ValueCallbackBeforeRead before_read, ValueCallbackAfterWrite after_write) noexcept |
| 为既有的变量节点 VariableNode 添加值回调 | |
| NodeId | addDataSourceVariableNode (const DataSourceVariable &val, NodeId parent_nd=nodeObjectsFolder) noexcept |
| 添加数据源变量节点 VariableNode 至指定父节点中 | |
| Variable | read (const NodeId &node) const |
| 从指定的变量节点读数据 | |
| bool | write (const NodeId &node, const Variable &val) |
| 给指定的变量节点写数据 | |
| NodeId | addMethodNode (const Method &method, const NodeId &parent_nd=nodeObjectsFolder) |
| 添加方法节点 MethodNode 至指定父节点中 | |
| bool | setMethodNodeCallBack (const NodeId &nd, MethodCallback on_method) |
| 为既有的方法节点 MethodNode 设置方法的回调函数 | |
| NodeId | addObjectTypeNode (const ObjectType &otype) |
| 添加对象类型节点 ObjectTypeNode 至 rm::nodeBaseObjectType 中 | |
| NodeId | addObjectNode (const Object &obj, NodeId parent_nd=nodeObjectsFolder) |
| 添加对象节点 ObjectNode 至指定的父节点中 | |
| NodeId | addViewNode (const View &view) |
| 添加视图节点 ViewNode 至 rm::nodeViewsFolder 中 | |
| NodeId | addEventTypeNode (const EventType &etype) |
| 添加事件类型至 BaseEventType 中 | |
| bool | triggerEvent (const Event &event) const |
| 创建并触发事件 | |
额外继承的成员函数 | |
| Public 类型 继承自 rm::ua::Server | |
| using | ValueCallbackWrapper = std::pair<ValueCallbackBeforeRead, ValueCallbackAfterWrite> |
| using | DataSourceCallbackWrapper = std::pair<DataSourceRead, DataSourceWrite> |
| Protected 属性 继承自 rm::ua::Server | |
| UA_Server * | _server |
| OPC UA 服务器指针 | |
| std::atomic_bool | _running {} |
| 服务器运行状态 | |
OPC UA 发布者
| rm::ua::Publisher::Publisher | ( | std::string_view | pub_name, |
| const std::string & | addr, | ||
| uint16_t | port = 4840U, | ||
| const std::vector< UserConfig > & | users = {} ) |
创建 OPC UA 发布者
| [in] | pub_name | 发布者名称 |
| [in] | addr | 不加端口的网络多播 IP 地址,形如 opc.udp://224.0.1.22 |
| [in] | port | 端口号,并且作为多播 IP 地址的端口号,与 Server::Server 的端口号概念一致,默认为 4840U |
| [in] | users | 用户列表,默认为空,可参考 UserConfig |
| bool rm::ua::Publisher::publish | ( | const std::vector< PublishedDataSet > & | datas, |
| double | duration ) |
发布数据集
| [in] | datas | 待发布的数据集列表 |
| [in] | duration | 发布周期,单位为 ms |