diff options
| author | Manuel Traut <manut@mecka.net> | 2012-06-07 23:56:05 +0200 |
|---|---|---|
| committer | Manuel Traut <manut@mecka.net> | 2012-06-07 23:56:05 +0200 |
| commit | 297e389057b702bbeb99139a8c248cfccfc0724e (patch) | |
| tree | 20c6e79d452ef505084712becf5093c105c0f9a4 /devices | |
| parent | e3f225cd4fb60437d94288849f7af03179d56f6b (diff) | |
digital out can now be controlled by simple_device
- extended libdistrio_common to enable easy access
Signed-off-by: Manuel Traut <manut@mecka.net>
Diffstat (limited to 'devices')
| -rw-r--r-- | devices/simple_dev/simple_dev.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/devices/simple_dev/simple_dev.cpp b/devices/simple_dev/simple_dev.cpp index ca31b6e..6e57e94 100644 --- a/devices/simple_dev/simple_dev.cpp +++ b/devices/simple_dev/simple_dev.cpp @@ -15,6 +15,9 @@ class My_device : public Distrio_Device_i { { my_id = id; } + + ::Distrio::Digital_list_var digitals; + private: ::CORBA::Long my_id; }; @@ -40,7 +43,22 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) std::cout << "registered id: " << dev->id () << std::endl; - digital_io = lookup_digital ("pin huhu"); + get_digital_list (&dev->digitals); + lookup_digital ("pin huhu", dev->digitals, &digital_io); + + std::cout << "digital io app: " << digital_io << std::endl; + + while (1) + { + try { + digital_io->set (); + sleep (1); + digital_io->reset (); + sleep (1); + } catch (::CORBA::Exception *ex) { + std::cerr << "sth went wrong " << ex << std::endl; + } + } out: free (dev); |
