OS  v7.3.3
Documentation
Finite State Machines

API interface of the Finite State Machines (FSM) extension. More...

Collaboration diagram for Finite State Machines:

Data Structures

struct  qSM_Signal_t
 The type to be used as a container variable for a signal. More...
 
struct  qSM_Handler_t
 The callback argument to handle the state-machine dynamics and provide execution information. Some members can be written to perform state-transitions. More...
 
struct  qSM_TimeoutStateDefinition_t
 This structure should be used to define an item for a timeout-specification table. More...
 
struct  qSM_State_t
 A state object. More...
 
struct  qSM_TimeoutSpec_t
 A FSM Timeout-specification object. More...
 
struct  qSM_t
 A FSM(Finite State Machine) object. More...
 
struct  qSM_Transition_t
 This structure should be used to define an item for a state transition table. More...
 

Macros

#define QSM_STATE_TOP
 This macro can be used to reference the top state when using the qStateMachine_StateSubscribe() API.
 
#define QSM_SIGNAL_START
 Built-in signal that can be used to set a nested initial-transition (aka default transition) by writing the qSM_Handler_t::StartState member. More...
 
#define QSM_SIGNAL_EXIT
 Built-in signal to indicate if the current state has just exit to another state. More...
 
#define QSM_SIGNAL_ENTRY
 Built-in signal to indicate if the current state has just entered from another state. More...
 
#define QSM_SIGNAL_NONE
 Built-in signal to indicate that there is not signal available.
 
#define QSM_SIGNAL_TIMEOUT(index)
 Built-in signal to indicate that a timeout expiration event occurs. More...
 
#define QSM_TSOPT_INDEX(index)
 Timeout-specification option. Should be used to specify the timeout index. More...
 
#define QSM_TSOPT_SET_ENTRY
 This timeout-specification option its used to specify that the engine should set the timeout when the specified state its entering. More...
 
#define QSM_TSOPT_RST_ENTRY
 This timeout-specification option its used to specify that the engine should reset the timeout when the specified state its entering. More...
 
#define QSM_TSOPT_SET_EXIT
 This timeout-specification option its used to specify that the engine should set the timeout when the specified state its exiting*. More...
 
#define QSM_TSOPT_RST_EXIT
 This timeout-specification option its used to specify that the engine should reset the timeout when the specified state its exiting*. More...
 
#define QSM_TSOPT_KEEP_IF_SET
 This timeout-specification option its used to specify that the engine should set the timeout only if it is in reset state. More...
 
#define QSM_TSOPT_PERIODIC
 This timeout-specification option its used setup the timeout in periodic mode. More...
 
#define QSM_SIGNAL_RANGE_MIN
 Minimum value that can be used for an user-defined signal.
 
#define QSM_SIGNAL_RANGE_MAX
 Maximum value that can be used for an user-defined signal.
 
#define QSM_SIGNAL_TM_MAX
 
#define QSM_SIGNAL_TM_MIN
 
#define QSM_SIGNAL_USER
 The start value for an user-defined signal.
 

Typedefs

typedef qUINT32_t qSM_SigId_t
 The type for signal ID.
 
typedef qSM_Status_t(* qSM_StateCallback_t) (qSM_Handler_t h)
 Pointer to a function that represents a state callback. More...
 
typedef void(* qSM_SurroundingCallback_t) (qSM_Handler_t h)
 Pointer to a function that represents a surrounding callback. More...
 
typedef qBool_t(* qSM_SignalAction_t) (qSM_Handler_t h)
 Pointer to a function that represents a signal guard/action. More...
 
typedef qUINT32_t qSM_TimeoutSpecOptions_t
 A typedef to hold the timeout specification options.
 

Enumerations

enum  qSM_Status_t {
  qSM_STATUS_BEFORE_ANY , qSM_STATUS_NULL , qSM_STATUS_EXIT_FAILURE , qSM_STATUS_EXIT_SUCCESS ,
  qSM_STATUS_SIGNAL_HANDLED
}
 This enumeration defines the built-in state-execution status values that can be used as return value in a state callback. More...
 
enum  qSM_TransitionHistoryMode_t { qSM_TRANSITION_NO_HISTORY , qSM_TRANSITION_SHALLOW_HISTORY , qSM_TRANSITION_DEEP_HISTORY }
 This enumeration defines the possible modes to perform a transition to history. More...
 
enum  qSM_Attribute_t {
  qSM_ATTRIB_STATE_TOP , qSM_ATTRIB_STATE_CURRENT , qSM_ATTRIB_SIGNAL_QUEUE , qSM_ATTRIB_TIMESPEC ,
  qSM_ATTRIB_TRANSITION_TABLE , qSM_ATTRIB_DATA , qSM_ATTRIB_COMPOSITE_INITSTATE , qSM_ATTRIB_COMPOSITE_LASTSTATE ,
  qSM_ATTRIB_COMPOSITE_PARENT
}
 This enumeration defines the attributes that can be acquired for a FSM or a state. More...
 

Functions

qBool_t qStateMachine_Run (qSM_t *const m, qSM_Signal_t sig)
 Execute the Finite State Machine (FSM). More...
 
qBool_t qStateMachine_Setup (qSM_t *const m, qSM_StateCallback_t topFcn, qSM_State_t *const init, qSM_SurroundingCallback_t sFcn, void *pData)
 Initializes a Finite State Machine (FSM). More...
 
qBool_t qStateMachine_StateSubscribe (qSM_t *const m, qSM_State_t *const s, qSM_State_t *const parent, qSM_StateCallback_t sFcn, qSM_State_t *const init, void *pData)
 This function subscribes the FSM instance to a specific state with an associated callback function. More...
 
qBool_t qStateMachine_Set_StateTransitions (qSM_State_t *const s, qSM_Transition_t *const table, const size_t n)
 Installs a table with the outgoing transitions for the supplied state. More...
 
qBool_t qStateMachine_InstallSignalQueue (qSM_t *const m, qQueue_t *q)
 Install a signal queue to the provided Finite State Machine (FSM). More...
 
qBool_t qStateMachine_SendSignal (qSM_t *const m, qSM_SigId_t sig, void *sData, const qBool_t isUrgent)
 Sends a signal to a specific state machine or to all its subscribers (if available). More...
 
qBool_t qStateMachine_InstallTimeoutSpec (qSM_t *const m, qSM_TimeoutSpec_t *const ts)
 Install the Timeout-specification object to target FSM to allow timed signals within states ( See the QSM_SIGNAL_TIMEOUT signal ). More...
 
qBool_t qStateMachine_Set_StateTimeouts (qSM_State_t *const s, qSM_TimeoutStateDefinition_t *tdef, const size_t n)
 Setup fixed timeouts for the specified state using a lookup-table. More...
 
qBool_t qStateMachine_TimeoutSet (qSM_t *const m, const qIndex_t xTimeout, const qTime_t t)
 Set the time for the selected built-in timeout inside the target FSM. More...
 
qBool_t qStateMachine_TimeoutStop (qSM_t *const m, const qIndex_t xTimeout)
 Stop the time count for the selected built-in timeout. More...
 
void * qStateMachine_Get_Machine (qSM_t *const m, const qSM_Attribute_t a)
 Get attributes from the provided Finite State Machine object. More...
 
void * qStateMachine_Get_State (qSM_State_t *const s, const qSM_Attribute_t a)
 Get attributes from the provided state object. More...
 
qBool_t qStateMachine_Set_StateCallback (qSM_State_t *const state, qSM_StateCallback_t sFcn)
 Set/Change the state callback in run-time. More...
 
qBool_t qStateMachine_Set_MachineSurrounding (qSM_t *const m, qSM_SurroundingCallback_t sFcn)
 Set/Change the FSM surrounding callback in run-time. More...
 
qBool_t qStateMachine_SubscribeToSignal (qSM_t *const m, qSM_SigId_t s)
 Subscribe state machine to a particular signal. More...
 
qBool_t qStateMachine_UnsubscribeFromSignal (qSM_t *const m, qSM_SigId_t s)
 Unsubscribe state machine from a particular signal. More...
 

Detailed Description

API interface of the Finite State Machines (FSM) extension.

Macro Definition Documentation

◆ QSM_SIGNAL_ENTRY

#define QSM_SIGNAL_ENTRY

Built-in signal to indicate if the current state has just entered from another state.

Note
Transitions are not allowed here

◆ QSM_SIGNAL_EXIT

#define QSM_SIGNAL_EXIT

Built-in signal to indicate if the current state has just exit to another state.

Note
Transitions are not allowed here

◆ QSM_SIGNAL_START

#define QSM_SIGNAL_START

Built-in signal that can be used to set a nested initial-transition (aka default transition) by writing the qSM_Handler_t::StartState member.

Note
Transitions by setting the qSM_Handler_t::NextState member are not allowed here

◆ QSM_SIGNAL_TIMEOUT

#define QSM_SIGNAL_TIMEOUT (   index)

Built-in signal to indicate that a timeout expiration event occurs.

Parameters
indexThe index of the timeout (0, 1, 2... ( Q_FSM_MAX_TIMEOUTS-1 ) )

◆ QSM_TSOPT_INDEX

#define QSM_TSOPT_INDEX (   index)

Timeout-specification option. Should be used to specify the timeout index.

Note
Can be combined with a bitwise OR

◆ QSM_TSOPT_KEEP_IF_SET

#define QSM_TSOPT_KEEP_IF_SET

This timeout-specification option its used to specify that the engine should set the timeout only if it is in reset state.

Note
Can be combined with a bitwise OR

◆ QSM_TSOPT_PERIODIC

#define QSM_TSOPT_PERIODIC

This timeout-specification option its used setup the timeout in periodic mode.

Note
Can be combined with a bitwise OR

◆ QSM_TSOPT_RST_ENTRY

#define QSM_TSOPT_RST_ENTRY

This timeout-specification option its used to specify that the engine should reset the timeout when the specified state its entering.

Note
Can be combined with a bitwise OR

◆ QSM_TSOPT_RST_EXIT

#define QSM_TSOPT_RST_EXIT

This timeout-specification option its used to specify that the engine should reset the timeout when the specified state its exiting*.

Note
Can be combined with a bitwise OR

◆ QSM_TSOPT_SET_ENTRY

#define QSM_TSOPT_SET_ENTRY

This timeout-specification option its used to specify that the engine should set the timeout when the specified state its entering.

Note
Can be combined with a bitwise OR

◆ QSM_TSOPT_SET_EXIT

#define QSM_TSOPT_SET_EXIT

This timeout-specification option its used to specify that the engine should set the timeout when the specified state its exiting*.

Note
Can be combined with a bitwise OR

Typedef Documentation

◆ qSM_SignalAction_t

typedef qBool_t(* qSM_SignalAction_t) (qSM_Handler_t h)

Pointer to a function that represents a signal guard/action.

qBool_t signalAction_Callback( qSM_Handler_t h ) {
qBool_t retVal = qFalse
if ( ConditionGuard ) {
performSomeAction();
retVal = qTrue;
}
return retVal;
}
qUINT8_t qBool_t
A type to instantiate an OS boolean variable.
Definition: qtypes.h:139
#define qTrue
A boolean value that represents true/success/On or High.
Definition: qtypes.h:162
#define qFalse
A boolean value that represents false/failure/Off or Low.
Definition: qtypes.h:157
The callback argument to handle the state-machine dynamics and provide execution information....
Definition: qfsm.h:232
Parameters
hThe object that handles the state machine
Returns
A boolean value that allow or rejects the state transition. If the value is qFalse the event-signal is rejected, preventing the state transition to be performed.

◆ qSM_StateCallback_t

typedef qSM_Status_t(* qSM_StateCallback_t) (qSM_Handler_t h)

Pointer to a function that represents a state callback.

qSM_Status_t myState_Callback( qSM_Handler_t h ) {
switch ( h->Signal ) {
break;
break;
case USER_SIGNAL:
break;
default:
break;
return retVal;
}
#define QSM_SIGNAL_ENTRY
Built-in signal to indicate if the current state has just entered from another state.
Definition: qfsm.h:82
#define QSM_SIGNAL_EXIT
Built-in signal to indicate if the current state has just exit to another state.
Definition: qfsm.h:76
qSM_Status_t
This enumeration defines the built-in state-execution status values that can be used as return value ...
Definition: qfsm.h:175
@ qSM_STATUS_EXIT_SUCCESS
Definition: qfsm.h:179
@ qSM_STATUS_SIGNAL_HANDLED
Definition: qfsm.h:180
const qSM_SigId_t Signal
Definition: qfsm.h:240
Parameters
hThe object that handles the state machine
Returns
The execution status of the state.

◆ qSM_SurroundingCallback_t

typedef void(* qSM_SurroundingCallback_t) (qSM_Handler_t h)

Pointer to a function that represents a surrounding callback.

void surrounding_Callback( qSM_Handler_t h ) {
switch ( h->Status ) {
break;
break;
break;
default:
break;
}
@ qSM_STATUS_BEFORE_ANY
Definition: qfsm.h:176
@ qSM_STATUS_EXIT_FAILURE
Definition: qfsm.h:178
const qSM_Status_t Status
Definition: qfsm.h:241
Parameters
hThe object that handles the state machine
Returns
none.

Enumeration Type Documentation

◆ qSM_Attribute_t

This enumeration defines the attributes that can be acquired for a FSM or a state.

Enumerator
qSM_ATTRIB_STATE_TOP 

Only for qStateMachine_Get_Machine() : Get a pointer to the top state

qSM_ATTRIB_STATE_CURRENT 

Only for qStateMachine_Get_Machine() : Get a pointer to the current running state

qSM_ATTRIB_SIGNAL_QUEUE 

Only for qStateMachine_Get_Machine() : Get a pointer to the signal-queue object if installed

qSM_ATTRIB_TIMESPEC 

Only for qStateMachine_Get_Machine() : Get a pointer to the timeout specification object if installed

qSM_ATTRIB_TRANSITION_TABLE 

Only for qStateMachine_Get_State() : Get a pointer to the transition table if available

qSM_ATTRIB_DATA 

Get the user data ( storage-pointer )

qSM_ATTRIB_COMPOSITE_INITSTATE 

Only for qStateMachine_Get_State() : Get the initial default or initial state, if input is composite

qSM_ATTRIB_COMPOSITE_LASTSTATE 

Only for qStateMachine_Get_State() : Get the last state, if input is composite

qSM_ATTRIB_COMPOSITE_PARENT 

Only for qStateMachine_Get_State() : Get the parent state, if input is a child

◆ qSM_Status_t

This enumeration defines the built-in state-execution status values that can be used as return value in a state callback.

Enumerator
qSM_STATUS_BEFORE_ANY 

(Only available in the surrounding callback) Indicates an execution of the surrounding callback before launching the state callback.

qSM_STATUS_NULL 

Not to be used at the application level. This value is reserved for use.

qSM_STATUS_EXIT_FAILURE 

To indicate that the state had a failure or abnormal execution. It can be used to handle exceptions.

qSM_STATUS_EXIT_SUCCESS 

To indicate that the status was successful.

qSM_STATUS_SIGNAL_HANDLED 

To indicate that the state handled the signal and therefore it is not necessary to continue propagating the signal through the rest of the hierarchy

◆ qSM_TransitionHistoryMode_t

This enumeration defines the possible modes to perform a transition to history.

Enumerator
qSM_TRANSITION_NO_HISTORY 

History is not preserved. Composite states will start according to their default transition.

qSM_TRANSITION_SHALLOW_HISTORY 

History will be kept to allow the return to only the top-most sub-state of the most recent state configuration, which is entered using the default entry rule.

qSM_TRANSITION_DEEP_HISTORY 

History will be kept to allow full state configuration of the most recent visit to the containing region.

Function Documentation

◆ qStateMachine_Get_Machine()

void * qStateMachine_Get_Machine ( qSM_t *const  m,
const qSM_Attribute_t  a 
)

Get attributes from the provided Finite State Machine object.

Parameters
[in]mA pointer to the FSM object.
[in]aThe requested attribute
Returns
Returns a pointer to the requested attribute. Otherwise returns NULL.

◆ qStateMachine_Get_State()

void * qStateMachine_Get_State ( qSM_State_t *const  s,
const qSM_Attribute_t  a 
)

Get attributes from the provided state object.

Parameters
[in]sA pointer to the state object.
[in]aThe requested attribute
Returns
Returns a pointer to the requested attribute. Otherwise returns NULL.

◆ qStateMachine_InstallSignalQueue()

qBool_t qStateMachine_InstallSignalQueue ( qSM_t *const  m,
qQueue_t q 
)

Install a signal queue to the provided Finite State Machine (FSM).

Precondition
Queue object should be previously initialized by using qQueue_Setup()
Attention
Queue item size = sizeof( qSM_Signal_t )
Parameters
[in]mA pointer to the FSM object.
[in]qA pointer to the queue object.
Returns
qTrue on success, otherwise return qFalse.

◆ qStateMachine_InstallTimeoutSpec()

qBool_t qStateMachine_InstallTimeoutSpec ( qSM_t *const  m,
qSM_TimeoutSpec_t *const  ts 
)

Install the Timeout-specification object to target FSM to allow timed signals within states ( See the QSM_SIGNAL_TIMEOUT signal ).

Attention
This feature its only available if the FSM has a signal-queue installed.
Precondition
This feature depends on the STimers extension. Make sure the time base is functional.
Note
You can increase the number of available timeouts instances by changing the Q_FSM_MAX_TIMEOUTS configuration macro inside qconfig.h
See also
qStateMachine_InstallSignalQueue()
Parameters
[in]mA pointer to the FSM object.
[in]tsA pointer to the timeout specification object.
Returns
Returns qTrue on success, otherwise returns qFalse.

◆ qStateMachine_Run()

qBool_t qStateMachine_Run ( qSM_t *const  m,
qSM_Signal_t  sig 
)

Execute the Finite State Machine (FSM).

See also
qOS_Add_StateMachineTask()
Parameters
[in]mA pointer to the FSM object.
[in]sigUser-defined signal (this value will be ignored if the installed queue has items available)
Note
A signal coming from the signal-queue has the higher precedence. The user-defined signal can be overridden
Returns
qTrue if the signal was successfully handled, otherwise returns qFalse.

◆ qStateMachine_SendSignal()

qBool_t qStateMachine_SendSignal ( qSM_t *const  m,
qSM_SigId_t  sig,
void *  sData,
const qBool_t  isUrgent 
)

Sends a signal to a specific state machine or to all its subscribers (if available).

Note
If the signal queue is not available, an exclusion variable will be used.This means that the signal cannot be sent until the variable is empty. (the signal was handled by the state-machine engine).
Remarks
To enable the functionality of sending signals to subscribers, you must set the macros #Q_FSM_PS_SIGNALS_MAX and #Q_FSM_PS_SUB_PER_SIGNAL_MAX in the configuration file qconfig.h
Warning
Data associated to the signal is not deep-copied to a queue or any buffer. It's only data pointer (address in memory) that is shallow-copied to a signal queue so it has to point to a globally accessible memory. If it pointed to a sender's local variable (from the stack) it would be invalid after sender returns from the function that sends the signal.
Note
The signal-queue has the highest precedence.
Parameters
[in]mA pointer to the FSM object to send the signal to a specific recipient. Pass NULL to send the signal to all subscribed state-machines.
[in]sigThe user-defined signal.
[in]sDataThe data associated to the signal.
[in]isUrgentIf qTrue, the signal will be sent to the front of the queue. (only if the there is a signal-queue available)
Returns
qTrue if the provided signal was successfully delivered to the FSM or subscribers (if available), otherwise return qFalse. qFalse if there is a queue, and the signal cannot be inserted because it is full.

◆ qStateMachine_Set_MachineSurrounding()

qBool_t qStateMachine_Set_MachineSurrounding ( qSM_t *const  m,
qSM_SurroundingCallback_t  sFcn 
)

Set/Change the FSM surrounding callback in run-time.

Parameters
[in]mA pointer to the state object.
[in]sFcnThe new surrounding callback
Returns
Returns qTrue on success, otherwise returns qFalse.

◆ qStateMachine_Set_StateCallback()

qBool_t qStateMachine_Set_StateCallback ( qSM_State_t *const  state,
qSM_StateCallback_t  sFcn 
)

Set/Change the state callback in run-time.

Parameters
[in]stateA pointer to the state object.
[in]sFcnThe new state callback
Returns
Returns qTrue on success, otherwise returns qFalse.

◆ qStateMachine_Set_StateTimeouts()

qBool_t qStateMachine_Set_StateTimeouts ( qSM_State_t *const  s,
qSM_TimeoutStateDefinition_t tdef,
const size_t  n 
)

Setup fixed timeouts for the specified state using a lookup-table.

Attention
This feature its only available if the FSM has a signal-queue installed.
Precondition
The container state-machine must have a timeout-specification installed.
Note
The lookup table should be an array of type qSM_TimeoutStateDefinition_t with n elements matching { time, options }.
See also
qStateMachine_InstallSignalQueue(), qStateMachine_InstallTimeoutSpec()
Parameters
[in]sA pointer to the state object.
[in]tdefThe lookup table matching the requested timeout values with their respective options.
{ [Timeout value], [Options(Combined with a bitwise OR)] } 
[in]nThe number of elements inside tdef.
Returns
Returns qTrue on success, otherwise returns qFalse.

◆ qStateMachine_Set_StateTransitions()

qBool_t qStateMachine_Set_StateTransitions ( qSM_State_t *const  s,
qSM_Transition_t *const  table,
const size_t  n 
)

Installs a table with the outgoing transitions for the supplied state.

Parameters
[in]sA pointer to the state object.
[in]tableAn array of entries of type qSM_Transition_t with the outgoing transitions. Each entry relates signals, actions and the target state using the following layout:
{ [Signal], [Action/Guard], [Target state], [History Mode] } 
[in]nThe number of elements inside table.
Returns
qTrue on success, otherwise return qFalse.

◆ qStateMachine_Setup()

qBool_t qStateMachine_Setup ( qSM_t *const  m,
qSM_StateCallback_t  topFcn,
qSM_State_t *const  init,
qSM_SurroundingCallback_t  sFcn,
void *  pData 
)

Initializes a Finite State Machine (FSM).

See also
qOS_Add_StateMachineTask()
Note
This API also initializes the top state.
Parameters
[in]mA pointer to the FSM object.
[in]topFcnThe callback for the "Top" state.
[in]initThe first state to be executed (init-state or default transition).
[in]sFcnThe surrounding callback. To ignore pass NULL.
[in]pDataRepresents the FSM arguments. User storage pointer. To ignore pass NULL.
Returns
Returns qTrue on Success, otherwise returns qFalse.

◆ qStateMachine_StateSubscribe()

qBool_t qStateMachine_StateSubscribe ( qSM_t *const  m,
qSM_State_t *const  s,
qSM_State_t *const  parent,
qSM_StateCallback_t  sFcn,
qSM_State_t *const  init,
void *  pData 
)

This function subscribes the FSM instance to a specific state with an associated callback function.

Parameters
[in]mA pointer to the FSM object.
[in]sA pointer to the state object.
[in]parentA pointer to the parent state (Use QSM_STATE_TOP) if the parent is the top state.
[in]sFcnThe handler function associated to the state.

Prototype:

qSM_Status_t xCallback( qSM_Handler_t h )
Parameters
[in]initThe first child-state to be executed if the subscribed state its a parent in an hierarchical pattern. (default transition). To ignore pass NULL as argument.
[in]pDataState data. Storage pointer. To ignore pass NULL.
Returns
qTrue on success, otherwise return qFalse.

◆ qStateMachine_SubscribeToSignal()

qBool_t qStateMachine_SubscribeToSignal ( qSM_t *const  m,
qSM_SigId_t  s 
)

Subscribe state machine to a particular signal.

Precondition
Subscriber FSM should be previously initalized with qStateMachine_Setup()
Parameters
[in]mA pointer to the subscriber FSM.
[in]sSignal ID to which the subscriber FSM wants to subscribe.
Returns
Returns qTrue on success, otherwise returns qFalse.

◆ qStateMachine_TimeoutSet()

qBool_t qStateMachine_TimeoutSet ( qSM_t *const  m,
const qIndex_t  xTimeout,
const qTime_t  t 
)

Set the time for the selected built-in timeout inside the target FSM.

Precondition
Requires an installed timeout-specification. For this use qStateMachine_InstallTimeoutSpec()
Requires an installed signal-queue. For this use qStateMachine_InstallSignalQueue()
Parameters
[in]mA pointer to the FSM object.
[in]xTimeoutThe index of the requested timeout (0, 1, 2 ... (Q_FSM_MAX_TIMEOUTS-1) )
[in]tThe specified time usually given in seconds.
Returns
Returns qTrue on success, otherwise returns qFalse.

◆ qStateMachine_TimeoutStop()

qBool_t qStateMachine_TimeoutStop ( qSM_t *const  m,
const qIndex_t  xTimeout 
)

Stop the time count for the selected built-in timeout.

Precondition
Requires an installed timeout-specification. For this use qStateMachine_InstallTimeoutSpec()
Requires an installed signal-queue. For this use qStateMachine_InstallSignalQueue()
Parameters
[in]mA pointer to the FSM object.
[in]xTimeoutThe index of the timeout (0, 1, 2 ... (Q_FSM_MAX_TIMEOUTS-1) )
Returns
Returns qTrue on success, otherwise returns qFalse.

◆ qStateMachine_UnsubscribeFromSignal()

qBool_t qStateMachine_UnsubscribeFromSignal ( qSM_t *const  m,
qSM_SigId_t  s 
)

Unsubscribe state machine from a particular signal.

Precondition
Subscriber FSM should be previously initalized with qStateMachine_Setup()
Parameters
[in]mA pointer to the subscriber FSM.
[in]sSignal ID to which the subscriber FSM wants to unsubscribe.
Returns
Returns qTrue on success, otherwise returns qFalse.