add bit about communication
authorMart Lubbers <mart@martlubbers.net>
Wed, 17 May 2017 12:34:51 +0000 (14:34 +0200)
committerMart Lubbers <mart@martlubbers.net>
Wed, 17 May 2017 12:34:51 +0000 (14:34 +0200)
methods.arch.tex
thesis.tex

index b556398..cd9918d 100644 (file)
@@ -55,3 +55,33 @@ of. The exact specification is listed in Listing~\ref{lst:devicespec}
 \todo{Explain specification, combine task and share space}
 
 \subsection{Communication}
 \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}
index d6f9973..eb150e9 100644 (file)
@@ -12,6 +12,7 @@
 \newacronym{ARM}{ARM}{Acorn \acrshort{RISC} Machine}
 \newacronym{LTN}{LTN}{Low Throughput Network}
 \newacronym{IDE}{IDE}{Integrated Development Environment}
 \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}}
 \newglossaryentry{Clean}{name=Clean,
        description={is a pure lazy functional programming language based on graph
                rewriting}}
@@ -57,7 +58,7 @@
 \tableofcontents
 
 \mainmatter{}
 \tableofcontents
 
 \mainmatter{}
-\glsresetall
+\glsresetall{}
 \chapter{Introduction}\label{chp:introduction}
 \input{introduction.tex}
 
 \chapter{Introduction}\label{chp:introduction}
 \input{introduction.tex}
 
@@ -77,8 +78,8 @@
 \chapter{Device client interface}\label{app:device-interface}
 \input{appendix-device-interface.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
 \addcontentsline{toc}{chapter}{List of \ldots}
 \begingroup
 \let\clearpage\relax
@@ -87,7 +88,7 @@
 \lstlistoflistings{}
 \endgroup
 
 \lstlistoflistings{}
 \endgroup
 
-\cleardoublepage
+\cleardoublepage{}
 \addcontentsline{toc}{chapter}{Glossaries \& Acronyms}
 
 \begingroup
 \addcontentsline{toc}{chapter}{Glossaries \& Acronyms}
 
 \begingroup