\todo{Explain specification, combine task and share space}
\subsection{Communication}
+The communication to and fro a device runs via a single \gls{SDS}. Every
+device has a specific resource that is used to connect to the device. The
+current system supports connecting devices via a serial connection and via a
+\gls{TCP} connection. Every device has the type \CI{MTaskDevice} and which
+is listed in Listing~\ref{lst:mtaskdevice}. When a device is added a background
+task is started that runs the \CI{synFun}. The \CI{synFun} is the task that
+synchronizes the channel \gls{SDS} with the actual device. For the \gls{TCP}
+device this is a simple \CI{tcpconnect}. The \CI{TaskId} of the background task
+is saved to be able to stop the task in the future. When the task is unable to
+connect it will set the \CI{deviceError} field to notify the user.
+\todo{netter maken}
+
+\begin{lstlisting}[language=Clean,caption={Device type},label={lst:mtaskdevice}]
+:: Channels :== ([MTaskMSGRecv], [MTaskMSGSend], Bool)
+:: MTaskResource
+ = TCPDevice TCPSettings
+ | SerialDevice TTYSettings
+:: MTaskDevice =
+ { deviceTask :: Maybe TaskId
+ , deviceError :: Maybe String
+ , deviceChannels :: String
+ , deviceName :: String
+ , deviceTasks :: [MTaskTask]
+ , deviceData :: MTaskResource
+ , deviceSpec :: Maybe MTaskDeviceSpec
+ }
+
+class MTaskDuplex a where
+ synFun :: a (Shared Channels) -> Task ()
+\end{lstlisting}
\newacronym{ARM}{ARM}{Acorn \acrshort{RISC} Machine}
\newacronym{LTN}{LTN}{Low Throughput Network}
\newacronym{IDE}{IDE}{Integrated Development Environment}
+\newacronym{TCP}{TCP}{Transmission Control Protocol}
\newglossaryentry{Clean}{name=Clean,
description={is a pure lazy functional programming language based on graph
rewriting}}
\tableofcontents
\mainmatter{}
-\glsresetall
+\glsresetall{}
\chapter{Introduction}\label{chp:introduction}
\input{introduction.tex}
\chapter{Device client interface}\label{app:device-interface}
\input{appendix-device-interface.tex}
-\cleardoublepage
-\phantomsection
+\cleardoublepage{}
+\phantomsection{}
\addcontentsline{toc}{chapter}{List of \ldots}
\begingroup
\let\clearpage\relax
\lstlistoflistings{}
\endgroup
-\cleardoublepage
+\cleardoublepage{}
\addcontentsline{toc}{chapter}{Glossaries \& Acronyms}
\begingroup