summaryrefslogtreecommitdiff
path: root/io/bin/generic_gpio/generic_gpio.cpp
diff options
context:
space:
mode:
authorManuel Traut <manut@mecka.net>2012-06-07 13:52:08 +0200
committerManuel Traut <manut@mecka.net>2012-06-07 13:52:08 +0200
commit986a4e78ce5461dc0ada66169bb9111fb0346c46 (patch)
treeff2c7cf1740688313547190fa7626e4543483538 /io/bin/generic_gpio/generic_gpio.cpp
parente84faa1a220ebdcf79a3d95e539dfc8d86a8c460 (diff)
cleanup project structure
move some subprojects fixup makefiles Signed-off-by: Manuel Traut <manut@mecka.net>
Diffstat (limited to 'io/bin/generic_gpio/generic_gpio.cpp')
-rw-r--r--io/bin/generic_gpio/generic_gpio.cpp45
1 files changed, 45 insertions, 0 deletions
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 <distrio_helper.h>
+#include <distrio_error.h>
+
+#include <distrio_ioI.h>
+
+#include <iostream>
+
+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;
+}