X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=arch.example.tex;h=c905ead0a23eaca28605d476d771df59610c2bf7;hb=1e84022436ed2b1dbb12382aea375196f0324570;hp=ad8c4db4396f4389ab631143aeb9e5beffeed009;hpb=f9f65d0883aeab3d3913c7cfb29def4c12df994e;p=msc-thesis1617.git diff --git a/arch.example.tex b/arch.example.tex index ad8c4db..c905ead 100644 --- a/arch.example.tex +++ b/arch.example.tex @@ -39,7 +39,7 @@ thermos = makeDevice "nodeM" nodeMCU >>= connectDevice >>= \stm-> sendTaskToDevice "sensing" sensing (nod, OnInterval 1000) >>= \(st, [t])->sendTaskToDevice "acting" acting (stm, OnInterval 1000) (\(BCValue s)->set (BCValue $ dynInt (dynamic s) > 0) (shareShare nod a)) - >>| treturn () + >>* [OnAction (Action "Shutdown") $ always $ deleteDevice nod >>| deleteDevice stm >>| shutDown 0] where dynInt :: Dynamic -> Int dynInt (a :: Int) = a @@ -137,7 +137,6 @@ functionality. | BCValidHB | BCGetSP02 | BCValidSP02 - | ... instance hb ByteCode where getHb = tell` [BCGetHB] @@ -150,6 +149,11 @@ instance hb ByteCode where The bytecode instructions are added but still the functionality needs to be added to the device interface to be implemented by clients. The following addition to \CI{interface.h} and the interpreter shows the added instructions. +When adding a peripheral, the devices not having the peripheral do not need to +have their code recompiled. New instructions always get a higher bytecode +number if added correctly. The peripheral byte in the device specification by +default shows a negative flag for every peripheral. Only the peripherals added +will be flagged positive. \begin{lstlisting}[caption={Adding the device interface}] // interface.h