diff options
| author | Manuel Traut <manut@mecka.net> | 2012-06-02 16:54:02 +0200 |
|---|---|---|
| committer | Manuel Traut <manut@mecka.net> | 2012-06-02 16:54:02 +0200 |
| commit | 1c4fbd35ba335ed338a680fdffc0db6de576a7a4 (patch) | |
| tree | a47a104df1ae516c040b1319e871db5c8d964a35 | |
| parent | 55b366883c41550f8eced0d4b87e0957a744daf8 (diff) | |
complete renaming in idl files
- all idl files are now in the same module 'distrio'
Signed-off-by: Manuel Traut <manut@mecka.net>
| -rw-r--r-- | interfaces/common.idl | 4 | ||||
| -rw-r--r-- | interfaces/io.idl | 34 | ||||
| -rw-r--r-- | interfaces/manager.idl | 51 |
3 files changed, 70 insertions, 19 deletions
diff --git a/interfaces/common.idl b/interfaces/common.idl index e934b66..ded0d1e 100644 --- a/interfaces/common.idl +++ b/interfaces/common.idl @@ -10,7 +10,7 @@ * @copyright GPLv2 * */ -module Common { +module Distrio { /** * @brief kind of error @@ -37,7 +37,7 @@ module Common { * (it's helpful to sync all boards with ntp) */ struct Error_timestamp { - longlong seconds; + long seconds; long nanoseconds; }; diff --git a/interfaces/io.idl b/interfaces/io.idl index 80d8114..27f9ae8 100644 --- a/interfaces/io.idl +++ b/interfaces/io.idl @@ -11,7 +11,7 @@ * @copyright GPLv2 */ -module IO { +module Distrio { interface Device; @@ -25,15 +25,15 @@ module IO { /** a digital input or output pin */ interface Digital { /** get the name of the hardware which is connected to this pin */ - Common::Error name (out string name); + Distrio::Error name (out string name); /** set this pin (fails if it's a digital input) */ - Common::Error set (); + Distrio::Error set (); /** reset this pin (fails if it's a digital input) */ - Common::Error reset (); + Distrio::Error reset (); /** get the value of the pin ( 0 = reset, rest = set */ - Common::Error get (out long value); + Distrio::Error get (out long value); /** register a callback that is called if the state of the pin changes */ - Common::Error register_callback (in Device dev, in Digital_trigger trigger); + Distrio::Error register_callback (in Device dev, in Digital_trigger trigger); /** the id is given by Controller::Manager during registration */ attribute long id; }; @@ -51,17 +51,17 @@ module IO { /** an analog input or output pin */ interface Analog { /** name of the hardware which is connected to the pin */ - Common::Error name (out string name); + Distrio::Error name (out string name); /** minimum allowed value */ - Common::Error min (out long min); + Distrio::Error min (out long min); /** maximum allowd value */ - Common::Error max (out long max); + Distrio::Error max (out long max); /** set new value (may fail if out of range or pin is an input) */ - Common::Error set (in long value); + Distrio::Error set (in long value); /** get analog value of the pin */ - Common::Error get (out long value); + Distrio::Error get (out long value); /** register a callback that is called if the trigger matches */ - Common::Error register_callback (in Device dev, in Analog_trigger trigger); + Distrio::Error register_callback (in Device dev, in Analog_trigger trigger); attribute long id; }; @@ -87,19 +87,19 @@ module IO { */ interface Device { /** name of the device */ - Common::Error name (out string name); + Distrio::Error name (out string name); /** to execute a device specific function pass the Dev_function descriotion * (retrived by (functions ()) as parameter */ - Common::Error execute (in Dev_function func); + Distrio::Error execute (in Dev_function func); /** returns all device specific function descriptions */ - Common::Error functions (out Dev_function_list funcs); + Distrio::Error functions (out Dev_function_list funcs); /** called by the Digital object if this object is registered as a * callback and the trigger hits */ - Common::Error callback_digital (in Digital io_dig); + Distrio::Error callback_digital (in Digital io_dig); /** called by the Digital object if this object is registered as a * callback and the trigger hits */ - Common::Error callback_analog (in Analog io_ana); + Distrio::Error callback_analog (in Analog io_ana); /** ID is given by Controller::Manager during registration */ attribute long id; }; diff --git a/interfaces/manager.idl b/interfaces/manager.idl new file mode 100644 index 0000000..f1dffa1 --- /dev/null +++ b/interfaces/manager.idl @@ -0,0 +1,51 @@ +#ifndef DISTRDistrio_CONTROLLER_IDL +#define DISTRDistrio_CONTROLLER_IDL + +#include "common.idl" +#include "io.idl" + +/** + * @brief logical view of IO's and Devices (not HW specific) + * + * @author Manuel Traut <manut@mecka.net> + * @copyright GPLv2 + */ + +module Distrio { + +/** + * @brief manage io/device lists, error handling + * + * - all modules need to register their IO's and devices + * - registered IO's and devices can be obtained + */ + interface Manager { + /** returns list of registered digital IO's */ + Distrio::Error digital (out Distrio::Digital_list io_list); + /** returns list of registered analog IO's */ + Distrio::Error analog (out Distrio::Analog_list io_list); + /** returns list of registered devices */ + Distrio::Error device (out Distrio::Device_list dev_list); + /** register a digital io */ + Distrio::Error register_io_digital (in Distrio::Analog io_ana); + /** register a analog io */ + Distrio::Error register_io_analog (in Distrio::Digital io_dig); + /** register a device */ + Distrio::Error register_io_device (in Distrio::Device io_dev); + /** unregister a digital io */ + Distrio::Error unregister_io_digital (in Distrio::Digital io_dig); + /** unregister a analog io */ + Distrio::Error unregister_io_analog (in Distrio::Analog io_ana); + /** unregister a device */ + Distrio::Error unregister_io_device (in Distrio::Device io_dev); + /** used by modules to send errors to a central point + * The implementation of this function could: + * - thispatch errors to a GUI + * - log the errors e.g. with log4* + */ + void log_error (in Distrio::Error error); + }; + +}; + +#endif |
