diff --git a/package.xml b/package.xml index cbfb24173cd..ff3fdb55fe5 100644 --- a/package.xml +++ b/package.xml @@ -4,7 +4,7 @@ fastdds 3.1.0 - *eprosima Fast DDS* is a C++ implementation of the DDS (Data Distribution Service) standard of the OMG (Object Management Group). eProsima Fast DDS implements the RTPS (Real Time Publish Subscribe) protocol, which provides publisher-subscriber communications over unreliable transports such as UDP, as defined and maintained by the Object Management Group (OMG) consortium. RTPS is also the wire interoperability protocol defined for the Data Distribution Service (DDS) standard. *eProsima Fast DDS* expose an API to access directly the RTPS protocol, giving the user full access to the protocol internals. + eProsima Fast DDS is a C++ implementation of the DDS (Data Distribution Service) standard of the OMG (Object Management Group). eProsima Fast DDS implements the RTPS (Real Time Publish Subscribe) protocol, which provides publisher-subscriber communications over unreliable transports such as UDP, as defined and maintained by the Object Management Group (OMG) consortium. RTPS is also the wire interoperability protocol defined for the Data Distribution Service (DDS) standard. eProsima Fast DDS expose an API to access directly the RTPS protocol, giving the user full access to the protocol internals. Raul Sanchez Mateos Miguel Company diff --git a/test/system/tools/fastdds/CMakeLists.txt b/test/system/tools/fastdds/CMakeLists.txt index 4a9321a42b0..e991b76a70c 100644 --- a/test/system/tools/fastdds/CMakeLists.txt +++ b/test/system/tools/fastdds/CMakeLists.txt @@ -26,6 +26,7 @@ if(Python3_Interpreter_FOUND) set(TESTS test_fastdds_installed + test_fastdds_version test_fastdds_discovery test_ros_discovery test_fastdds_shm diff --git a/test/system/tools/fastdds/tests.py b/test/system/tools/fastdds/tests.py index ea9b4c312f3..f9365136fd5 100644 --- a/test/system/tools/fastdds/tests.py +++ b/test/system/tools/fastdds/tests.py @@ -96,6 +96,13 @@ def test_fastdds_installed(install_path): print('test_fastdds_installed FAILED') sys.exit(ret) +def test_fastdds_version(install_path): + """Test that fastdds version is printed correctly.""" + args = '-v' + ret = subprocess.call(cmd(install_path, args=args), shell=True) + if 0 != ret: + print('test_fastdds_version FAILED') + sys.exit(ret) def test_fastdds_shm(install_path): """Test that shm command runs.""" @@ -198,6 +205,8 @@ def get_paths(install_path): tests = { 'test_fastdds_installed': lambda: test_fastdds_installed(fastdds_tool_path), + 'test_fastdds_version': + lambda: test_fastdds_version(fastdds_tool_path), 'test_fastdds_discovery': lambda: test_fastdds_discovery( fastdds_tool_path, setup_script_path), 'test_ros_discovery': diff --git a/tools/fastdds/discovery/parser.py b/tools/fastdds/discovery/parser.py index 8446698e89e..2d57f5d0b29 100644 --- a/tools/fastdds/discovery/parser.py +++ b/tools/fastdds/discovery/parser.py @@ -54,6 +54,13 @@ def __init__(self, argv): (len(argv) == 1 and argv[0] == '--help') ): print(self.__edit_tool_help(result.stdout)) + elif ( + (len(argv) == 1 and argv[0] == '-v') or + (len(argv) == 1 and argv[0] == '--version') + ): + result = subprocess.run([tool_path, '-v']) + if result.returncode != 0: + sys.exit(result.returncode) else: # Call the tool result = subprocess.run([tool_path] + argv) diff --git a/tools/fastdds/fastdds.py b/tools/fastdds/fastdds.py index c5b632d765a..a380c54138a 100755 --- a/tools/fastdds/fastdds.py +++ b/tools/fastdds/fastdds.py @@ -78,6 +78,7 @@ def __init__(self): parser.add_argument('command', nargs='?', help='Command to run') + parser.add_argument('-v', '--version', action='store_true', help='Print Fast DDS version') args = parser.parse_args(sys.argv[1:2]) @@ -86,6 +87,8 @@ def __init__(self): print('Invalid command') else: getattr(self, args.command)() + elif args.version: + DiscoveryParser(['-v']) else: parser.print_help() @@ -122,7 +125,6 @@ def xml(self): except ImportError: sys.exit(1) - if __name__ == '__main__': FastDDSParser() diff --git a/tools/fds/server.cpp b/tools/fds/server.cpp index 09098ddddfa..c233047b7dd 100644 --- a/tools/fds/server.cpp +++ b/tools/fds/server.cpp @@ -13,6 +13,7 @@ // limitations under the License. #include "server.h" +#include #include #include @@ -109,6 +110,13 @@ int fastdds_discovery_server( return 0; } + // Show version if asked to + if (options[VERSION]) + { + std::cout << "Fast DDS version: " << FASTDDS_VERSION_STR << std::endl; + return 0; + } + DomainParticipantQos participantQos; if (nullptr != options[XML_FILE]) diff --git a/tools/fds/server.h b/tools/fds/server.h index 4f794c3755e..1f51b09c070 100644 --- a/tools/fds/server.h +++ b/tools/fds/server.h @@ -25,6 +25,7 @@ enum optionIndex { UNKNOWN, HELP, + VERSION, SERVERID, UDPADDRESS, UDP_PORT, @@ -62,6 +63,9 @@ const option::Descriptor usage[] = { { HELP, 0, "h", "help", Arg::None, " -h \t--help Produce help message.\n" }, + { VERSION, 0, "v", "version", Arg::None, + " -v \t--version Show Fast DDS version information.\n" }, + { UDPADDRESS, 0, "l", "udp-address", Arg::OptionalAny, " -l \t--udp-address IPv4/IPv6 address chosen to listen the clients. Defaults\n" "\t to any (0.0.0.0/::0). Instead of an address, a name can\n"