X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=appendix-protocol.tex;h=41e82d002571f50e01b872dfaec64bde15edaebf;hb=7b3621da9386dae0908163a158210e3fcedccd92;hp=4f1672dadc870c826f1497db171b17a4c3bb77ef;hpb=57dab117db1fa358785cc3992053206584df0b53;p=msc-thesis1617.git diff --git a/appendix-protocol.tex b/appendix-protocol.tex index 4f1672d..41e82d0 100644 --- a/appendix-protocol.tex +++ b/appendix-protocol.tex @@ -1,13 +1,37 @@ \section{General message format} Messages are delimited by newlines to make processing by line based devices -more easy. Message exchanges have a \emph{Request} and \emph{Response} header. +easier. Message exchanges have a \emph{Request} and \emph{Response} header. The \emph{Request} header means that the server is sending to the client. The \emph{Response} header means that the client is sending to the server. In some cases either the \emph{Request} or \emph{Response} is empty. This means that -the message is not acknowledged or responded upon. +the message is not acknowledged or responded upon. Multibyte values are +interpreted as \gls{MSB} first integers. \section{Handshake} -\todo{Handshake, here the client tells the server what they can do} +\begin{table}[!ht] + \centering + \begin{subfigure}[t]{.48\textwidth} + \begin{tabular}{ll} + \toprule + \multicolumn{2}{c}{Request}\\ + byte & value\\ + \midrule + 1 & \texttt{'c'}\\ + \midrule\midrule + \multicolumn{2}{c}{Response}\\ + byte & value\\ + \midrule + 1 & \texttt{'c'}\\ + 2 & Peripheral bitmask\\ + 3,4 & Bytes of memory\\ + 5,6 & Size of the stack\\ + 7 & Number of analog pins\\ + 8 & Number of digital pins\\ + \bottomrule + \end{tabular} + \caption{Send a device specification} + \end{subfigure} +\end{table} \newpage \section{mTasks} @@ -20,9 +44,7 @@ the message is not acknowledged or responded upon. byte & value\\ \midrule 1 & \texttt{'t'}\\ - 2,3 & interval. If the first bit is 1 the other 15 indicate the - interrupt on which the task should be run. If the first bit is 0 - the other 15 indicate the interval in milliseconds\\ + 2,3 & interval or interrupt\\ 4,5 & length (\texttt{n})\\ 6 to n+6 & bytecode\\ \midrule\midrule @@ -30,10 +52,10 @@ the message is not acknowledged or responded upon. byte & value\\ \midrule 1 & \texttt{'t'}\\ - 2,3 & task id\\ + 2,3 & \gls{Task} id\\ \bottomrule \end{tabular} - \caption{Send a task} + \caption{Send a \gls{Task}} \end{subfigure} \quad% \begin{subfigure}[t]{.48\textwidth} @@ -43,18 +65,18 @@ the message is not acknowledged or responded upon. byte & meaning\\ \midrule 1 & \texttt{'d'}\\ - 2,3 & task id\\ + 2,3 & \gls{Task} id\\ \midrule\midrule \multicolumn{2}{c}{Response}\\ byte & value\\ \midrule 1 & \texttt{'d'}\\ - 2,3 & task id\\ + 2,3 & \gls{Task} id\\ \bottomrule \end{tabular} - \caption{Delete a task} + \caption{Delete a \gls{Task}} \end{subfigure} - \caption{Message protocol for exchanging tasks} + \caption{Message protocol for exchanging \glspl{Task}} \end{table} \section{SDSs}