diff --git a/libuavcan_drivers/linux/test/test_nodetool.cpp b/libuavcan_drivers/linux/test/test_nodetool.cpp index 25eb5a0c25..b16039522a 100644 --- a/libuavcan_drivers/linux/test/test_nodetool.cpp +++ b/libuavcan_drivers/linux/test/test_nodetool.cpp @@ -14,6 +14,7 @@ #include #include +#include namespace { @@ -189,6 +190,20 @@ void executeCommand(const uavcan_linux::NodePtr& node, const std::string& cmd, uavcan_linux::BlockingServiceClient client(*node); std::cout << call(client, node_id, uavcan::protocol::GetTransportStats::Request()) << std::endl; } + else if (cmd == "hardpoint") + { + uavcan::equipment::hardpoint::Command msg; + msg.command = std::stoi(args.at(0)); + auto pub = node->makePublisher(); + if (node_id.isBroadcast()) + { + (void)pub->broadcast(msg); + } + else + { + (void)pub->unicast(msg, node_id); + } + } else { std::cout << "Invalid command" << std::endl;