started with sweep through arch.itasks
[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 easier. 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. Multibyte values are
8 interpreted as \gls{MSB} first integers.
9
10 \section{Handshake}
11 \begin{table}[H]
12 \centering
13 \begin{tabular}{ll}
14 \toprule
15 \multicolumn{2}{c}{Request}\\
16 byte & value\\
17 \midrule
18 1 & \texttt{'c'}\\
19 \midrule\midrule
20 \multicolumn{2}{c}{Response}\\
21 byte & value\\
22 \midrule
23 1 & \texttt{'c'}\\
24 2 & Peripheral bitmask\\
25 3,4 & Bytes of memory\\
26 5,6 & Size of the stack\\
27 7 & Number of analog pins\\
28 8 & Number of digital pins\\
29 \bottomrule
30 \end{tabular}
31 \caption{Send a device specification}
32 \end{table}
33
34 \newpage
35 \section{\gls{mTask}-\glspl{Task}}
36 \begin{table}[H]
37 \centering
38 \begin{subfigure}[b]{.48\textwidth}
39 \centering
40 \begin{tabular}{ll}
41 \toprule
42 \multicolumn{2}{c}{Request}\\
43 byte & value\\
44 \midrule
45 1 & \texttt{'t'}\\
46 2,3 & interval or interrupt\\
47 4,5 & length ($n$)\\
48 6 to $n$+6 & bytecode\\
49 \midrule\midrule
50 \multicolumn{2}{c}{Response}\\
51 byte & value\\
52 \midrule
53 1 & \texttt{'t'}\\
54 2,3 & \gls{Task} id\\
55 \bottomrule
56 \end{tabular}
57 \caption{Send a \gls{Task}}
58 \end{subfigure}
59 \quad%
60 \begin{subfigure}[b]{.48\textwidth}
61 \centering
62 \begin{tabular}{ll}
63 \toprule
64 \multicolumn{2}{c}{Request}\\
65 byte & meaning\\
66 \midrule
67 1 & \texttt{'d'}\\
68 2,3 & \gls{Task} id\\
69 \midrule\midrule
70 \multicolumn{2}{c}{Response}\\
71 byte & value\\
72 \midrule
73 1 & \texttt{'d'}\\
74 2,3 & \gls{Task} id\\
75 \bottomrule
76 \end{tabular}
77 \caption{Delete a \gls{Task}}
78 \end{subfigure}
79 \caption{Message protocol for exchanging \glspl{Task}}
80 \end{table}
81
82 \section{\glspl{SDS}}
83 \begin{table}[H]
84 \centering
85 \begin{subfigure}[b]{.2\textwidth}
86 \centering
87 \begin{tabular}{ll}
88 \toprule
89 \multicolumn{2}{c}{Request}\\
90 byte & meaning\\
91 \midrule
92 1 & \texttt{'s'}\\
93 2,3 & id\\
94 4,5 & value\\
95 \midrule\midrule
96 \multicolumn{2}{c}{Response}\\
97 byte & meaning\\
98 \midrule
99 1 & \texttt{'s'}\\
100 2,3 & id\\
101 \bottomrule
102 \end{tabular}
103 \caption{Send an \gls{SDS} specification}
104 \end{subfigure}
105 \quad%
106 \begin{subfigure}[b]{.2\textwidth}
107 \centering
108 \begin{tabular}{ll}
109 \toprule
110 \multicolumn{2}{c}{Response}\\
111 byte & value\\
112 \midrule
113 1 & \texttt{'a'}\\
114 2,3 & SDS id\\
115 \midrule\midrule
116 \multicolumn{2}{c}{Request}\\
117 byte & value\\
118 \midrule
119 1 & \texttt{'a'}\\
120 2,3 & SDS id\\
121 \bottomrule
122 \end{tabular}
123 \caption{Delete an \gls{SDS}\\~}
124 \end{subfigure}
125 \quad%
126 \begin{subfigure}[b]{.2\textwidth}
127 \centering
128 \begin{tabular}{ll}
129 \toprule
130 \multicolumn{2}{c}{Request}\\
131 byte & meaning\\
132 \midrule
133 1 & \texttt{'u'}\\
134 2,3 & sdsid\\
135 4,5 & value\\
136 \midrule\midrule
137 \multicolumn{2}{c}{Response}\\
138 \bottomrule
139 \end{tabular}
140 \caption{\gls{SDS} update\\~}
141 \end{subfigure}
142 \quad%
143 \begin{subfigure}[b]{.2\textwidth}
144 \centering
145 \begin{tabular}{ll}
146 \toprule
147 \multicolumn{2}{c}{Response}\\
148 \midrule\midrule
149 \multicolumn{2}{c}{Request}\\
150 byte & value\\
151 \midrule
152 1 & \texttt{'p'}\\
153 2,3 & SDS id\\
154 4,5 & value\\
155 \bottomrule
156 \end{tabular}
157 \caption{\gls{SDS} publish\\~}
158 \end{subfigure}
159 \caption{Message protocol for exchanging \glspl{SDS}}
160 \end{table}