From 986a4e78ce5461dc0ada66169bb9111fb0346c46 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Thu, 7 Jun 2012 13:52:08 +0200 Subject: cleanup project structure move some subprojects fixup makefiles Signed-off-by: Manuel Traut --- io/bin/generic_gpio/generic_gpio.cpp | 45 ++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 io/bin/generic_gpio/generic_gpio.cpp (limited to 'io/bin/generic_gpio/generic_gpio.cpp') diff --git a/io/bin/generic_gpio/generic_gpio.cpp b/io/bin/generic_gpio/generic_gpio.cpp new file mode 100644 index 0000000..325cb9c --- /dev/null +++ b/io/bin/generic_gpio/generic_gpio.cpp @@ -0,0 +1,45 @@ +#include +#include + +#include + +#include + +class My_digital : public Distrio_Digital_i { + public: + ::CORBA::Long id (void) + { + return my_id; + } + void id (::CORBA::Long id) + { + my_id = id; + } + private: + ::CORBA::Long my_id; +}; + +int main (int argc, char **argv) +{ + int ret = 0; + My_digital *digital; + + if (init_corba (argc, argv)) + return -EINVAL; + + if (run_orb ()) + return -EINVAL; + + digital = new My_digital (); + + if (register_digital ("pin huhu", digital)) { + ret = -EINVAL; + goto out; + } + + std::cout << "registered id: " << digital->id () << std::endl; + +out: + free (digital); + return ret; +} -- cgit v1.2.3