refactoors
[mTask.git] / client / task.c
index 9206a13..6e7ae0c 100644 (file)
@@ -50,9 +50,11 @@ void task_register(void)
        debug("Received a task of length %d", t->tasklength);
        t->lastrun = 0L;
        t->taskid = taskid++;
+       t->value = 0;
 
        write_byte('t');
        write16(t->taskid);
+       write16(mem_free());
        write_byte('\n');
        debug("free memory: %lu\n", mem_free());
 }
@@ -90,6 +92,10 @@ void task_delete(uint8_t c)
                }
                t = task_next(t);
        }
+        //Write deletion spec
+        write_byte('d');
+        write16(c);
+        write_byte('\n');
 
        if(t != NULL){
                //We found the task, now we move everything from the end of the task up