summaryrefslogtreecommitdiff
path: root/interfaces/common.idl
blob: e934b66d283382602c7208db542169d8ed997103 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef DISTRIO_COMMON_IDL
#define DISTRIO_COMMON_IDL

/**
 * @brief shared between different modules
 *
 * - definitions for error handling
 *
 * @author Manuel Traut <manut@mecka.net>
 * @copyright GPLv2
 *
 */
module Common {

/**
 * @brief kind of error
 */
	enum Error_code {
		SUCCESS,
		EINVAL,
		ENOTSUPPORTED
	};

/**
 * @brief used for filtering and classification
 */
	enum Error_level {
		DEBUG,
		INFO,
		WARNING,
		NORMAL,
		CRITICAL
	};

/**
 * @brief describes when the error was detected
 *  (it's helpful to sync all boards with ntp)
 */
	struct Error_timestamp {
		longlong seconds;
		long nanoseconds;
	};

/**
 * @brief description of an error
 */
	struct Error {
		Error_code code;
		Error_level level;
		Error_timestamp time;
		/** id of the digital/analog IO or the IO device */
		long module_id;
		/** a human readable description which can be displayed in GUIs */
		string description;
	};

};

#endif