]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
displayd: Display camera status
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 21 May 2010 11:21:19 +0000 (13:21 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 21 May 2010 11:21:19 +0000 (13:21 +0200)
src/displayd/displayd.c

index 4e984d2b2041b263db44cde539877381404d6059..f7738c868d2a5be5574024d40adef0894558af08 100644 (file)
@@ -236,10 +236,13 @@ void rcv_camera_result_cb(const ORTERecvInfo *info, void *vinstance,
        UDE_hw_status_t status = STATUS_FAILED;
        static UDE_hw_status_t last_status;
        static struct timespec last_sent;
-       //struct camera_result_type *instance = (struct camera_result_type *)vinstance;
+       struct camera_result_type *instance = (struct camera_result_type *)vinstance;
        switch (info->status) {
                case NEW_DATA:
-                       status = STATUS_OK;
+                       if (instance->error == 0)
+                               status = STATUS_OK;
+                       else
+                               status = STATUS_WARNING;
                        break;
                case DEADLINE:
                        status = STATUS_FAILED;
@@ -251,6 +254,7 @@ void rcv_camera_result_cb(const ORTERecvInfo *info, void *vinstance,
                clock_gettime(CLOCK_MONOTONIC, &last_sent);
        }
        last_status = status;
+       /* TODO: Show recognized corns  */
 }
 
 void rcv_hokuyo_scan_cb(const ORTERecvInfo *info, void *vinstance,