add part about deep embedding
[msc-thesis1617.git] / methods.arch.tex
1 \section{Architecture}
2 \subsection{Devices}
3 The client code for the devices is compiled from one codebase. For a device to
4 be eligible for \glspl{mTask} it must be able to compile the shared codebase
5 and implement (part of) the device specific interface. The shared codebase only
6 uses standard \gls{C} and no special libraries or tricks are used. Therefore
7 the code is compilable for almost any device or system. Note that it is not
8 needed to implement a full interface. The full interface, listed in
9 Appendix~\label{app:device-interface}\todo{update interface listing}, also
10 includes functions for accessing the peripherals that not every device might
11 have. Devices can choose what to implement by setting the correct macros in the
12 top of the file. When a server connects to a client the specifications are
13 communicated.
14
15 The current list of supported and tested devices is as follows:
16 \begin{itemize}
17 \item $^*$\texttt{NIX} systems such as Linux
18 \item STM32 like development boards supported by \texttt{ChibiOS}.
19 \item \emph{Arduino} compatible microcontrollers
20 \end{itemize}
21
22 \subsection{Specification}
23 Devices are stored in a record type and all devices in the system are stored in
24 a \gls{SDS} containing all devices. From the macro settings in the interface
25 file a profile is created for the device that describes the specification. When
26 a connection between the server and a client is established the server will
27 send a request for specification. The client will serialize his specs and send
28 it to the server so that the server knows what the client is capable of. The
29 exact specification is listed in Listing~\ref{lst:devicespec}
30
31 \begin{lstlisting}[language=Clean,label={lst:devicespec},
32 caption={Device specification for \glspl{mTask}}]
33 :: MTaskDeviceSpec =
34 {haveLed :: Bool
35 ,haveAio :: Bool
36 ,haveDio :: Bool
37 ,bytesMemory :: Int
38 }
39 \end{lstlisting}
40 \todo{Explain specification, combine task and share space}
41
42 \subsection{Communication}