22 static float tempMeasurement = 0;
30 static float curMeasurement = 0;
39 fprintf(stdout,
"\nHW Device switched on");
49 fprintf(stdout,
"\nHW Device switched off");
59 fprintf(stdout,
"\nHW Device in STANDBY");
69 fprintf(stdout,
"\nHW Device operational");
86 static void CollectMeasurements(
FwSmDesc_t smDesc) {
125 return tempMeasurement;
130 return curMeasurement;
#define HW_DEV_OPER
Name of the OPERATIONAL state in the HW Device State Machine.
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.
Declaration of the dynamical creation interface for a FW State Machine.
float GetHwDevTemp()
This function returns the temperature of the Hardware Device.
#define HW_DEV_ON
Name of the ON state in the HW Device State Machine.
Declaration of the configuration interface for a FW State Machine.
FwSmDesc_t FwSmCreate(FwSmCounterS1_t nOfStates, FwSmCounterS1_t nOfChoicePseudoStates, FwSmCounterS1_t nOfTrans, FwSmCounterS1_t nOfActions, FwSmCounterS1_t nOfGuards)
Create a new state machine descriptor.
#define HW_DEV_CUR_MAX
The maximum value of the current absorbed by the Hardware Device.
Definition of the interface to access the Hardware Device.
#define HW_DEV_SBY
Name of the STANDBY state in the HW Device State Machine.
#define TR_HW_DEV_SBY
Name of the transition from OPERATIONAL to STANDBY in the HW Device State Machine.
#define HW_DEV_OFF
Name of the OFF state in the HW Device State Machine.
#define TR_HW_DEV_OPER
Name of the transition from STANDBY to OPERATIONAL in the HW Device State Machine.
#define TR_HW_DEV_OFF
Name of the transition from ON to OFF in the HW Device State Machine.
float GetHwDevCur()
This function returns the current absorbed by the Hardware Device.
Structure representing a state machine descriptor.
#define TR_HW_DEV_ON
Name of the transition from OFF to ON in the HW Device State Machine.
void FwSmSetData(FwSmDesc_t smDesc, void *smData)
Set the pointer to the state machine data in the state machine descriptor.
#define HW_DEV_TEMP_MAX
The maximum value of the temperature of the Hardware Device.
FwSmDesc_t GetHwDevSm()
Retrieve the descriptor of the Hardware Device 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.
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...
Declaration of the auxiliary interface for a FW State Machine.