\subsection{Motion detection sensor}
The \gls{MTASK} language supports motion sensing using a \gls{PIR} sensor through a type class that only contains macros.
\gls{PIR} sensors detect motion by the \gls{IR} reflection through a number of Fresnel lenses and communicates through a digital \gls{GPIO} pin.
-Therefore, a \gls{PIR} is nothing more than a \cleaninline{DPIN} according to \gls{MTASK} but for uniformity, a type class is available (see \cref{lst:mtask_pir}).
+Therefore, a \gls{PIR} is nothing more than a \cleaninline{DPin} according to \gls{MTASK} but for uniformity, a type class is available (see \cref{lst:mtask_pir}).
\begin{lstClean}[label={lst:mtask_pir},caption={\Gls{PIR} sensor interface in \gls{MTASK}.}]
:: PIR :== DPin
\begin{lstClean}[label={lst:mtask_sound},caption={Sound detection sensor interface in \gls{MTASK}.}]
:: SoundDetector :== (DPin, APin)
-class SoundDetector v | tupl, expr, pinMode v & dio DPin v
-where
+class SoundDetector v | tupl, expr, pinMode v & dio DPin v where
soundDetector :: DPin APin ((v SoundDetector) -> Main (v b)) -> Main (v b)
soundPresence` :: (TimingInterval v) (v SoundDetector) -> MTask v Bool
\end{lstClean}
\subsection{Connection types}\label{lst:connection_types}
-\begin{lstClean}[caption={}]
+The connection between the \gls{ITASK} server and the \gls{MTASK} devices are communication method agnostic.
+As long as the \cleaninline{channelSync} type class is implemented, the communication method can be used.
+\Cref{lst:conn_types} shows the data types for the connections.
+
+\begin{lstClean}[label={lst:conn_types},caption={Data types for the different connections in \gls{MTASK}.}]
:: TCPSettings =
{ host :: String
, port :: Int
, pingTimeout :: ?Int
}
-:: MQTTSettings =
+:: MQTTSettings =
{ host :: String
, port :: Int
, mcuId :: String
, serverId :: String
, auth :: MQTTAuth
}
-:: TTYSettings = {
- devicePath :: String,
- baudrate :: BaudRate,
- bytesize :: ByteSize,
- parity :: Parity,
- stop2bits :: Bool,
- xonxoff :: Bool,
- sleepTime :: Int
+:: TTYSettings =
+ { devicePath :: String
+ , baudrate :: BaudRate
+ , bytesize :: ByteSize
+ , parity :: Parity
+ , stop2bits :: Bool
+ , xonxoff :: Bool
+ , sleepTime :: Int
}
\end{lstClean}
-
\lstset{basicstyle=\tt}
\input{subfilepostamble}
\end{document}