9f41e56f7fc0be1f8ae899e39b4244bfa40aaff5
[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 \emph{STM32} like development boards supported by \texttt{ChibiOS}
19 such as the \emph{STM32f7x} series.
20 \item \emph{Arduino} compatible microcontrollers. Even development boards
21 with as little as \emph{2K} \emph{RAM} such as the \emph{Arduino UNO}
22 are supported.
23 \end{itemize}
24
25 \subsection{Specification}
26 Devices are stored in a record type and all devices in the system are stored in
27 a \gls{SDS} containing all devices. From the macro settings in the interface
28 file a profile is created for the device that describes the specification. When
29 a connection between the server and a client is established the server will
30 send a request for specification. The client will serialize his specs and send
31 it to the server so that the server knows what the client is capable of. The
32 exact specification is listed in Listing~\ref{lst:devicespec}
33
34 \begin{lstlisting}[language=Clean,label={lst:devicespec},
35 caption={Device specification for \glspl{mTask}}]
36 :: MTaskDeviceSpec =
37 {haveLed :: Bool
38 ,haveAio :: Bool
39 ,haveDio :: Bool
40 ,bytesMemory :: Int
41 }
42 \end{lstlisting}
43 \todo{Explain specification, combine task and share space}
44
45 \subsection{Communication}