]> rtime.felk.cvut.cz Git - coffee/mt-apps.git/commitdiff
remove timer remnants
authorJiří Matěják <jiri.matejak@fel.cvut.cz>
Thu, 26 Apr 2018 16:02:34 +0000 (18:02 +0200)
committerJiří Matěják <jiri.matejak@fel.cvut.cz>
Thu, 26 Apr 2018 16:02:34 +0000 (18:02 +0200)
mt_rfid.c
mt_server.c

index 4f3b07c5d7c8d9dfa4e790cf4c783491b793c7ec..1954b02210840a54aa8f5e3b9dd022cf08df1dd9 100644 (file)
--- a/mt_rfid.c
+++ b/mt_rfid.c
@@ -1,6 +1,5 @@
 /**
  * mt_rfid.c
- * poll the uFR reader and print JSON formatted card info to stdout.
  */
 
 // shit to avoid constant repetition
index fb5eb1b22410382748a95519bdf1bc88ff7619c6..76485d708dc8447ab0059a24f66d98580d28daac 100644 (file)
@@ -5,6 +5,8 @@
 #include "mt_server.h"
 #include "ev_signal_exit.h"
 
+#define JSON_EMPTY "{\"type\":\"empty\"}"
+
 static const struct lws_http_mount mount = {
     /* .mount_next */            NULL,         /* linked-list "next" */
     /* .mountpoint */            "/",          /* mountpoint URL */
@@ -39,8 +41,6 @@ typedef struct per_session_data__dumb_increment {
     int number;
 } per_session_data__dumb_increment;
 
-#define JSON_EMPTY "{\"type\":\"empty\"}"
-
 enum protocols {
     PROTOCOL_HTTP = 0, // always first
     PROTOCOL_MERICA_TERMINAL
@@ -50,8 +50,7 @@ static int callback_merica_terminal(struct lws *wsi,
                                     enum lws_callback_reasons reason,
                                     void *user, void *in, size_t len);
 
-/* list of supported protocols and callbacks */
-
+// list of supported protocols and callbacks
 static struct lws_protocols protocols[] = {
     /* first protocol must always be HTTP handler */
     {"http", lws_callback_http_dummy, 0, 0},
@@ -132,13 +131,6 @@ static int callback_merica_terminal(struct lws *wsi,
     return 0;
 }
 
-/*static void ev_timeout_cb(EV_P_ ev_timer *w, int revents)
-{
-    lws_callback_on_writable_all_protocol(context,
-                                          &protocols[PROTOCOL_MERICA_TERMINAL]);
-}*/
-
-
 static void fd_cb(EV_P_ ev_io *w_, int revents)
 {
     ev_io_ws *w = (ev_io_ws *)w_;
@@ -153,7 +145,6 @@ static void fd_cb(EV_P_ ev_io *w_, int revents)
         lws_callback_on_writable_all_protocol(w->context,
                                               &protocols[PROTOCOL_MERICA_TERMINAL]);
     }
-
 }
 
 int mt_server_init(mt_server_t *self, struct ev_loop *loop, int fd)
@@ -201,7 +192,7 @@ void mt_server_deinit(mt_server_t *self)
 #ifdef IS_MAIN
 int main(int argc, const char **argv)
 {
-    struct ev_loop *loop = ev_default_loop(0);
+    struct ev_loop *loop = EV_DEFAULT;
     mt_server_t server;
 
     set_signal_exit(loop);
@@ -210,10 +201,6 @@ int main(int argc, const char **argv)
         return -1;
     }
 
-    //ev_timer timeout_watcher;
-    //ev_timer_init(&timeout_watcher, ev_timeout_cb, 1, 1);
-    //ev_timer_start(loop, &timeout_watcher);
-
     ev_run(loop, 0);
 
     mt_server_deinit(&server);