summaryrefslogtreecommitdiff
path: root/clients/test/test.cpp
blob: 5758d55a7b555777d5ed123b9e414f8f97a5a42d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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;
}