FW Profile - C1 Implementation
FwSmAux.h File Reference

Declaration of the auxiliary interface for a FW State Machine. More...

Go to the source code of this file.

Functions

void FwSmPrintConfig (FwSmDesc_t smDesc, FILE *stream)
 Print the configuration of the state machine to an output stream. More...
 
void FwSmPrintConfigRec (FwSmDesc_t smDesc, FILE *stream)
 Print the configuration of the state machine and its embedded state machines to an output stream. More...
 
char * FwSmPrintErrCode (FwSmErrCode_t errCode)
 Print the name of a state machine error code. More...
 

Detailed Description

Declaration of the auxiliary interface for a FW State Machine.

The auxiliary interface offers functions which support the development of an application which uses the FW State Machine but which are not expected to be used during normal operation.

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 FwSmAux.h.

Function Documentation

void FwSmPrintConfig ( FwSmDesc_t  smDesc,
FILE *  stream 
)

Print the configuration of the state machine to an output stream.

This function extracts all the configuration information from the argument state machine and prints it to the argument output stream. It is legal for the argument state machine to be only partly configured. It is also legal to call this function on a state machine which has already been started.

The function describes the configuration of the argument state machine in terms of its states, choice pseudo-states, transitions, actions and guards. The following conventions are used to refer to these items:

  • The name of a state is its identifier.
  • The name of a choice pseudo-state is its identifier.
  • Transitions are identified by their source, destination, transition identifier, transition action and guard.
  • The name of an action is an integer in the range [1,N] where N is total number of actions declared for the state machine and the action with identifier 'i' is the i-th action to have been added to the state machine.
  • The name of a guard is an integer in the range [1,M] where M is total number of guards declared for the state machine and the guard with identifier 'i' is the i-th guard to have been added to the state machine.

This function assumes the argument output stream to be open and to have enough space to receive the output generated by the function. The function neither closes nor flushes the output stream. Opening and closing of the output stream must thus be done by the caller.

Parameters
smDescthe descriptor of the state machine to be started.
streamthe output stream to which the configuration information is printed.

Definition at line 23 of file FwSmAux.c.

void FwSmPrintConfigRec ( FwSmDesc_t  smDesc,
FILE *  stream 
)

Print the configuration of the state machine and its embedded state machines to an output stream.

This is a recursive version of FwSmPrintConfig which operates on a state machine and, recursively, on all its embedded state machines. This function assumes the argument output stream to be open and to have enough space to receive the output generated by the function. The function neither closes nor flushes the output stream. Opening and closing of the output stream must thus be done by the caller.

Parameters
smDescthe descriptor of the state machine to be started.
streamthe output stream to which the configuration information is printed.

Definition at line 263 of file FwSmAux.c.

char* FwSmPrintErrCode ( FwSmErrCode_t  errCode)

Print the name of a state machine error code.

Error code are defined as instances of an enumerated type in FwSmConstants.h. This function translates an error code to a string holding the name of its enumerated value.

Parameters
errCodethe error code
Returns
the string holding the name of the error code

Definition at line 278 of file FwSmAux.c.

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