update device name instead of record
[mTask.git] / client / main.c
index 1818238..720fd1a 100644 (file)
@@ -11,6 +11,7 @@
 #include "interpret.h"
 #include "mTaskSymbols.h"
 #include "sds.h"
+#include "spec.h"
 #include "task.h"
 #include "interface.h"
 
@@ -19,6 +20,7 @@
 #define MSG_SDS_SPEC 's'
 #define MSG_SDS_DEL 'a'
 #define MSG_SDS_UPD 'u'
+#define MSG_SPEC 'c'
 
 void read_message(void)
 {
@@ -48,7 +50,12 @@ void read_message(void)
                        debug("Receiving a task");
                        task_register();
                        break;
+               case MSG_SPEC:
+                       debug("Receiving a spec request");
+                       spec_send();
+                       break;
                case '\0':
+                       debug("Server closed connection");
                        break;
                case '\n':
                        break;
@@ -104,11 +111,11 @@ int main(int argc, char *argv[]){
        setup();
        sds_init();
        task_init();
-       debug("booting up");
+       debug("sending device spec");
        while(true){
                //Check for newetasks
                loop();
-               delay(50);
+               delay(100);
        }
        return 0;
 }