.
[msc-thesis1617.git] / results.arch.tex
index 5c7c448..8470ff6 100644 (file)
@@ -470,13 +470,14 @@ shows the connection function.
 \begin{lstlisting}[label={lst:connectDevice},%
        caption={Connect a device}]
 connectDevice :: (MTaskDevice (Shared Channels) -> Task ()) MTaskDevice -> Task Channels
-connectDevice procFun device = let ch = channels device
-       in traceValue "connectDevice" >>| appendTopLevelTask 'DM'.newMap True
+connectDevice procFun device = set ([], [], False) ch
+               >>| appendTopLevelTask 'DM'.newMap True
                (       procFun device ch -||- catchAll (getSynFun device.deviceData ch) errHdl)
                >>= \tid->upd (\d->{d&deviceTask=Just tid,deviceError=Nothing}) (deviceShare device)
                >>| upd (\(r,s,ss)->(r,s++[MTSpec],ss)) ch
 where
        errHdl e = upd (\d->{d & deviceTask=Nothing, deviceError=Just e}) (deviceShare device) @! ()
+       ch = channels device
 \end{lstlisting}
 
 Figure~\ref{fig:handshake} shows the connection diagram. The client responds to