FW Profile - C1 Implementation
FwSmConstants.h File Reference

Header file to define all constants and types for the state machine module of the FW Profile. More...

Go to the source code of this file.

Macros

#define FW_TR_EXECUTE   0
 Identifier of "Execute" transition in a state machine. More...
 

Typedefs

typedef struct FwSmDescFwSmDesc_t
 Forward declaration for the pointer to a state machine descriptor. More...
 
typedef void(* FwSmAction_t) (FwSmDesc_t)
 Type for a pointer to a state machine action. More...
 
typedef int FwSmBool_t
 Type used for booleans (0 is "false" and 1 is "true"). More...
 
typedef FwSmBool_t(* FwSmGuard_t) (FwSmDesc_t)
 Type for a pointer to a state machine guard. More...
 
typedef unsigned char FwSmCounterU1_t
 Type used for unsigned counters with a "short" range. More...
 
typedef unsigned short int FwSmCounterU2_t
 Type used for unsigned counters with a "medium" range. More...
 
typedef unsigned int FwSmCounterU3_t
 Type used for unsigned counters with a "long" range. More...
 
typedef long unsigned int FwSmCounterU4_t
 Type used for unsigned counters with a "long int" range. More...
 
typedef signed char FwSmCounterS1_t
 Type used for signed counters with a "short" range. More...
 

Enumerations

Detailed Description

Header file to define all constants and types for the state machine module of the FW Profile.

This header file should be included by all applications which use the state machine module of the FW Profile.

Author
Vaclav Cechticky vacla.nosp@m.v.ce.nosp@m.chtic.nosp@m.ky@p.nosp@m.np-so.nosp@m.ftwa.nosp@m.re.co.nosp@m.m
Alessandro Pasetti paset.nosp@m.ti@p.nosp@m.np-so.nosp@m.ftwa.nosp@m.re.co.nosp@m.m

This file is part of the FW Profile.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

For information on alternative licensing, please contact P&P Software GmbH.

Definition in file FwSmConstants.h.

Macro Definition Documentation

#define FW_TR_EXECUTE   0

Identifier of "Execute" transition in a state machine.

Transition commands to a state machine are identified by a non-negative integer. The value of zero is reserved for the "Execute" transition and should not be used by applications.

Definition at line 232 of file FwSmConstants.h.

Typedef Documentation

typedef void(* FwSmAction_t) (FwSmDesc_t)

Type for a pointer to a state machine action.

A state machine action is a function which encapsulates one of the following: the entry action of a state, the exit action of a state, the do-action of a state, a transition action. A state machine action takes the descriptor of the state machine as an argument.

Pointers to state machine actions are used when a new state machine is defined: all the actions in the state machine must be defined as functions which conform to the FwSmAction_t prototype and are loaded into the state machine as function pointers.

Definition at line 46 of file FwSmConstants.h.

typedef int FwSmBool_t

Type used for booleans (0 is "false" and 1 is "true").

Definition at line 49 of file FwSmConstants.h.

typedef signed char FwSmCounterS1_t

Type used for signed counters with a "short" range.

Definition at line 79 of file FwSmConstants.h.

typedef unsigned char FwSmCounterU1_t

Type used for unsigned counters with a "short" range.

Definition at line 67 of file FwSmConstants.h.

typedef unsigned short int FwSmCounterU2_t

Type used for unsigned counters with a "medium" range.

Definition at line 70 of file FwSmConstants.h.

typedef unsigned int FwSmCounterU3_t

Type used for unsigned counters with a "long" range.

Definition at line 73 of file FwSmConstants.h.

typedef long unsigned int FwSmCounterU4_t

Type used for unsigned counters with a "long int" range.

Definition at line 76 of file FwSmConstants.h.

typedef struct FwSmDesc* FwSmDesc_t

Forward declaration for the pointer to a state machine descriptor.

A state machine descriptor is a data structure which holds all the information describing a state machine instance. Users only manipulate the pointer to the state machine descriptor. The internal definition of the state machine descriptor (see FwSmPrivate.h) is kept hidden from users.

Definition at line 32 of file FwSmConstants.h.

typedef FwSmBool_t(* FwSmGuard_t) (FwSmDesc_t)

Type for a pointer to a state machine guard.

A state machine guard is a function which encapsulates a transition guard in a state machine. The state machine guard takes the descriptor of the state machine as an argument and it returns 0 to signify that the guard is false or a non-zero value (typically 1) to signify that the guard is true.

Pointers to state machine guards are used when a new state machine is defined: all the guards in the state machine must be defined as functions which conform to the FwSmGuard_t prototype and are loaded into the state machine as function pointers.

Definition at line 64 of file FwSmConstants.h.

Enumeration Type Documentation

Error codes and function return codes for the state machine functions.

Enumerator
smSuccess 

Return codes of a function which has completed execution without errors.

smOutOfMemory 

A call to malloc has failed (it has returned a NULL pointer).

smNullPState 

There is an undefined state in a state machine.

smNullCState 

There is an undefined choice pseudo-state in a state machine.

smNullTrans 

There is an undefined transition in a state machine.

smConfigErr 

A configuration error has been detected during the state machine configuration process.

smIllStateId 

A state is added to a state machine with an illegal (out-of-range) identifier.

smIllChoiceId 

A choice pseudo-state is added to a state machine with an illegal (out-of-range) identifier.

smStateIdInUse 

A state is added twice to the same state machine.

smChoiceIdInUse 

A choice pseudo-state is added twice to the same state machine.

smUndefinedTransSrc 

A transition is added to a state machine with a source (either a state or a choice pseudo-state) which has not yet been defined.

smIllegalPDest 

A transition is added to a state machine with an illegal (out-of-range) state destination.

smIllegalCDest 

A transition is added to a state machine with an illegal (out-of-range) choice pseudo-state destination.

smIllNOfOutTrans 

A choice pseudo-state is added to a state machine with less than 1 out-going transitions.

smIllTransSrc 

A transition is added to a state machine with a source which has an illegal identifier.

smTransErr 

An error was encountered while executing a transition in a state machine (see FwSmMakeTrans).

smTooManyTrans 

A transition from a certain source (either a state or a choice pseudo-state) is added to a state machine but there isn't space for it in the transition array of the state machine descriptor (because all the locations reserved for transitions from that source are already full).

This error code is, for instance, generated if the same transition is added twice to the state machine or if an insufficient number of out-going transitions has been declared for a state or choice pseudo-state.

smTooManyOutTrans 

A state or choice pseudo-state is added to a state machine which has more out-going transitions than fit into the transition array of the state machine descriptor.

smTooManyActions 

The number of actions added to the state machine exceeds the number of actions declared when the state machine descriptor was created.

smTooManyGuards 

The number of guards added to the state machine exceeds the number of guards declared when the state machine descriptor was created.

smTooFewActions 

The number of actions added to the state machine is smaller than the number of actions declared when the state machine descriptor was created.

smTooFewGuards 

The number of guards added to the state machine is smaller than the number of guards declared when the state machine descriptor was created.

smNegOutTrans 

A state is added with a negative number of outgoing transitions.

smUndefAction 

The overridden action in a derived state machine does not exist.

smUndefGuard 

The overridden guard in a derived state machine does not exist.

smEsmDefined 

The state in a derived state machine to which an embedded state machine is added already holds an embedded state machine.

smNotDerivedSM 

The state machine where an action or a guard is overridden or a state machine is embedded is not a derived state machine.

smWrongNOfActions 

The number of actions in the base state machine is not the same as in the derived state machine.

smWrongNOfGuards 

The number of guards in the base state machine is not the same as in the derived state machine.

smUnreachablePState 

The state machine has a state which is not a destination of any transition.

smUnreachableCState 

The state machine has a choice pseudo-state which is not a destination of any transition.

Definition at line 82 of file FwSmConstants.h.

P&P Software GmbH, Copyright 2011, All Rights Reserved