summaryrefslogtreecommitdiffstats
path: root/src/uca.h
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2011-03-24 09:55:33 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2011-03-24 09:55:33 +0100
commit0e684b35d4707042bba028ce47b53d0336f662e0 (patch)
treea542c0b60b5de7b4b5ff6cf1f246183e30435208 /src/uca.h
parent146ac46ab25b3510e34b6fdeb680d4810b48a91a (diff)
downloaduca-0e684b35d4707042bba028ce47b53d0336f662e0.tar.gz
uca-0e684b35d4707042bba028ce47b53d0336f662e0.tar.bz2
uca-0e684b35d4707042bba028ce47b53d0336f662e0.tar.xz
uca-0e684b35d4707042bba028ce47b53d0336f662e0.zip
Expose synchronicity property, add boolean unit and document the error code
format
Diffstat (limited to 'src/uca.h')
-rw-r--r--src/uca.h33
1 files changed, 27 insertions, 6 deletions
diff --git a/src/uca.h b/src/uca.h
index 08aebfd..936863b 100644
--- a/src/uca.h
+++ b/src/uca.h
@@ -1,6 +1,8 @@
#ifndef __UNIFIED_CAMERA_ACCESS_H
#define __UNIFIED_CAMERA_ACCESS_H
+#include <stdint.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -103,6 +105,7 @@ enum uca_property_ids {
/* grabber specific */
UCA_PROP_GRAB_TIMEOUT,
+ UCA_PROP_GRAB_SYNCHRONOUS,
/* pco.edge specific */
UCA_PROP_TIMESTAMP_MODE,
@@ -170,6 +173,7 @@ typedef struct uca_property {
uca_rows, /**< number of rows */
uca_fps, /**< frames per second */
uca_dc, /**< degree celsius */
+ uca_bool, /**< 1 or 0 for true and false */
uca_na /**< no unit available (for example modes) */
} unit;
@@ -197,15 +201,32 @@ typedef struct uca_property {
} access;
} uca_property_t;
+union uca_value {
+ uint32_t u32;
+ uint8_t u8;
+ char *string;
+};
+
extern const char *uca_unit_map[]; /**< maps unit numbers to corresponding strings */
-/*
- * 16 bits error code
- * 4 bits error source
- * 4 bits error class
- * 4 bits reserved
- * 4 bits error level
+/**
+ * An error code is a 32 bit integer with the following format (x:y means x bits
+ * for purpose y):
+ *
+ * [ 31 (MSB) ... ... 0 (LSB) ]
+ * [ 4:lvl | 4:rsv | 4:class | 4:source | 16:code ]
+ *
+ * where
+ *
+ * - lvl describes severity such as warning or failure,
+ * - rsv is reserved,
+ * - class describes the general class of the error,
+ * - source describes where the error occured and
+ * - code is the actual error condition
+ *
+ * UCA_ERR_MASK_*s can be used to mask the desired field of the error code.
+ *
*/
#define UCA_NO_ERROR 0x00000000