diff --git a/examples/host-example-01-opencyphal-basic-node/host-example-01-opencyphal-basic-node.cpp b/examples/host-example-01-opencyphal-basic-node/host-example-01-opencyphal-basic-node.cpp index 6d4fc84f..68fb2e6c 100644 --- a/examples/host-example-01-opencyphal-basic-node/host-example-01-opencyphal-basic-node.cpp +++ b/examples/host-example-01-opencyphal-basic-node/host-example-01-opencyphal-basic-node.cpp @@ -58,8 +58,6 @@ int main(int argc, char ** argv) Node node_hdl(node_heap.data(), node_heap.size(), micros, [socket_can_fd] (CanardFrame const & frame) { return (socketcanPush(socket_can_fd, &frame, 1000*1000UL) > 0); }); std::mutex node_mtx; - PortListPublisher port_list_pub = node_hdl.create_port_list_publisher(); - Publisher heartbeat_pub = node_hdl.create_publisher (1*1000*1000UL /* = 1 sec in usecs. */); diff --git a/src/Node.cpp b/src/Node.cpp index f45f557c..c4cf1355 100644 --- a/src/Node.cpp +++ b/src/Node.cpp @@ -40,18 +40,14 @@ Node::Node(uint8_t * heap_ptr, { _canard_hdl.node_id = node_id; _canard_hdl.user_reference = static_cast(_o1heap_ins); + + _opt_port_list_pub = std::make_shared(*this, _micros_func); } /************************************************************************************** * PUBLIC MEMBER FUNCTIONS **************************************************************************************/ -PortListPublisher Node::create_port_list_publisher() -{ - _opt_port_list_pub = std::make_shared(*this, _micros_func); - return _opt_port_list_pub.value(); -} - #if __GNUC__ >= 11 Registry Node::create_registry() { diff --git a/src/Node.hpp b/src/Node.hpp index f04e9ca7..95ccaad8 100644 --- a/src/Node.hpp +++ b/src/Node.hpp @@ -76,9 +76,6 @@ class Node inline CanardNodeID getNodeId() const { return _canard_hdl.node_id; } - PortListPublisher create_port_list_publisher(); - - template Publisher create_publisher(CanardMicrosecond const tx_timeout_usec); template