From 379492ff3c10eef6479fd85418b797f97889d3f9 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Mon, 28 May 2012 17:03:11 +0200 Subject: interfaces first draft first idea of an interface description to control io s Signed-off-by: Manuel Traut --- interfaces/common.idl | 22 ++++++++++++++++++++++ interfaces/controller.idl | 17 +++++++++++++++++ interfaces/device.idl | 26 ++++++++++++++++++++++++++ interfaces/io.idl | 22 ++++++++++++++++++++++ 4 files changed, 87 insertions(+) create mode 100644 interfaces/common.idl create mode 100644 interfaces/controller.idl create mode 100644 interfaces/device.idl create mode 100644 interfaces/io.idl diff --git a/interfaces/common.idl b/interfaces/common.idl new file mode 100644 index 0000000..c3ca769 --- /dev/null +++ b/interfaces/common.idl @@ -0,0 +1,22 @@ +module common { + + enum error_code { + SUCCESS, + EINVAL, + ENOTSUPPORTED + }; + + enum error_level { + DEBUG, + INFO, + WARNING, + NORMAL, + CRITICAL + }; + + struct error { + error_code code; + error_level level; + string description; + }; +}; diff --git a/interfaces/controller.idl b/interfaces/controller.idl new file mode 100644 index 0000000..b680742 --- /dev/null +++ b/interfaces/controller.idl @@ -0,0 +1,17 @@ +include common.idl +include io.idl + +module controller { + + common.error digital (out list); + common.error analog (out list); + common.error device (out list); + + common.error register (in io.digital); + common.error register (in io.analog); + common.error register (in device.device_base); + + common.error unregister (in io.digital); + common.error unregister (in io.analog); + common.error unregister (in device.device_base); +}; diff --git a/interfaces/device.idl b/interfaces/device.idl new file mode 100644 index 0000000..1306639 --- /dev/null +++ b/interfaces/device.idl @@ -0,0 +1,26 @@ +include common.idl +include io.idl + +module device { + + enum function_id { + START; + STOP; + }; + + struct function { + string description; + int value; + enum fundtion_id id; + }; + + interface device { + common.error name (out string name); + common.error execute (in device.function); + common.error functions (out list ); + int id; + list analog; + list digital; + }; + +}; diff --git a/interfaces/io.idl b/interfaces/io.idl new file mode 100644 index 0000000..d2f95f8 --- /dev/null +++ b/interfaces/io.idl @@ -0,0 +1,22 @@ +#include "common.idl" + +module io { + + interface digital { + common.error name (out string name); + common.error set (); + common.error reset (); + common.error get (out int value); + attribute Int id; + }; + + interface analog { + common.error name (out string name); + common.error min (out int min); + common.error max (out int max); + common.error set (in int value); + common.error get (out int value); + attribute Integer id; + }; + +}; -- cgit v1.2.3