X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=top%2Fint.tex;fp=top%2Ftop.tex;h=a1742fc6a1019c42ae968a2c784bbd3f0575608b;hb=d6c8d6cbc9c88d449ac784eda20a213fd6b46669;hp=6c759fb168a7c95644764de6419e11550674a695;hpb=a4bb863836abcafe5b813b14233a24228dc4198e;p=phd-thesis.git diff --git a/top/top.tex b/top/int.tex similarity index 69% rename from top/top.tex rename to top/int.tex index 6c759fb..a1742fc 100644 --- a/top/top.tex +++ b/top/int.tex @@ -5,12 +5,6 @@ \begin{document} \input{subfileprefix} -%\chapter{\texorpdfstring{\Glsxtrshort{TOP} for the \glsxtrshort{IOT}}{TOP for the IoT}}% -\subfile{4iot} - -%\chapter{The \texorpdfstring{\gls{MTASK}}{mTask} \texorpdfstring{\glsxtrshort{DSL}}{DSL}}% -\subfile{lang} - \chapter{Integration with \texorpdfstring{\gls{ITASK}}{iTask}}% \label{chp:integration_with_itask} \begin{chapterabstract} @@ -49,7 +43,7 @@ The channels contain three fields, a queue of messages that are received, a queu Every communication method that implements the \cleaninline{channelSync} class can provide the communication with an \gls{MTASK} device. As of now, serial port communication, direct \gls{TCP} communication and \gls{MQTT} over \gls{TCP} are supported as communication providers. The \cleaninline{withDevice} function transforms a communication provider and a task that does something with this device to an \gls{ITASK} task. -This task sets up the communication, exchanges specifications, handles errors and cleans up after closing. +Internally, the task sets up the communication, exchanges specifications, executes the inner task while handling errors, and finally cleans up after closing. \Cref{lst:mtask_device} shows the types and interface to connecting devices. \begin{lstClean}[label={lst:mtask_device},caption={Device communication interface in \gls{MTASK}.}] @@ -58,15 +52,24 @@ This task sets up the communication, exchanges specifications, handles errors an class channelSync a :: a (Shared sds Channels) -> Task () | RWShared sds -withDevice :: (a (MTDevice -> Task b) -> Task b) | iTask b & channelSync, iTask a +withDevice :: a (MTDevice -> Task b) -> Task b | iTask b & channelSync, iTask a \end{lstClean} \section{Lifting tasks}\label{sec:liftmtask} -Once the connection with the device is established, \ldots -\begin{lstClean} -liftmTask :: (Main (BCInterpret (TaskValue u))) MTDevice -> Task u | iTask u +Once the connection with the device is established, \gls{MTASK} tasks can be lifted to \gls{MTASK} tasks using the \cleaninline{liftmTask} family of functions (see \cref{lst:liftmtask}). +Given an \gls{MTASK} task in the \cleaninline{BCInterpret} view and a device obtained from \cleaninline{withDevice}, an \gls{ITASK} task is returned. +This \gls{ITASK} task tethers the \gls{MTASK} task that is executed on the microcontroller. +Hence, when for example observing the task value, the actual task value from the microcontroller is observed. + +\begin{lstClean}[label={lst:liftmtask},caption={The interface for lifting \gls{MTASK} tasks to \gls{ITASK} tasks.}] +liftmTask :: (Main (MTask BCInterpret u)) MTDevice -> Task u | iTask u \end{lstClean} +Under the hood, \cleaninline{liftmTask} compiler the \gls{MTASK} task to byte code, gathers the initial values for the lifted \glspl{SDS} and sends the data to the device. +Once acknowledged, the \gls{MTASK} task value and the \glspl{SDS} are monitored. +If the \gls{ITASK} server updates the value of a lifted \gls{SDS}, the appropriate message is sent to the \gls{MTASK} to notify it of the change. +Furthermore, the \gls{MTASK} device may update the \gls{SDS}, and in that case the message is picked up by the \cleaninline{liftmTask} task and the \gls{SDS} on the \gls{ITASK} server updated accordingly. + \section{Lifting \texorpdfstring{\glsxtrlongpl{SDS}}{shared data sources}}\label{sec:liftsds} \begin{lstClean}[label={lst:mtask_itasksds},caption={Lifted \gls{ITASK} \glspl{SDS} in \gls{MTASK}.}] class liftsds v where @@ -74,19 +77,8 @@ class liftsds v where -> Main (MTask v u) | RWShared sds \end{lstClean} -\chapter{Implementation}% -\label{chp:implementation} -\begin{chapterabstract} - This chapter shows the implementation of the \gls{MTASK} system. - It is threefold: first it shows the implementation of the byte code compiler for \gls{MTASK}'s \gls{TOP} language, then is details of the implementation of \gls{MTASK}'s \gls{TOP} engine that executes the \gls{MTASK} tasks on the microcontroller, and finally it shows how the integration of \gls{MTASK} tasks and \glspl{SDS} is implemented both on the server and on the device. -\end{chapterabstract} -IFL19 paper, bytecode instructieset~\cref{chp:bytecode_instruction_set} - -\section{Integration with \texorpdfstring{\gls{ITASK}}{iTask}} -IFL18 paper stukken +\section{Conclusion} -% Green computing -\subfile{green} \input{subfilepostamble} \end{document}