113 if (nOfOutTrans < 0) {
124 pState = &(smBase->
pStates[stateId - 1]);
129 pState->
iDoAction = AddAction(smDesc, doAction);
131 pState->
iExitAction = AddAction(smDesc, exitAction);
133 smDesc->
esmDesc[stateId - 1] = esmDesc;
159 if (nOfOutTrans < 1) {
170 cState = &(smBase->
cStates[choiceId - 1]);
182 AddTrans(smDesc, 0, 0,
stoppedState, destId, trAction, NULL);
193 AddTrans(smDesc, transId, srcId,
properState, destId, trAction, trGuard);
211 AddTrans(smDesc, transId, srcId,
properState, 0, trAction, trGuard);
275 for (i = 0; i < nOfOutTrans; i++) {
281 trans = &(smBase->
trans[loc]);
287 trans->
dest = destId;
290 trans->
iTrAction = AddAction(smDesc, trAction);
293 trans->
iTrGuard = AddGuard(smDesc, trGuard);
302 if (action == NULL) {
315 if (i < smDesc->nOfActions) {
332 for (i = 1; i < smDesc->
nOfGuards; i++) {
341 if (i < smDesc->nOfGuards) {
376 for (i = 0; i < smBase->
nOfTrans; i++) {
383 for (i = 0; i < smBase->
nOfTrans; i++) {
400 for (i = 0; i < smDesc->
nOfGuards; i++) {
409 for (j = 0; j < smBase->
nOfTrans; j++) {
423 for (j = 0; j < smBase->
nOfTrans; j++) {
444 if (smDesc->
esmDesc[i] != NULL) {
483 for (i = 1; i < smDesc->
nOfGuards; i++) {
484 if (smDesc->
smGuards[i] == oldGuard) {
511 if (smDesc->
esmDesc[stateId - 1] != NULL) {
516 smDesc->
esmDesc[stateId - 1] = esmDesc;
A choice pseudo-state is added to a state machine with an illegal (out-of-range) identifier.
FwSmCounterS1_t outTransIndex
index of first out-going transition in transition array of SmBaseDesc_t
void FwSmAddTransStaToSta(FwSmDesc_t smDesc, FwSmCounterU2_t transId, FwSmCounterS1_t srcId, FwSmCounterS1_t destId, FwSmAction_t trAction, FwSmGuard_t trGuard)
Create a transition from a proper state to a proper state and add it to a state machine.
void * FwSmGetData(FwSmDesc_t smDesc)
Get the pointer to the state machine data in the state machine descriptor.
FwSmCounterS1_t dest
the index of the destination of the transition
FwSmCounterS1_t nOfOutTrans
number of outgoing transitions from the choice pseudo-state
FwSmCounterS1_t iTrGuard
the index of the guard associated to the transition
A transition from a certain source (either a state or a choice pseudo-state) is added to a state mach...
FwSmErrCode_t
Error codes and function return codes for the state machine functions.
There is an undefined transition in a state machine.
There is an undefined state in a state machine.
There is an undefined choice pseudo-state in a state machine.
FwSmCounterS1_t nOfActions
the number of actions (state actions + transition actions) in the state machine
A configuration error has been detected during the state machine configuration process.
FwSmAction_t * smActions
the state machine actions (state and transition actions)
FwSmCounterS1_t iDoAction
the do action for the state
The number of actions added to the state machine is smaller than the number of actions declared when ...
Declaration of the configuration interface for a FW State Machine.
FwSmCounterS1_t nOfPStates
the number of states in the state machine
void FwSmAddTransStaToCps(FwSmDesc_t smDesc, FwSmCounterU2_t transId, FwSmCounterS1_t srcId, FwSmCounterS1_t destId, FwSmAction_t trAction, FwSmGuard_t trGuard)
Create a transition from a proper state to a choice pseudo-state and add it to a state machine...
A choice pseudo-state is added to a state machine with less than 1 out-going transitions.
A transition is added to a state machine with a source (either a state or a choice pseudo-state) whic...
SmCState_t * cStates
array holding the choice pseudo-states in the state machine
A proper state in a state machine.
The number of guards added to the state machine exceeds the number of guards declared when the state ...
The number of actions added to the state machine exceeds the number of actions declared when the stat...
FwSmCounterU2_t id
the identifier (the "name") of the transition
void FwSmOverrideGuard(FwSmDesc_t smDesc, FwSmGuard_t oldGuard, FwSmGuard_t newGuard)
Override a guard in a derived state machine.
FwSmErrCode_t errCode
either 'success' or the code of the last error encountered by the state machine
The state machine where an action or a guard is overridden or a state machine is embedded is not a de...
The state machine has a choice pseudo-state which is not a destination of any transition.
FwSmErrCode_t FwSmCheckRec(FwSmDesc_t smDesc)
Recursively check the configuration of a state machine and all its embedded state machines...
FwSmCounterS1_t outTransIndex
index of first out-going transition in the transition array of SmBaseDesc_t
void FwSmAddChoicePseudoState(FwSmDesc_t smDesc, FwSmCounterS1_t choiceId, FwSmCounterS1_t nOfOutTrans)
Create a choice pseudo-state with the given characteristics and add it to a state machine...
void FwSmOverrideAction(FwSmDesc_t smDesc, FwSmAction_t oldAction, FwSmAction_t newAction)
Override an action (either a state action or a transition action) in a derived state machine...
FwSmCounterS1_t transCnt
the counter for the number of transitions added to the state machine
struct FwSmDesc ** esmDesc
the state machines embedded in the state machine
A transition is added to a state machine with an illegal (out-of-range) choice pseudo-state destinati...
FwSmBool_t(* FwSmGuard_t)(FwSmDesc_t)
Type for a pointer to a state machine guard.
int FwSmBool_t
Type used for booleans (0 is "false" and 1 is "true").
Either the initial or the final pseudo-state.
FwSmCounterS1_t nOfCStates
the number of choice pseudo-states in the state machine
FwSmCounterS1_t nOfOutTrans
number of outgoing transitions
unsigned short int FwSmCounterU2_t
Type used for unsigned counters with a "medium" range.
A state is added with a negative number of outgoing transitions.
void * smData
the pointer to the data manipulated by the state machine actions and guards
void(* FwSmAction_t)(FwSmDesc_t)
Type for a pointer to a state machine action.
The state machine has a state which is not a destination of any transition.
The overridden guard in a derived state machine does not exist.
FwSmCounterS1_t nOfTrans
the number of transitions in SM
Structure representing a transition.
Structure representing a state machine descriptor.
A choice pseudo-state is added twice to the same state machine.
void FwSmAddTransIpsToCps(FwSmDesc_t smDesc, FwSmCounterS1_t destId, FwSmAction_t trAction)
Create a transition from the initial pseudo-state to a choice pseudo-state and add it to a state mach...
void FwSmAddTransCpsToFps(FwSmDesc_t smDesc, FwSmCounterS1_t srcId, FwSmAction_t trAction, FwSmGuard_t trGuard)
Create a transition from a choice pseudo-state to the final pseudo-state and add it to a state machin...
A transition is added to a state machine with an illegal (out-of-range) state destination.
void FwSmSetData(FwSmDesc_t smDesc, void *smData)
Set the pointer to the state machine data in the state machine descriptor.
FwSmErrCode_t FwSmCheck(FwSmDesc_t smDesc)
Check the correctness and completeness of the configuration of a state machine descriptor.
void FwSmAddTransStaToFps(FwSmDesc_t smDesc, FwSmCounterU2_t transId, FwSmCounterS1_t srcId, FwSmAction_t trAction, FwSmGuard_t trGuard)
Create a transition from a proper state to the final pseudo-state and add it to a state machine...
FwSmCounterS1_t iExitAction
the exit action for the state
FwSmCounterS1_t iTrAction
the index of the action associated to the transition
Structure representing the base descriptor of a state machine.
FwSmCounterS1_t nOfGuards
the number of guards in the state machine
A choice pseudo-state in a state machine.
FwSmGuard_t * smGuards
the transition guards in the state machine
A state is added twice to the same state machine.
SmPState_t * pStates
array holding the proper states in the state machine
SmBaseDesc_t * smBase
pointer to the base descriptor
Structure representing a choice pseudo state in a state machine.
void FwSmAddState(FwSmDesc_t smDesc, FwSmCounterS1_t stateId, FwSmCounterS1_t nOfOutTrans, FwSmAction_t entryAction, FwSmAction_t exitAction, FwSmAction_t doAction, FwSmDesc_t esmDesc)
Create a state with the given characteristics and add it to a state machine.
A transition is added to a state machine with a source which has an illegal identifier.
Structure representing a proper state in state machine.
void FwSmAddTransIpsToSta(FwSmDesc_t smDesc, FwSmCounterS1_t destId, FwSmAction_t trAction)
Create a transition from the initial pseudo-state to a proper state and add it to a state machine...
The number of guards added to the state machine is smaller than the number of guards declared when th...
void FwSmAddTransCpsToSta(FwSmDesc_t smDesc, FwSmCounterS1_t srcId, FwSmCounterS1_t destId, FwSmAction_t trAction, FwSmGuard_t trGuard)
Create a transition from a choice pseudo-state to a proper state and add it to a state machine...
The overridden action in a derived state machine does not exist.
Return codes of a function which has completed execution without errors.
The state in a derived state machine to which an embedded state machine is added already holds an emb...
signed char FwSmCounterS1_t
Type used for signed counters with a "short" range.
A state or choice pseudo-state is added to a state machine which has more out-going transitions than ...
void FwSmEmbed(FwSmDesc_t smDesc, FwSmCounterS1_t stateId, FwSmDesc_t esmDesc)
Embed a state machine in a state of a derived state machine.
FwSmCounterS1_t iEntryAction
the entry action for the state
Declaration of the internal data structures of the FW State Machine Module.
SmTrans_t * trans
array holding the transitions in the state machine
A state is added to a state machine with an illegal (out-of-range) identifier.
StateType_t
Enumerated type for the type of a state in a state machine.