diff options
| -rw-r--r-- | generic_gpio/generic_gpio.cpp | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/generic_gpio/generic_gpio.cpp b/generic_gpio/generic_gpio.cpp index 3287578..325cb9c 100644 --- a/generic_gpio/generic_gpio.cpp +++ b/generic_gpio/generic_gpio.cpp @@ -1,23 +1,43 @@ #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; - Distrio_Digital_i *digital; + My_digital *digital; if (init_corba (argc, argv)) return -EINVAL; - digital = new Distrio_Digital_i (); + if (run_orb ()) + return -EINVAL; + + digital = new My_digital (); if (register_digital ("pin huhu", digital)) { ret = -EINVAL; goto out; } - if (run_orb ()) - ret = -EINVAL; + std::cout << "registered id: " << digital->id () << std::endl; out: free (digital); |
