From 2a81bd3d5cc7f6653adef9f6653ff4a20709b0d7 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Sun, 23 Sep 2012 21:23:08 +0200 Subject: client/test: test client to lookup devices /functions etc Signed-off-by: Manuel Traut --- clients/test/test.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 clients/test/test.cpp (limited to 'clients/test/test.cpp') diff --git a/clients/test/test.cpp b/clients/test/test.cpp new file mode 100644 index 0000000..5758d55 --- /dev/null +++ b/clients/test/test.cpp @@ -0,0 +1,41 @@ +#include +#include + +#include + +#include + +ACE_TMAIN (int argc, ACE_TCHAR *argv[]) +{ + int ret = 0; + Distrio::Device_list_var devs; + Distrio::Device *dev; + Distrio::Dev_function_list_var funcs; + ::CORBA::String_var name; + + if (init_corba (argc, argv)) + return -EINVAL; + + if (run_orb ()) + return -EINVAL; + + get_device_list (&devs); + if (lookup_device ("simple_dev", devs, &dev)) { + std::cerr << "unable to get requested device" << std::endl; + goto out; + } + + /* TODO: do sth */ + dev->functions(funcs.out ()); + + for (unsigned int i = 0; i < funcs->length (); i++) + { + std::cout << funcs[i].description << std::endl; + } + + join_orb (); + +out: + free (dev); + return ret; +} -- cgit v1.2.3