X-Git-Url: https://rtime.felk.cvut.cz/gitweb/coffee/mt-apps.git/blobdiff_plain/9d863c8bfc9ff0c90f44ee5ca88956a331e1bd9f..HEAD:/mt_aio.c diff --git a/mt_aio.c b/mt_aio.c index e01de28..076d49d 100644 --- 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; }