>>= \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
| BCValidHB
| BCGetSP02
| BCValidSP02
- | ...
instance hb ByteCode where
getHb = tell` [BCGetHB]
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