+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}