]> rtime.felk.cvut.cz Git - coffee/mt-apps.git/blobdiff - mt_aio.c
mt_server: Use "%s" format string in syslog()
[coffee/mt-apps.git] / mt_aio.c
index e01de28843e3d582b2b1d02977f117bd70134b87..076d49d44138c328cc1433695b30b7e8c2836140 100644 (file)
--- a/mt_aio.c
+++ b/mt_aio.c
@@ -3,6 +3,8 @@
 #include "mt_keys.h"
 #include "mt_server.h"
 #include "signal_exit.h"
+#include "mt_blank.h"
+#include "mt_sim.h"
 
 int main(int argc, char **argv)
 {
@@ -19,6 +21,7 @@ int main(int argc, char **argv)
 
     set_signal_exit(loop);
 
+#if !defined(SIM)
     if (mt_rfid_init(&rfid, loop, pipefd[1]) != 0) {
         return -1;
     }
@@ -27,6 +30,15 @@ int main(int argc, char **argv)
         return -1;
     }
 
+    if (mt_blank_init(loop) != 0) {
+        return -3;
+    }
+#else
+    if (mt_sim_init(loop, pipefd[1]) != 0) {
+        return -1;
+    }
+#endif
+
     if (mt_server_init(&server, loop, pipefd[0]) != 0) {
         return -2;
     }
@@ -34,8 +46,13 @@ int main(int argc, char **argv)
     ev_run(loop, 0);
 
     mt_server_deinit(&server);
+#if !defined(SIM)
     mt_keys_deinit(&keys);
     mt_rfid_deinit(&rfid);
+#else
+    mt_sim_deinit();
+#endif
+    ev_loop_destroy(loop);
 
     return 0;
 }