big update
[msc-thesis1617.git] / appendix-protocol.tex
1 \section{General message format}
2 Messages are delimited by newlines to make processing by line based devices
3 more easy. Message exchanges have a \emph{Request} and \emph{Response} header.
4 The \emph{Request} header means that the server is sending to the client. The
5 \emph{Response} header means that the client is sending to the server. In some
6 cases either the \emph{Request} or \emph{Response} is empty. This means that
7 the message is not acknowledged or responded upon.
8
9 \section{Handshake}
10 \todo{Handshake, here the client tells the server what they can do}
11
12 \newpage
13 \section{mTasks}
14 \begin{table}[!ht]
15 \centering
16 \begin{subfigure}[t]{.48\textwidth}
17 \begin{tabular}{ll}
18 \toprule
19 \multicolumn{2}{c}{Request}\\
20 byte & value\\
21 \midrule
22 1 & \texttt{'t'}\\
23 2,3 & interval. If the first bit is 1 the other 15 indicate the
24 interrupt on which the task should be run. If the first bit is 0
25 the other 15 indicate the interval in milliseconds\\
26 4,5 & length (\texttt{n})\\
27 6 to n+6 & bytecode\\
28 \midrule\midrule
29 \multicolumn{2}{c}{Response}\\
30 byte & value\\
31 \midrule
32 1 & \texttt{'t'}\\
33 2,3 & task id\\
34 \bottomrule
35 \end{tabular}
36 \caption{Send a task}
37 \end{subfigure}
38 \quad%
39 \begin{subfigure}[t]{.48\textwidth}
40 \begin{tabular}{ll}
41 \toprule
42 \multicolumn{2}{c}{Request}\\
43 byte & meaning\\
44 \midrule
45 1 & \texttt{'d'}\\
46 2,3 & task id\\
47 \midrule\midrule
48 \multicolumn{2}{c}{Response}\\
49 byte & value\\
50 \midrule
51 1 & \texttt{'d'}\\
52 2,3 & task id\\
53 \bottomrule
54 \end{tabular}
55 \caption{Delete a task}
56 \end{subfigure}
57 \caption{Message protocol for exchanging tasks}
58 \end{table}
59
60 \section{SDSs}
61 \begin{table}[!ht]
62 \centering
63 \begin{subfigure}[t]{.2\textwidth}
64 \begin{tabular}{ll}
65 \toprule
66 \multicolumn{2}{c}{Request}\\
67 byte & meaning\\
68 \midrule
69 1 & \texttt{'s'}\\
70 2,3 & identifier\\
71 4,5 & value\\
72 \midrule\midrule
73 \multicolumn{2}{c}{Response}\\
74 byte & meaning\\
75 \midrule
76 1 & \texttt{'s'}\\
77 2,3 & identifier\\
78 \bottomrule
79 \end{tabular}
80 \caption{Send an SDS specification}
81 \end{subfigure}
82 \quad%
83 \begin{subfigure}[t]{.2\textwidth}
84 \begin{tabular}{ll}
85 \toprule
86 \multicolumn{2}{c}{Response}\\
87 byte & value\\
88 \midrule
89 1 & \texttt{'a'}\\
90 2,3 & SDS id\\
91 \midrule\midrule
92 \multicolumn{2}{c}{Request}\\
93 byte & value\\
94 \midrule
95 1 & \texttt{'a'}\\
96 2,3 & SDS id\\
97 \bottomrule
98 \end{tabular}
99 \caption{Delete a SDS}
100 \end{subfigure}
101 \quad%
102 \begin{subfigure}[t]{.2\textwidth}
103 \begin{tabular}{ll}
104 \toprule
105 \multicolumn{2}{c}{Request}\\
106 byte & meaning\\
107 \midrule
108 1 & \texttt{'u'}\\
109 2,3 & sdsid\\
110 4,5 & value\\
111 \midrule\midrule
112 \multicolumn{2}{c}{Response}\\
113 \bottomrule
114 \end{tabular}
115 \caption{SDS update}
116 \end{subfigure}
117 \quad%
118 \begin{subfigure}[t]{.2\textwidth}
119 \begin{tabular}{ll}
120 \toprule
121 \multicolumn{2}{c}{Response}\\
122 \midrule\midrule
123 \multicolumn{2}{c}{Request}\\
124 byte & value\\
125 \midrule
126 1 & \texttt{'p'}\\
127 2,3 & SDS id\\
128 4,5 & value\\
129 \bottomrule
130 \end{tabular}
131 \caption{SDS publish}
132 \end{subfigure}
133 \caption{Message protocol for exchanging SDSs}
134 \end{table}