summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias@ipepdvpc2>2011-03-07 08:57:42 +0100
committerMatthias Vogelgesang <matthias@ipepdvpc2>2011-03-07 08:57:42 +0100
commitad1d96f2d0771d8657da40c80eea8703111a9e80 (patch)
treeb7347f0063efbad71d26f72bf5b4dd84502c489a
parentd3276429e07d120b5c18a66d9c6315f5fdf6c254 (diff)
downloaduca-ad1d96f2d0771d8657da40c80eea8703111a9e80.tar.gz
uca-ad1d96f2d0771d8657da40c80eea8703111a9e80.tar.bz2
uca-ad1d96f2d0771d8657da40c80eea8703111a9e80.tar.xz
uca-ad1d96f2d0771d8657da40c80eea8703111a9e80.zip
Specific error return codes for grabbers and cameras
-rw-r--r--src/cameras/pco.c4
-rw-r--r--src/cameras/pf.c4
-rw-r--r--src/grabbers/me4.c2
-rw-r--r--src/uca.c6
-rw-r--r--src/uca.h3
5 files changed, 10 insertions, 9 deletions
diff --git a/src/cameras/pco.c b/src/cameras/pco.c
index 45d0f62..ff2daff 100644
--- a/src/cameras/pco.c
+++ b/src/cameras/pco.c
@@ -202,12 +202,12 @@ uint32_t uca_pco_init(struct uca_camera_t **cam, struct uca_grabber_t *grabber)
struct pco_edge_t *pco = pco_init();
if (pco == NULL) {
- return UCA_ERR_INIT_NOT_FOUND;
+ return UCA_ERR_CAM_NOT_FOUND;
}
if ((pco->serial_ref == NULL) || !pco_is_active(pco)) {
pco_destroy(pco);
- return UCA_ERR_INIT_NOT_FOUND;
+ return UCA_ERR_CAM_NOT_FOUND;
}
struct uca_camera_t *uca = (struct uca_camera_t *) malloc(sizeof(struct uca_camera_t));
diff --git a/src/cameras/pf.c b/src/cameras/pf.c
index 76d903f..e31e882 100644
--- a/src/cameras/pf.c
+++ b/src/cameras/pf.c
@@ -171,10 +171,10 @@ uint32_t uca_pf_init(struct uca_camera_t **cam, struct uca_grabber_t *grabber)
{
int num_ports;
if (pfPortInit(&num_ports) < 0)
- return UCA_ERR_INIT_NOT_FOUND;
+ return UCA_ERR_CAM_NOT_FOUND;
if (pfDeviceOpen(0) < 0)
- return UCA_ERR_INIT_NOT_FOUND;
+ return UCA_ERR_CAM_NOT_FOUND;
/* We could check if a higher baud rate is supported, but... forget about
* it. We don't need high speed configuration. */
diff --git a/src/grabbers/me4.c b/src/grabbers/me4.c
index b52b48f..4cdb14a 100644
--- a/src/grabbers/me4.c
+++ b/src/grabbers/me4.c
@@ -91,7 +91,7 @@ uint32_t uca_me4_init(struct uca_grabber_t **grabber)
/* FIXME: find out if this board/grabber is running */
Fg_Struct *fg = Fg_Init("libFullAreaGray8.so", 0);
if (fg == NULL)
- return UCA_ERR_INIT_NOT_FOUND;
+ return UCA_ERR_GRABBER_NOT_FOUND;
struct uca_grabber_t *uca = (struct uca_grabber_t *) malloc(sizeof(struct uca_grabber_t));
struct uca_me4_grabber_t *me4 = (struct uca_me4_grabber_t *) malloc(sizeof(struct uca_me4_grabber_t));
diff --git a/src/uca.c b/src/uca.c
index 39b45b4..b70c25a 100644
--- a/src/uca.c
+++ b/src/uca.c
@@ -53,7 +53,7 @@ static struct uca_property_t property_map[UCA_PROP_LAST+1] = {
{ NULL, 0, 0 }
};
-struct uca_t *uca_init()
+struct uca_t *uca_init(void)
{
struct uca_t *uca = (struct uca_t *) malloc(sizeof(struct uca_t));
uca->cameras = NULL;
@@ -89,7 +89,7 @@ struct uca_t *uca_init()
while (grabber_inits[i] != NULL) {
uca_grabber_init init = grabber_inits[i];
/* FIXME: we don't only want to take the first one */
- if (init(&grabber) != UCA_ERR_INIT_NOT_FOUND)
+ if (init(&grabber) != UCA_ERR_GRABBER_NOT_FOUND)
break;
i++;
}
@@ -105,7 +105,7 @@ struct uca_t *uca_init()
while (cam_inits[i] != NULL) {
struct uca_camera_t *cam = NULL;
uca_cam_init init = cam_inits[i];
- if (init(&cam, grabber) != UCA_ERR_INIT_NOT_FOUND) {
+ if (init(&cam, grabber) != UCA_ERR_CAM_NOT_FOUND) {
if (current == NULL)
uca->cameras = current = cam;
else {
diff --git a/src/uca.h b/src/uca.h
index c65d509..9c17b86 100644
--- a/src/uca.h
+++ b/src/uca.h
@@ -119,7 +119,8 @@ struct uca_property_t {
enum uca_errors {
UCA_NO_ERROR = 0,
- UCA_ERR_INIT_NOT_FOUND, /**< camera probing or initialization failed */
+ UCA_ERR_GRABBER_NOT_FOUND,
+ UCA_ERR_CAM_NOT_FOUND, /**< camera probing or initialization failed */
UCA_ERR_PROP_INVALID, /**< the requested property is not supported by the camera */
UCA_ERR_PROP_GENERAL, /**< error occured reading/writing the property */
UCA_ERR_PROP_VALUE_OUT_OF_RANGE, /**< error occured writing the property */