FW Profile - C1 Implementation
FwSmMakeTest.h File Reference

Declaration of functions to create and configure test state machines. More...

Go to the source code of this file.

Data Structures

struct  TestSmData
 Type for the state machine data for the test state machines. More...
 

Macros

#define STATE_S1   1
 A state identifier.
 
#define STATE_S2   2
 A state identifier.
 
#define STATE_S3   3
 A state identifier.
 
#define STATE_S4   4
 A state identifier.
 
#define CPS1   1
 A choice pseudo-state identifier.
 
#define CPS2   2
 A choice pseudo-state identifier.
 
#define TR_S1_FPS   2
 A transition identifier.
 
#define TR_IPS_CPS1   1
 A transition identifier.
 
#define TR_CPS1_S1   2
 A transition identifier.
 
#define TR_CPS1_FPS   3
 A transition identifier.
 
#define TR1   30
 A transition identifier.
 
#define TR2   12
 A transition identifier.
 
#define TR3   13
 A transition identifier.
 
#define TR4   14
 A transition identifier.
 
#define TR5   15
 A transition identifier.
 
#define TR6   20
 A transition identifier.
 
#define TR_CPS_S1   1
 A transition identifier.
 
#define TR_CPS_S2   1
 A transition identifier.
 
#define LOG_ARRAY_SIZE   50
 Define size of the log arrays. More...
 

Functions

FwSmDesc_t FwSmMakeTestSM1 (struct TestSmData *smData)
 Operation to create and configure the state machine SM1. More...
 
FwSmDesc_t FwSmMakeTestSM1Static (struct TestSmData *smData)
 Operation to create and configure the state machine SM1 (see FwSmMakeTestSM1 and figure below) statically using the interface defined in FwSmSCreate.h. More...
 
FwSmDesc_t FwSmMakeTestSM2 (struct TestSmData *smData)
 Operation to create and configure the state machine SM2. More...
 
FwSmDesc_t FwSmMakeTestSM3 (struct TestSmData *smData, struct TestSmData *esmData)
 Operation to create and configure the state machine SM3. More...
 
FwSmDesc_t FwSmMakeTestSM4 (struct TestSmData *smData)
 Operation to create and configure the state machine SM4. More...
 
FwSmDesc_t FwSmMakeTestSM5 (struct TestSmData *smData)
 Operation to create and configure the state machine SM5. More...
 
FwSmDesc_t FwSmMakeTestSM5Static (struct TestSmData *smData)
 Operation to create and configure the state machine SM5 (see FwSmMakeTestSM5 and figure below) statically using the interface defined in FwSmSCreate.h. More...
 
FwSmDesc_t FwSmMakeTestSM5Dir (struct TestSmData *smData)
 Operation to create and configure the state machine SM5 (see FwSmMakeTestSM5 and figure below) by directly instantiating and initializing the internal data structures in the state machine descriptor. More...
 
FwSmDesc_t FwSmMakeTestSM6 (struct TestSmData *smData, struct TestSmData *esmData)
 Operation to create and configure the state machine SM6. More...
 
FwSmDesc_t FwSmMakeTestSM7 (struct TestSmData *smData)
 Operation to create and configure the state machine SM7. More...
 
FwSmDesc_t FwSmMakeTestSM8 (struct TestSmData *smData)
 Operation to create and configure a degenerate state machine with no states. More...
 
FwSmDesc_t FwSmMakeTestSM9 (struct TestSmData *smData)
 Operation to create and configure a degenerate state machine with no transitions other than the initial transition. More...
 
FwSmDesc_t FwSmMakeTestSM9Static (struct TestSmData *smData)
 Operation to create and configure the state machine SM5 (see FwSmMakeTestSM9 and figure below) statically using the interface defined in FwSmSCreate.h. More...
 
FwSmDesc_t FwSmMakeTestSM10 (struct TestSmData *smData, struct TestSmData *esmData)
 Operation to create and configure the state machine SM10. More...
 
FwSmDesc_t FwSmMakeTestSM11 (struct TestSmData *smData)
 Operation to create and configure a degenerate state machine with neither states nor choice pseudo-states. More...
 
FwSmDesc_t FwSmMakeTestSM12 (struct TestSmData *smData)
 Operation to create and configure a state machine where a transition has a choice pseudo-state as both source and destination. More...
 
FwSmDesc_t FwSmMakeTestSM13 (struct TestSmData *smData)
 Operation to create and configure a state machine where the 'execute' transition has a choice pseudo-state and the final pseudo-state as destination. More...
 
FwSmDesc_t FwSmMakeTestSM14 (struct TestSmData *smData)
 Operation to create and configure a state machine where the choice pseudo-state is used both to split a transition out of a state and to connect two transitions from two different states ("junction"). More...
 
FwSmDesc_t FwSmMakeTestSM15 (struct TestSmData *smData)
 Operation to create and configure a state machine which uses the execution counters. More...
 
FwSmDesc_t FwSmMakeTestSMDer1 (FwSmDesc_t smDescBase, struct TestSmData *smData)
 Create a derived state machine and override one of its actions and one of its guards. More...
 
FwSmDesc_t FwSmMakeTestSMDer1Static (FwSmDesc_t smDescBase, struct TestSmData *smData)
 Create a derived state machine and override one of its actions and one of its guards. More...
 
FwSmDesc_t FwSmMakeTestSM16_1 (struct TestSmData *smData)
 Operation to create and configure a state machine to verify the order of evaluation of guards. More...
 
FwSmDesc_t FwSmMakeTestSM16_2 (struct TestSmData *smData)
 Operation to create and configure a state machine to verify the order of evaluation of guards. More...
 
FwSmDesc_t FwSmMakeTestSM16_3 (struct TestSmData *smData)
 Operation to create and configure a state machine to verify the order of evaluation of guards. More...
 

Detailed Description

Declaration of functions to create and configure test state machines.

The test state machines are used in the test suite to verify the requirements of the FW State Machine Module.

The following acronyms are used in this file:

  • IPS = Initial Pseudo-State
  • CPS = Choice Pseudo-State
  • FPS = Final Pseudo-State
  • ESM = Embedded State Machine

The data for the state machines defined in this file are instances of a data structure of type TestSmData.

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

Macro Definition Documentation

#define LOG_ARRAY_SIZE   50

Define size of the log arrays.

The log arrays are static arrays to which the actions of the test state machines write various outputs. They are used to check which actions have been executed and in which sequence.

Definition at line 78 of file FwSmMakeTest.h.

Function Documentation

FwSmDesc_t FwSmMakeTestSM1 ( struct TestSmData smData)

Operation to create and configure the state machine SM1.

This state machine has the following characteristics (see also figure below):

  • One single state S1.
  • No choice pseudo-states.
  • Transition from the IPS to S1.
  • Transition from S1 to the FPS with transition trigger TR_S1_FPS.
  • The entry action of S1 increments counter_1 by 1.
  • The do action of S1 increments counter counter_1 by 2.
  • There is no exit action in S1.
  • The transition actions increment counter counter_2 by 1.
  • The transition guard on the transition from S1 to the FPS returns the value of flag_1.
SM1.png
Parameters
smDatathe data structure upon which the state machine operates.
Returns
the descriptor of the created state machine or NULL if the creation or configuration of the state machine failed.

Definition at line 208 of file FwSmMakeTest.c.

FwSmDesc_t FwSmMakeTestSM10 ( struct TestSmData smData,
struct TestSmData esmData 
)

Operation to create and configure the state machine SM10.

This state machine has the following characteristics (see also figure below):

  • Two states S1 and S2.
  • State machine SM1 (see FwSmMakeTestSM1) is embedded in S2.
  • One choice pseudo-state CPS1.
  • Transitions as follows:
    1. transition from IPS to S1;
    2. TR1 transitions from S1 to CPS1;
    3. transition from CPS1 to S2 with flag_1 as guard;
    4. transition from CPS1 to FPS with flag_2 as guard;
  • State entry actions increment counter_1 by 1.
  • No do actions.
  • State exit actions increment counter counter_1 by 4.
  • Transition actions increment counter counter_2 by 1.
SM10.png
Parameters
smDatathe data structure upon which the state machine operates
esmDatathe data structure upon which the embedded state machine operates
Returns
the descriptor of the created state machine or NULL if the creation or configuration of the state machine failed.

Definition at line 581 of file FwSmMakeTest.c.

FwSmDesc_t FwSmMakeTestSM11 ( struct TestSmData smData)

Operation to create and configure a degenerate state machine with neither states nor choice pseudo-states.

This state machine has the following characteristics (see also figure below):

  • No state.
  • No choice pseudo-states.
  • Transitions as follows:
    1. transition from IPS to FPS.
  • Transition action increments counter counter_2 by 1.

The state machine is created by directly instantiating its internal data structures.

SM11.png
Parameters
smDatathe data structure upon which the state machine operates
Returns
the descriptor of the created state machine or NULL if the creation or configuration of the state machine failed.

Definition at line 611 of file FwSmMakeTest.c.

FwSmDesc_t FwSmMakeTestSM12 ( struct TestSmData smData)

Operation to create and configure a state machine where a transition has a choice pseudo-state as both source and destination.

Execution of the transition with a choice pseudo-state as both source and destination causes an error. This state machine has the following characteristics:

  • One single state S1.
  • One single choice pseudo-state CPS1.
  • Four transitions:
    1. from IPS to CPS1,
    2. from CPS1 to CPS1 (illegal transition),
    3. from CPS1 to FPS,
    4. from S1 to FPS.
  • State entry actions increment counter counter_1 by 1.
  • State do actions increment counter counter_1 by 2.
  • State exit actions increment counter counter_1 by 4.
  • Transition actions increment counter counter_2 by 1.
  • Guard on transition (2) returns the value of flag_1.
  • Guard on transition (3) returns the value of flag_2.
  • Guard on transition (4) returns the value of flag_2.

The transition from CPS1 to CPS1 is partly configured "by hand" by directly assigning values to the internal data structures of the state machine descriptor (this is an illegal transition and it is impossible to define it using the standard configuration operations of FwSmConfig.h).

Parameters
smDatathe data structure upon which the state machine operates
Returns
the descriptor of the created state machine or NULL if the creation or configuration of the state machine failed.

Definition at line 652 of file FwSmMakeTest.c.

FwSmDesc_t FwSmMakeTestSM13 ( struct TestSmData smData)

Operation to create and configure a state machine where the 'execute' transition has a choice pseudo-state and the final pseudo-state as destination.

This state machine has the following characteristics (see also figure below):

  • One single state S1.
  • One single choice pseudo-state CPS1.
  • Five transitions:
    1. from IPS to S1
    2. from S1 to CPS1 ("Execute" transition)
    3. from CPS1 to S1
    4. from CPS1 to FPS
    5. from S1 to FPS ("Execute" transition)
  • State entry actions increment counter counter_1 by 1.
  • State do actions increment counter counter_1 by 2.
  • State exit actions increment counter counter_1 by 4.
  • No transition actions.
  • No guard on transition (1).
  • Guard on transition (2) returns the value of flag_1.
  • Guard on transition (3) returns the value of flag_1.
  • Guard on transition (4) returns the value of flag_2.
  • Guard on transition (5) returns the value of flag_2.
SM13.png
Parameters
smDatathe data structure upon which the state machine operates
Returns
the descriptor of the created state machine or NULL if the creation or configuration of the state machine failed.

Definition at line 679 of file FwSmMakeTest.c.

FwSmDesc_t FwSmMakeTestSM14 ( struct TestSmData smData)

Operation to create and configure a state machine where the choice pseudo-state is used both to split a transition out of a state and to connect two transitions from two different states ("junction").

This state machine has the following characteristics (see also figure below):

  • Two states S1 and S2.
  • Two choice pseudo-state CPS1 and CPS2.
  • Six transitions:
    1. from IPS to CPS1
    2. from CPS1 to S1
    3. from CPS1 to S2
    4. from S1 to CPS2 (transition trigger TR1)
    5. from S2 to CPS2 (transition trigger TR2)
    6. from CPS2 to FPS
  • No state actions.
  • Transition actions increment counter counter_2 by 4.
  • No guard on transitions (1), (4), (5) and (6).
  • Guard on transition (2) returns the value of flag_1.
  • Guard on transition (3) returns the value of flag_2.
SM14.png
Parameters
smDatathe data structure upon which the state machine operates
Returns
the descriptor of the created state machine or NULL if the creation or configuration of the state machine failed.

Definition at line 704 of file FwSmMakeTest.c.

FwSmDesc_t FwSmMakeTestSM15 ( struct TestSmData smData)

Operation to create and configure a state machine which uses the execution counters.

The value of the execution counters is stored in the procedure data by the state machine actions and the value of the state execution counter is used as a guard to control state transitions.

This state machine has the following characteristics (see also figure below):

  • Two states S1 and S2.
  • One choice pseudo-state CPS1.
  • Five transitions:
    1. from IPS to S1
    2. from S1 to CPS1 (Execute transition trigger)
    3. from CPS1 to FPS
    4. from CPS1 to S2
    5. from S2 to S1 (transition trigger TR1)
  • All states have an initial action which writes the state machine execution counter and the state execution counter to, respectively, counter_1 and counter_2 in the state machine data structure.
  • No transition actions.
  • Guard on transition (2) waits 1 execution cycle.
  • Guard on transition (3) returns true if the SM Execution Counter is equal to 5.
  • Guard on transition (4) returns true if the SM Execution Counter is smaller than 5.
  • Guard on transition (5) waits two execution cycles.
SM15.png
Parameters
smDatathe data structure upon which the state machine operates
Returns
the descriptor of the created state machine or NULL if the creation or configuration of the state machine failed.

Definition at line 732 of file FwSmMakeTest.c.

FwSmDesc_t FwSmMakeTestSM16_1 ( struct TestSmData smData)

Operation to create and configure a state machine to verify the order of evaluation of guards.

This state machine has the following characteristics (see also figure below):

  • Four states S1 to S4.
  • One choice pseudo-state CPS1.
  • Eight transitions:
    1. from IPS to S1
    2. from S1 to S2 (TR1 transition trigger and Flag_1 guard)
    3. from S1 to S3 (TR1 transition trigger and Flag_2 guard)
    4. from S1 to S4 (TR1 transition trigger and Flag_3 guard)
    5. from S1 to CPS1 (TR2 transition trigger)
    6. from CPS1 to S2 (Flag_1 guard)
    7. from CPS1 to S3 (Flag_2 guard)
    8. from CPS1 to S4 (Flag_3 guard)
  • Neither state nor transition actions.

Transitions are added to the state machine during the configuration process in the order in which they are listed.

SM16.png
Parameters
smDatathe data structure upon which the state machine operates
Returns
the descriptor of the created state machine or NULL if the creation or configuration of the state machine failed.

Definition at line 792 of file FwSmMakeTest.c.

FwSmDesc_t FwSmMakeTestSM16_2 ( struct TestSmData smData)

Operation to create and configure a state machine to verify the order of evaluation of guards.

This state machine has the following characteristics (see also figure below):

  • Four states S1 to S4.
  • One choice pseudo-state CPS1.
  • Eight transitions:
    1. from IPS to S1
    2. from S1 to S4 (TR1 transition trigger and Flag_3 guard)
    3. from S1 to S3 (TR1 transition trigger and Flag_2 guard)
    4. from S1 to S2 (TR1 transition trigger and Flag_1 guard)
    5. from S1 to CPS1 (TR2 transition trigger)
    6. from CPS1 to S4 (Flag_3 guard)
    7. from CPS1 to S3 (Flag_2 guard)
    8. from CPS1 to S2 (Flag_1 guard)
  • Neither state nor transition actions.

Transitions are added to the state machine during the configuration process in the order in which they are listed.

SM16.png
Parameters
smDatathe data structure upon which the state machine operates
Returns
the descriptor of the created state machine or NULL if the creation or configuration of the state machine failed.

Definition at line 823 of file FwSmMakeTest.c.

FwSmDesc_t FwSmMakeTestSM16_3 ( struct TestSmData smData)

Operation to create and configure a state machine to verify the order of evaluation of guards.

This state machine has the following characteristics (see also figure below):

  • Four states S1 to S4.
  • One choice pseudo-state CPS1.
  • Eight transitions:
    1. from IPS to S1
    2. from S1 to S3 (TR1 transition trigger and Flag_2 guard)
    3. from S1 to S4 (TR1 transition trigger and Flag_3 guard)
    4. from S1 to S2 (TR1 transition trigger and Flag_1 guard)
    5. from S1 to CPS1 (TR2 transition trigger)
    6. from CPS1 to S3 (Flag_2 guard)
    7. from CPS1 to S4 (Flag_3 guard)
    8. from CPS1 to S2 (Flag_1 guard)
  • Neither state nor transition actions.

Transitions are added to the state machine during the configuration process in the order in which they are listed.

SM16.png
Parameters
smDatathe data structure upon which the state machine operates
Returns
the descriptor of the created state machine or NULL if the creation or configuration of the state machine failed.

Definition at line 854 of file FwSmMakeTest.c.

FwSmDesc_t FwSmMakeTestSM1Static ( struct TestSmData smData)

Operation to create and configure the state machine SM1 (see FwSmMakeTestSM1 and figure below) statically using the interface defined in FwSmSCreate.h.

SM1.png
Parameters
smDatathe data structure upon which the state machine operates.
Returns
the descriptor of the created state machine or NULL if the creation or configuration of the state machine failed.

Definition at line 228 of file FwSmMakeTest.c.

FwSmDesc_t FwSmMakeTestSM2 ( struct TestSmData smData)

Operation to create and configure the state machine SM2.

This state machine has the following characteristics:

  • One single state S1.
  • One single choice pseudo-state CPS1.
  • Four transitions:
    1. from IPS to CPS1,
    2. from CPS1 to S1,
    3. from CPS1 to FPS,
    4. from S1 to FPS (trigger: TR1_S1_FPS).
  • State entry actions increment counter counter_1 by 1.
  • State do actions increment counter counter_1 by 2.
  • State exit actions increment counter counter_1 by 4.
  • Transition actions increment counter counter_2 by 1.
  • Guard on transition (2) returns the value of flag_1.
  • Guard on transition (3) returns the value of flag_2.
  • Guard on transition (4) returns the value of flag_2.
SM2.png
Parameters
smDatathe data structure upon which the state machine operates
Returns
the descriptor of the created state machine or NULL if the creation or configuration of the state machine failed.

Definition at line 243 of file FwSmMakeTest.c.

FwSmDesc_t FwSmMakeTestSM3 ( struct TestSmData smData,
struct TestSmData esmData 
)

Operation to create and configure the state machine SM3.

This state machine is the same as SM1 (see FwSmMakeTestSM1) but it has SM2 (see FwSmMakeTestSM2) embedded within state S1 of SM1.

Parameters
smDatathe data structure upon which the embedding state machine operates
esmDatathe data structure upon which the embedded state machine operates
Returns
the descriptor of the created state machine or NULL if the creation or configuration of the state machine failed.

Definition at line 266 of file FwSmMakeTest.c.

FwSmDesc_t FwSmMakeTestSM4 ( struct TestSmData smData)

Operation to create and configure the state machine SM4.

This state machine has the following characteristics (see also figure below):

  • Two states S1 and S2.
  • No choice pseudo-states.
  • Transitions as follows:
    1. Transition from IPS to S1;
    2. "Execute" transitions from S1 to S2;
    3. "Execute" transition from S2 to S1;
    4. TR6 transition from S2 to S1;
    5. TR3 transition from S2 to FPS;
    6. TR4 self-transition on S2.
  • State entry actions increment counter_1 by 1.
  • State do actions increment counter counter_1 by 2.
  • State exit actions increment counter counter_1 by 4.
  • Transition actions increment counter counter_2 by 1.
  • Transition guards return the value of flag_1.
SM4.png
Parameters
smDatathe data structure upon which the state machine operates
Returns
the descriptor of the created state machine or NULL if the creation or configuration of the state machine failed.

Definition at line 296 of file FwSmMakeTest.c.

FwSmDesc_t FwSmMakeTestSM5 ( struct TestSmData smData)

Operation to create and configure the state machine SM5.

This state machine has the following characteristics:

  • Two states S1 and S2.
  • One choice pseudo-state CPS1.
  • Transitions as follows:
    1. transition from IPS to S1;
    2. TR2 transitions from S1 to S2;
    3. TR6 transition from S2 to CPS1;
    4. transition from CPS1 to S1 with flag_1 as guard;
    5. transition from CPS1 to S2 with flag_2 as guard;
    6. TR5 transition from S2 to FPS;
    7. TR4 self-transition on S2.
  • State entry actions increment counter_1 by 1.
  • State do actions increment counter counter_1 by 2.
  • State exit actions increment counter counter_1 by 4.
  • Transition actions increment counter counter_2 by 1.
  • Transition guards return the value of flag_1 with the exception of the transition from S2 to CPS1 which has no guard and the transition from CPS1 to S2 which returns the value of flag_2.
SM5.png
Parameters
smDatathe data structure upon which the state machine operates
Returns
the descriptor of the created state machine or NULL if the creation or configuration of the state machine failed.

Definition at line 321 of file FwSmMakeTest.c.

FwSmDesc_t FwSmMakeTestSM5Dir ( struct TestSmData smData)

Operation to create and configure the state machine SM5 (see FwSmMakeTestSM5 and figure below) by directly instantiating and initializing the internal data structures in the state machine descriptor.

The data structures for the state machine are created as static variables and are initialized directly (i.e. without using the creation functions offered by the FwSmDCreate.h or FwSmSCreate moduls and the configuration functions offered by FwSmConfig.h).

The approach used in this function to initialize the state machine descriptor is non-nominal (normally the state machine descriptor is created and configured using the operations made available by the FW State Machine Module). Applications which use this approach to create and initialize their state machine descriptors will not need to link to the creation and configuration operations offered by the FW State Machine Module and will therefore reduce the memory footprint of their application.

SM5.png
Parameters
smDatathe data structure upon which the state machine operates
Returns
the descriptor of the created state machine.

Definition at line 370 of file FwSmMakeTest.c.

FwSmDesc_t FwSmMakeTestSM5Static ( struct TestSmData smData)

Operation to create and configure the state machine SM5 (see FwSmMakeTestSM5 and figure below) statically using the interface defined in FwSmSCreate.h.

SM5.png
Parameters
smDatathe data structure upon which the state machine operates
Returns
the descriptor of the created state machine.

Definition at line 348 of file FwSmMakeTest.c.

FwSmDesc_t FwSmMakeTestSM6 ( struct TestSmData smData,
struct TestSmData esmData 
)

Operation to create and configure the state machine SM6.

This state machine is the same as state machine SM4 (see FwSmMakeTestSM4) with state machine SM5 (see FwSmMakeTestSM5) embedded within its state S2.

Parameters
smDatathe data structure upon which the state machine operates
esmDatathe data structure upon which the embedded state machine operates
Returns
the descriptor of the created state machine or NULL if the creation or configuration of the state machine failed.

Definition at line 475 of file FwSmMakeTest.c.

FwSmDesc_t FwSmMakeTestSM7 ( struct TestSmData smData)

Operation to create and configure the state machine SM7.

This state machine has the following characteristics (see also figure below):

  • One state S1.
  • One choice pseudo-state CPS1.
  • Transitions as follows:
    1. transition from IPS to S1;
    2. TR1 transitions from S1 to CPS1 with no guard;
    3. transition from CPS1 to S1 with flag_1 as guard;
    4. transition from CPS1 to FPS with flag_2 as guard;
  • No entry action.
  • State do actions increment counter counter_1 by 2.
  • State exit actions increment counter counter_1 by 4.
  • Transition actions increment counter counter_2 by 1.
  • Transition guards return the value of either flag_1 or flag_2 as stated above.
SM7.png
Parameters
smDatathe data structure upon which the state machine operates
Returns
the descriptor of the created state machine or NULL if the creation or configuration of the state machine failed.

Definition at line 504 of file FwSmMakeTest.c.

FwSmDesc_t FwSmMakeTestSM8 ( struct TestSmData smData)

Operation to create and configure a degenerate state machine with no states.

This state machine has the following characteristics (see also figure below):

  • No state.
  • One choice pseudo-state CPS1.
  • Transitions as follows:
    1. transition from IPS to CPS1;
    2. transition from CPS1 to FPS with flag_1 as guard;
    3. transition from CPS1 to FPS with flag_2 as guard;
  • Transition actions increment counter counter_2 by 1.
SM8.png
Parameters
smDatathe data structure upon which the state machine operates
Returns
the descriptor of the created state machine or NULL if the creation or configuration of the state machine failed.

Definition at line 527 of file FwSmMakeTest.c.

FwSmDesc_t FwSmMakeTestSM9 ( struct TestSmData smData)

Operation to create and configure a degenerate state machine with no transitions other than the initial transition.

This state machine has the following characteristics (see also figure below):

  • One state S1.
  • No choice pseudo-states.
  • Transition from initial pseudo-state to S1
  • State entry actions increment counter_1 by 1.
  • State do actions increment counter counter_1 by 2.
  • State exit actions increment counter counter_1 by 4.
  • Transition actions increment counter counter_2 by 1.
SM9.png
Parameters
smDatathe data structure upon which the state machine operates
Returns
the descriptor of the created state machine or NULL if the creation or configuration of the state machine failed.

Definition at line 548 of file FwSmMakeTest.c.

FwSmDesc_t FwSmMakeTestSM9Static ( struct TestSmData smData)

Operation to create and configure the state machine SM5 (see FwSmMakeTestSM9 and figure below) statically using the interface defined in FwSmSCreate.h.

SM9.png
Parameters
smDatathe data structure upon which the state machine operates
Returns
the descriptor of the created state machine or NULL if the creation or configuration of the state machine failed.

Definition at line 567 of file FwSmMakeTest.c.

FwSmDesc_t FwSmMakeTestSMDer1 ( FwSmDesc_t  smDescBase,
struct TestSmData smData 
)

Create a derived state machine and override one of its actions and one of its guards.

The base state machine is passed as an argument to the function. The function extends the base state machine and then it performs the following overrides on the derived state machine:

  • The action incrCnt1By1 (increment Counter_1 by 1) is overridden with action incrCnt1By8 (increment Counter_1 by 8).
  • The guard retFlag1 (return Flag_1) is overridden with guard retFlag2 (return Flag_2).

The derived state machine is created using the dynamic creation interface of FwSmDCreate.h.

Parameters
smDescBasethe base state machine
smDatathe data structure for the newly created state machine
Returns
the derived state machine

Definition at line 758 of file FwSmMakeTest.c.

FwSmDesc_t FwSmMakeTestSMDer1Static ( FwSmDesc_t  smDescBase,
struct TestSmData smData 
)

Create a derived state machine and override one of its actions and one of its guards.

The base state machine is passed as an argument to the function. This function assumes that the base state machine has 1 state, 3 actions, and 1 guard. The function extends the base state machine and then it performs the following overrides on the derived state machine:

  • The action incrCnt1By1 (increment Counter_1 by 1) is overridden with action incrCnt1By8 (increment Counter_1 by 8).
  • The guard retFlag1 (return Flag_1) is overridden with guard retFlag2 (return Flag_2).

The derived state machine is created using the static creation interface of FwSmSCreate.h.

Parameters
smDescBasethe base state machine
smDatathe data structure for the newly created state machine
Returns
the derived state machine

Definition at line 771 of file FwSmMakeTest.c.

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