encode (MTTaskDel i) = "d" +++ to16bit i +++ "\n"
encode (MTSds i v) = "s" +++ to16bit i +++ v +++ "\n"
encode (MTUpd i v) = "u" +++ to16bit i +++ v +++ "\n"
+encode (MTSpec) = "c\n"
import StdDebug
decode :: String -> MTaskMSGRecv
instance fromByteCode BCValue where fromByteCode s = parseBCValue s.[0] s
instance toByteCode MTaskInterval where
- toByteCode OneShot = toByteCode 0
+ toByteCode OneShot = toByteCode (OnInterval 0)
//Intervals have the first bit 0 and the rest is a 15 bit unsigned int
toByteCode (OnInterval i) = {toChar $ i/256 bitand 127, toChar $ i rem 256}
//Intervals have the first bit 1 and the rest is a 15 bit unsigned int