\hypertarget{oven_8c}{
\section{oven/oven.c File Reference}
\label{oven_8c}\index{oven/oven.c@{oven/oven.c}}
}
{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$tchar.h$>$}\par
{\tt \#include \char`\"{}simplehsm.h\char`\"{}}\par
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum \hyperlink{oven_8c_eac09269771d51579c43e1593bc7ec73}{oven\_\-signals\_\-t} \{ \hyperlink{oven_8c_eac09269771d51579c43e1593bc7ec73d6dbb61108ec0266b95aec63e0e83639}{SIG\_\-OPEN\_\-DOOR} =  SIG\_\-USER, 
\hyperlink{oven_8c_eac09269771d51579c43e1593bc7ec73a1ce84b40beac304c9d06e30dd73f1ba}{SIG\_\-CLOSE\_\-DOOR}, 
\hyperlink{oven_8c_eac09269771d51579c43e1593bc7ec734a989b9000285e4cb934d64cfe406a8d}{SIG\_\-TOASTING}, 
\hyperlink{oven_8c_eac09269771d51579c43e1593bc7ec7395d20112d213d7096cb07d3bbfe18c08}{SIG\_\-BAKING}
 \}
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
\hyperlink{simplehsm_8h_5a6cc73d9d531136e91731a2b6509121}{stnext} \hyperlink{oven_8c_673aa7a88bb4ade8c59b5fec3677ceb6}{oven} (int signal, void $\ast$param)
\item 
\hyperlink{simplehsm_8h_5a6cc73d9d531136e91731a2b6509121}{stnext} \hyperlink{oven_8c_36f758593a638a3e87af12db08af8f4a}{heating} (int signal, void $\ast$param)
\item 
\hyperlink{simplehsm_8h_5a6cc73d9d531136e91731a2b6509121}{stnext} \hyperlink{oven_8c_1742184c9cfa6a65cc3c46506246fd97}{toasting} (int signal, void $\ast$param)
\item 
\hyperlink{simplehsm_8h_5a6cc73d9d531136e91731a2b6509121}{stnext} \hyperlink{oven_8c_195d6cd05c53f8f671d51fd6c90f2c13}{baking} (int signal, void $\ast$param)
\item 
\hyperlink{simplehsm_8h_5a6cc73d9d531136e91731a2b6509121}{stnext} \hyperlink{oven_8c_7f843e12c4189ac71c89463554f20dd3}{doorOpen} (int signal, void $\ast$param)
\item 
void \hyperlink{oven_8c_d86cb82600ae0abc1f5a330ecdf0f004}{show\_\-status} (\hyperlink{structsimplehsm__t}{simplehsm\_\-t} $\ast$\hyperlink{oven_8c_b0f5f1813e601676237fefa2690bf4a5}{hsm})
\item 
int \hyperlink{oven_8c_353674c5af92be7fb389265cde4e5e03}{\_\-tmain} (int argc, \_\-TCHAR $\ast$argv\mbox{[}$\,$\mbox{]})
\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
\hyperlink{structsimplehsm__t}{simplehsm\_\-t} \hyperlink{oven_8c_b0f5f1813e601676237fefa2690bf4a5}{hsm} = \{NULL\}
\end{CompactItemize}


\label{_details}
\hypertarget{_details}{}
\subsection{Detailed Description}
\begin{Desc}
\item[Author:]Daniel Newton $<$\href{mailto:djpnewton@gmail.com}{\tt djpnewton@gmail.com}$>$ \end{Desc}
\begin{Desc}
\item[Version:]1.0\end{Desc}
\hypertarget{simplehsm_8h_LICENSE}{}\subsection{LICENSE}\label{simplehsm_8h_LICENSE}
Copyright (c) 2009 Daniel Newton

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \char`\"{}Software\char`\"{}), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED \char`\"{}AS IS\char`\"{}, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\hypertarget{simplehsm_8h_DESCRIPTION}{}\subsection{DESCRIPTION}\label{simplehsm_8h_DESCRIPTION}
A contrived oven state machine. A simple demo of the simplehsm C implementation. 

\subsection{Enumeration Type Documentation}
\hypertarget{oven_8c_eac09269771d51579c43e1593bc7ec73}{
\index{oven.c@{oven.c}!oven\_\-signals\_\-t@{oven\_\-signals\_\-t}}
\index{oven\_\-signals\_\-t@{oven\_\-signals\_\-t}!oven.c@{oven.c}}
\subsubsection[{oven\_\-signals\_\-t}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf oven\_\-signals\_\-t}}}
\label{oven_8c_eac09269771d51579c43e1593bc7ec73}


The oven state machine signals \begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{SIG\_\-OPEN\_\-DOOR@{SIG\_\-OPEN\_\-DOOR}!oven.c@{oven.c}}\index{oven.c@{oven.c}!SIG\_\-OPEN\_\-DOOR@{SIG\_\-OPEN\_\-DOOR}}\item[{\em 
\hypertarget{oven_8c_eac09269771d51579c43e1593bc7ec73d6dbb61108ec0266b95aec63e0e83639}{
SIG\_\-OPEN\_\-DOOR}
\label{oven_8c_eac09269771d51579c43e1593bc7ec73d6dbb61108ec0266b95aec63e0e83639}
}]The oven door has been opened \index{SIG\_\-CLOSE\_\-DOOR@{SIG\_\-CLOSE\_\-DOOR}!oven.c@{oven.c}}\index{oven.c@{oven.c}!SIG\_\-CLOSE\_\-DOOR@{SIG\_\-CLOSE\_\-DOOR}}\item[{\em 
\hypertarget{oven_8c_eac09269771d51579c43e1593bc7ec73a1ce84b40beac304c9d06e30dd73f1ba}{
SIG\_\-CLOSE\_\-DOOR}
\label{oven_8c_eac09269771d51579c43e1593bc7ec73a1ce84b40beac304c9d06e30dd73f1ba}
}]The oven door has been closed \index{SIG\_\-TOASTING@{SIG\_\-TOASTING}!oven.c@{oven.c}}\index{oven.c@{oven.c}!SIG\_\-TOASTING@{SIG\_\-TOASTING}}\item[{\em 
\hypertarget{oven_8c_eac09269771d51579c43e1593bc7ec734a989b9000285e4cb934d64cfe406a8d}{
SIG\_\-TOASTING}
\label{oven_8c_eac09269771d51579c43e1593bc7ec734a989b9000285e4cb934d64cfe406a8d}
}]The toasting mode has been selected \index{SIG\_\-BAKING@{SIG\_\-BAKING}!oven.c@{oven.c}}\index{oven.c@{oven.c}!SIG\_\-BAKING@{SIG\_\-BAKING}}\item[{\em 
\hypertarget{oven_8c_eac09269771d51579c43e1593bc7ec7395d20112d213d7096cb07d3bbfe18c08}{
SIG\_\-BAKING}
\label{oven_8c_eac09269771d51579c43e1593bc7ec7395d20112d213d7096cb07d3bbfe18c08}
}]The baking mode has been selected \end{description}
\end{Desc}



\subsection{Function Documentation}
\hypertarget{oven_8c_353674c5af92be7fb389265cde4e5e03}{
\index{oven.c@{oven.c}!\_\-tmain@{\_\-tmain}}
\index{\_\-tmain@{\_\-tmain}!oven.c@{oven.c}}
\subsubsection[{\_\-tmain}]{\setlength{\rightskip}{0pt plus 5cm}int \_\-tmain (int {\em argc}, \/  \_\-TCHAR $\ast$ {\em argv}\mbox{[}$\,$\mbox{]})}}
\label{oven_8c_353674c5af92be7fb389265cde4e5e03}


Main function of the oven program

Sets the initial state, sends a signal and then shows the state machine status \hypertarget{oven_8c_195d6cd05c53f8f671d51fd6c90f2c13}{
\index{oven.c@{oven.c}!baking@{baking}}
\index{baking@{baking}!oven.c@{oven.c}}
\subsubsection[{baking}]{\setlength{\rightskip}{0pt plus 5cm}{\bf stnext} baking (int {\em signal}, \/  void $\ast$ {\em param})}}
\label{oven_8c_195d6cd05c53f8f671d51fd6c90f2c13}


The baking state

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em signal}]The signal to send to this state \item[{\em param}]A signal specific parameter \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]\hyperlink{simplehsm_8h_02d8fb35d7b7acf4cc21c822bae6e746}{stnone} if the signal is handled, otherwise the parent state (\hyperlink{oven_8c_36f758593a638a3e87af12db08af8f4a}{heating()}) \end{Desc}
\hypertarget{oven_8c_7f843e12c4189ac71c89463554f20dd3}{
\index{oven.c@{oven.c}!doorOpen@{doorOpen}}
\index{doorOpen@{doorOpen}!oven.c@{oven.c}}
\subsubsection[{doorOpen}]{\setlength{\rightskip}{0pt plus 5cm}{\bf stnext} doorOpen (int {\em signal}, \/  void $\ast$ {\em param})}}
\label{oven_8c_7f843e12c4189ac71c89463554f20dd3}


The doorOpen state

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em signal}]The signal to send to this state \item[{\em param}]A signal specific parameter \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]\hyperlink{simplehsm_8h_02d8fb35d7b7acf4cc21c822bae6e746}{stnone} if the signal is handled, otherwise the parent state (\hyperlink{oven_8c_673aa7a88bb4ade8c59b5fec3677ceb6}{oven()}) \end{Desc}
\hypertarget{oven_8c_36f758593a638a3e87af12db08af8f4a}{
\index{oven.c@{oven.c}!heating@{heating}}
\index{heating@{heating}!oven.c@{oven.c}}
\subsubsection[{heating}]{\setlength{\rightskip}{0pt plus 5cm}{\bf stnext} heating (int {\em signal}, \/  void $\ast$ {\em param})}}
\label{oven_8c_36f758593a638a3e87af12db08af8f4a}


The heating state. This state contains a deep history psuedostate.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em signal}]The signal to send to this state \item[{\em param}]A signal specific parameter \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]\hyperlink{simplehsm_8h_02d8fb35d7b7acf4cc21c822bae6e746}{stnone}/\hyperlink{simplehsm_8h_41590a7ab6955390a08543797a12b4ba}{stdeephist} if the signal is handled, otherwise the parent state (\hyperlink{oven_8c_673aa7a88bb4ade8c59b5fec3677ceb6}{oven()}) \end{Desc}
\hypertarget{oven_8c_673aa7a88bb4ade8c59b5fec3677ceb6}{
\index{oven.c@{oven.c}!oven@{oven}}
\index{oven@{oven}!oven.c@{oven.c}}
\subsubsection[{oven}]{\setlength{\rightskip}{0pt plus 5cm}{\bf stnext} oven (int {\em signal}, \/  void $\ast$ {\em param})}}
\label{oven_8c_673aa7a88bb4ade8c59b5fec3677ceb6}


The top level oven state

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em signal}]The signal to send to this state \item[{\em param}]A signal specific parameter \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Aways returns \hyperlink{simplehsm_8h_02d8fb35d7b7acf4cc21c822bae6e746}{stnone} indicating that this is the top level state \end{Desc}
\hypertarget{oven_8c_d86cb82600ae0abc1f5a330ecdf0f004}{
\index{oven.c@{oven.c}!show\_\-status@{show\_\-status}}
\index{show\_\-status@{show\_\-status}!oven.c@{oven.c}}
\subsubsection[{show\_\-status}]{\setlength{\rightskip}{0pt plus 5cm}void show\_\-status ({\bf simplehsm\_\-t} $\ast$ {\em hsm})}}
\label{oven_8c_d86cb82600ae0abc1f5a330ecdf0f004}


Show the status of the oven state machine by showing what states it is currently in

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em hsm}]The oven state machine \end{description}
\end{Desc}
\hypertarget{oven_8c_1742184c9cfa6a65cc3c46506246fd97}{
\index{oven.c@{oven.c}!toasting@{toasting}}
\index{toasting@{toasting}!oven.c@{oven.c}}
\subsubsection[{toasting}]{\setlength{\rightskip}{0pt plus 5cm}{\bf stnext} toasting (int {\em signal}, \/  void $\ast$ {\em param})}}
\label{oven_8c_1742184c9cfa6a65cc3c46506246fd97}


The toasting state

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em signal}]The signal to send to this state \item[{\em param}]A signal specific parameter \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]\hyperlink{simplehsm_8h_02d8fb35d7b7acf4cc21c822bae6e746}{stnone} if the signal is handled, otherwise the parent state (\hyperlink{oven_8c_36f758593a638a3e87af12db08af8f4a}{heating()}) \end{Desc}


\subsection{Variable Documentation}
\hypertarget{oven_8c_b0f5f1813e601676237fefa2690bf4a5}{
\index{oven.c@{oven.c}!hsm@{hsm}}
\index{hsm@{hsm}!oven.c@{oven.c}}
\subsubsection[{hsm}]{\setlength{\rightskip}{0pt plus 5cm}{\bf simplehsm\_\-t} {\bf hsm} = \{NULL\}}}
\label{oven_8c_b0f5f1813e601676237fefa2690bf4a5}


The Oven state machine object 