Skip to content

Commit

Permalink
cleaning discovery startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Bonani committed Oct 13, 2020
1 parent d60efe4 commit 8ba9a07
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aseba/thymio-device-manager/aseba_node_registery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,13 @@ aseba_node_registery::node_map aseba_node_registery::nodes() const {

void aseba_node_registery::set_tcp_endpoint(const boost::asio::ip::tcp::endpoint& endpoint) {
m_nodes_service_desc.endpoint(endpoint);
update_discovery();
}

void aseba_node_registery::set_ws_endpoint(const boost::asio::ip::tcp::endpoint& endpoint) {
m_ws_endpoint = endpoint;
}

void aseba_node_registery::set_discovery() {
update_discovery();
}

Expand Down
1 change: 1 addition & 0 deletions aseba/thymio-device-manager/aseba_node_registery.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class aseba_node_registery : public boost::asio::detail::service_base<aseba_node

void set_tcp_endpoint(const boost::asio::ip::tcp::endpoint& endpoint);
void set_ws_endpoint(const boost::asio::ip::tcp::endpoint& endpoint);
void set_discovery();

node_map nodes() const;
std::shared_ptr<aseba_node> node_from_id(const node_id&) const;
Expand Down
3 changes: 3 additions & 0 deletions aseba/thymio-device-manager/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ void run_service(boost::asio::io_context& ctx) {
mobsya::application_server<mobsya::websocket_t> websocket_server(ctx, 8597);
node_registery.set_ws_endpoint(websocket_server.endpoint());
websocket_server.accept();

// Enable Bonjour, Zeroconf
node_registery.set_discovery();


#ifdef MOBSYA_TDM_ENABLE_USB
Expand Down

0 comments on commit 8ba9a07

Please sign in to comment.