}
- //Read return type
- t->type = read_byte();
-
//Read tasklength
t->tasklength = read16();
debug("task interval: %d, length: %d\n", t->interval, t->tasklength);
//Write acknowledgement
write_byte('d');
write16(c);
- write16(t->value);
write_byte('\n');
if(t != NULL){
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"
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
| 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