diff options
| author | Manuel Traut <manut@mecka.net> | 2012-09-23 21:23:08 +0200 |
|---|---|---|
| committer | Manuel Traut <manut@mecka.net> | 2012-09-23 21:23:08 +0200 |
| commit | 2a81bd3d5cc7f6653adef9f6653ff4a20709b0d7 (patch) | |
| tree | b4b11094534907acb27272e4ea3c10cf6b75bda3 /clients/test/test.cpp | |
| parent | bdf4c406cd80fe0e25df68ef98a8b626093290c4 (diff) | |
client/test: test client to lookup devices /functions etc
Signed-off-by: Manuel Traut <manut@mecka.net>
Diffstat (limited to 'clients/test/test.cpp')
| -rw-r--r-- | clients/test/test.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
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 <distrio_helper.h> +#include <distrio_error.h> + +#include <distrio_io.h> + +#include <iostream> + +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; +} |
