#include <stdio.h>
#include <tchar.h>
#include "simplehsm.h"
Enumerations | |
enum | oven_signals_t { SIG_OPEN_DOOR = SIG_USER, SIG_CLOSE_DOOR, SIG_TOASTING, SIG_BAKING } |
Functions | |
stnext | oven (int signal, void *param) |
stnext | heating (int signal, void *param) |
stnext | toasting (int signal, void *param) |
stnext | baking (int signal, void *param) |
stnext | doorOpen (int signal, void *param) |
void | show_status (simplehsm_t *hsm) |
int | _tmain (int argc, _TCHAR *argv[]) |
Variables | |
simplehsm_t | hsm = {NULL} |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), 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 "AS IS", 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.
enum oven_signals_t |
int _tmain | ( | int | argc, | |
_TCHAR * | argv[] | |||
) |
Main function of the oven program
Sets the initial state, sends a signal and then shows the state machine status
stnext baking | ( | int | signal, | |
void * | param | |||
) |
stnext doorOpen | ( | int | signal, | |
void * | param | |||
) |
stnext heating | ( | int | signal, | |
void * | param | |||
) |
The heating state. This state contains a deep history psuedostate.
signal | The signal to send to this state | |
param | A signal specific parameter |
stnext oven | ( | int | signal, | |
void * | param | |||
) |
The top level oven state
signal | The signal to send to this state | |
param | A signal specific parameter |
void show_status | ( | simplehsm_t * | hsm | ) |
Show the status of the oven state machine by showing what states it is currently in
hsm | The oven state machine |
stnext toasting | ( | int | signal, | |
void * | param | |||
) |
simplehsm_t hsm = {NULL} |
The Oven state machine object