Skip to content

Commit

Permalink
Merge branch 'issue-441' into 'main'
Browse files Browse the repository at this point in the history
fix ifm3d discovery issue on linux

Closes #271

See merge request syntron/support/csr/ifm3d/ifm3d!356
  • Loading branch information
vksgaikwad3 committed Feb 2, 2024
2 parents 2eab41e + 446a0ee commit c2335a6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions modules/device/src/libifm3d_device/discovery.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,25 @@ namespace ifm3d
{
device_list_.clear();

#ifdef __unix__

/* Creating universal listener udp connecton */
asio::ip::udp::endpoint endpoint(asio::ip::address_v4::any(),
BCAST_DEFAULT_PORT);
auto con = std::make_shared<UDPConnection>(io_context_, endpoint);

con->RegisterOnReceive(std::bind(&IFMDeviceDiscovery::_OnReceive,
this,
std::placeholders::_1,
std::placeholders::_2,
std::placeholders::_3));
con->RegisterOnClose(std::bind(&IFMDeviceDiscovery::_RemoveConnection,
this,
std::placeholders::_1));

connection_list_.push_back(con);
#endif

try
{
auto addresses = _GetAllInterfaceAddress();
Expand Down
2 changes: 1 addition & 1 deletion modules/tools/src/libifm3d_tools/discover_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
ifm3d::DiscoverApp::DiscoverApp(int argc,
const char** argv,
const std::string& name)
: ifm3d::CmdLineApp(argc, argv, name)
: ifm3d::CmdLineApp(argc, argv, name, false)
{}

int
Expand Down

0 comments on commit c2335a6

Please sign in to comment.