uFSM  1.0
IoT u-Micro Finite State Machine library
uFsm Class Reference

#include <uFsm.hpp>

Collaboration diagram for uFsm:
Collaboration graph

Public Member Functions

 uFsm (uEventHandler *trans, uint32_t maxNumTransitions, uint32_t initialState)
 
virtual ~uFsm (void)
 
uint32_t defineTransition (uint32_t sourceState, uint32_t destinationState, uint32_t event, uint32_t index)
 
bool control (uint32_t event, void *parameters=NULL)
 
void generateEvent (uint32_t event, void *parameters=NULL)
 

Detailed Description

Micro Event based Finite State Machine

Definition at line 46 of file uFsm.hpp.

Constructor & Destructor Documentation

uFsm::uFsm ( uEventHandler trans,
uint32_t  maxNumTransitions,
uint32_t  initialState 
)

uFsm - Event based Finite State Machine

Parameters
trans- Event Handler instance
maxNumTransitions- maximum allocation for transitions
initialState- machine initial state.

Definition at line 35 of file uFsm.cpp.

uFsm::~uFsm ( void  )
virtual

Clean/deallocates transition array and Events in the queue.

Definition at line 64 of file uFsm.cpp.

Member Function Documentation

bool uFsm::control ( uint32_t  event,
void *  parameters = NULL 
)

Inserts an Event in the Event queue and then process it.

Parameters
event- new event Id to add
parameters- pointer to location with extra data to pass on event handling or NULL
Returns
true/false from the event function handler.

Definition at line 170 of file uFsm.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

uint32_t uFsm::defineTransition ( uint32_t  sourceState,
uint32_t  destinationState,
uint32_t  event,
uint32_t  index 
)

Defines a transition based on an Event

Parameters
sourceState- State "from"
destinationState- State "to"
event- happened Event
index- function handler index
Returns
hash index assigned

Definition at line 146 of file uFsm.cpp.

Here is the caller graph for this function:

void uFsm::generateEvent ( uint32_t  event,
void *  parameters = NULL 
)

Add an Event to the Event queue

Parameters
event- Event type
parameters- data pointer to be accessed by the event handler function

Definition at line 220 of file uFsm.cpp.

Here is the caller graph for this function:


The documentation for this class was generated from the following files: