From: Mart Lubbers Date: Wed, 17 May 2017 10:14:07 +0000 (+0200) Subject: remove return value X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=a408afc0974b9a122d34f42afe177b08668c075c;p=mTask.git remove return value --- diff --git a/client/task.c b/client/task.c index 2b42fd8..266029f 100644 --- a/client/task.c +++ b/client/task.c @@ -29,9 +29,6 @@ void task_register(void) } - //Read return type - t->type = read_byte(); - //Read tasklength t->tasklength = read16(); debug("task interval: %d, length: %d\n", t->interval, t->tasklength); @@ -98,7 +95,6 @@ void task_delete(uint8_t c) //Write acknowledgement write_byte('d'); write16(c); - write16(t->value); write_byte('\n'); if(t != NULL){ diff --git a/mTaskInterpret.dcl b/mTaskInterpret.dcl index 63778bd..29e1fb9 100644 --- a/mTaskInterpret.dcl +++ b/mTaskInterpret.dcl @@ -21,7 +21,7 @@ from Generics.gCons import class gCons, generic conses, generic consName, generi | MTEmpty :: MTaskMSGSend - = MTTask MTaskInterval Char String + = MTTask MTaskInterval String | MTTaskDel Int | MTSds Int BCValue | MTUpd Int BCValue diff --git a/mTaskInterpret.icl b/mTaskInterpret.icl index 3b87789..5e17aeb 100644 --- a/mTaskInterpret.icl +++ b/mTaskInterpret.icl @@ -41,7 +41,7 @@ import Text.Encodings.Base64 import Tasks.Examples encode :: MTaskMSGSend -> String -encode (MTTask to ret data) = "t" +++ toByteCode to +++ toString ret +++ to16bit (size data) +++ data +++ "\n" +encode (MTTask to data) = "t" +++ toByteCode to +++ to16bit (size data) +++ data +++ "\n" encode (MTTaskDel i) = "d" +++ to16bit i +++ "\n" encode (MTSds i v) = "s" +++ to16bit i +++ toByteCode v +++ "\n" encode (MTUpd i v) = "u" +++ to16bit i +++ toByteCode v +++ "\n" @@ -74,8 +74,7 @@ instance toString MTaskInterval where instance toString MTaskMSGSend where toString (MTSds i v) = "Sds id: " +++ toString i +++ " value " +++ safePrint v - toString (MTTask to ret data) = "Task timeout: " +++ toString to - +++ " return type: " +++ toString ret + toString (MTTask to data) = "Task timeout: " +++ toString to +++ " data " +++ safePrint data toString (MTTaskDel i) = "Task delete request: " +++ toString i toString (MTUpd i v) = "Update id: " +++ toString i @@ -343,7 +342,7 @@ toMessages interval x s | not (trace_tn $ printToString newstate.sdss) = undef | not (trace_tn $ printToString newsdss) = undef = ([MTSds sdsi e\\{sdsi,sdsval=e}<-newsdss] ++ - [MTTask interval 'i' bc], newstate) + [MTTask interval bc], newstate) instance == BCShare where (==) a b = a.sdsi == b.sdsi