1 The current
\gls{mTask
} engine for devices does not support
\glspl{Task
} in the
2 sense that the
\gls{C
}-view does.
\Glspl{Task
} used with the
\gls{C
}-view are a
3 main program that executes code and launches
\glspl{Task
}. It was also possible
4 to just have a main program. The current
\gls{mTask
}-system only supports main
5 programs which are the
\glspl{Task
} in their entirety. However, this results in
6 a problem.
\glspl{Task
} can not call other
\glspl{Task
} nor themselves.
7 Therefore, execution strategies have been added. Sending a
\gls{Task
} always
8 goes together with choosing a scheduling strategy. This strategy can be one of
9 the following three strategies:
14 The
\CI{OneShot
} strategy consists of executing the
\gls{Task
} only
15 once. In
\gls{IoT
} applications, often the status of a peripheral or
16 system has to be queried only once on the request of the user. For
17 example in a thermostat, the temperature is logged every
30 minutes.
18 However, the user might want to know the temperature at that exact
19 moment, and then they can just send a
\CI{OneShot
} \gls{Task
} probing
20 the temperature. After execution, the
\gls{Task
} will be removed from
21 the memory of the client.
22 \item\CI{OnInterval Int
}
24 \CI{OnInterval
} is a execution strategy that executes the
\gls{Task
}
25 in the given number of milliseconds. This strategy is very useful for
26 logging measurements on an interval. Moreover, the strategy can be
27 (ab)used to simulate recursion.
\glspl{SDS
} store global
% chktex 36
28 information and is persistent. The
\CI{retrn
} instruction --- as will
29 be shown in Section~
\ref{ssec:control
} --- can then be used to
30 terminate. Therefore,
\glspl{Task
} can be crafted that recursively call
31 themselves using a
\gls{SDS
} to simulate arguments.
32 \item\CI{OnInterrupt Int
}
34 Finally, a scheduling method is available that executes a
\gls{Task
}
35 when a given interrupt is received. This method can be useful to launch
36 a
\gls{Task
} on the press on hardware events such as the press of a
37 button. Unfortunately, due to time constraints and focus, this
38 functionality is only built in the protocol, none of the current client
39 implementations support this.