65 #include "FwSmConstants.h" 66 #include "FwSmConfig.h" 68 #include "FwPrConfig.h" 70 #include "FwPrConstants.h" 87 #include "CrFwOutRegistryUserPar.h" 88 #include "CrFwOutFactoryUserPar.h" 89 #include "CrFwInFactoryUserPar.h" 90 #include "CrFwCmpData.h" 120 FwSmDesc_t inStreamSlave1, inStreamSlave2;
121 FwSmDesc_t outStreamSlave1, outStreamSlave2;
127 printf(
"MA: The Slave 1 Application (Server Socket) must be started before the Master Application\n");
133 printf(
"Consistency check of OutRegistry parameters failed\n");
135 printf(
"Consistency check of OutFactory parameters failed\n");
137 printf(
"Consistency check of InCommand parameters in InFactory failed\n");
139 printf(
"Consistency check of InRepot parameters in InFactory failed\n");
142 printf(
"MA: Consistency check of configuration parameters ran successfully.\n");
202 for (i=1; i<100; i++) {
203 printf(
"MA: Starting cycle %d\n",i);
210 printf(
"MA: Sending command to set the temperature limit in Slave 1 to %d degC\n",
TEMP_LIMIT);
218 printf(
"MA: Sending command to set the temperature limit in Slave 2 to %d degC\n",
TEMP_LIMIT);
225 printf(
"MA: Sending command to enable temperature monitoring in Slave 1\n");
232 printf(
"MA: Sending command to enable temperature monitoring in Slave 2\n");
239 printf(
"MA: Sending command to disable temperature monitoring in Slave 1\n");
246 printf(
"MA: Sending command to disable temperature monitoring in Slave 2\n");
263 printf(
"MA: Application Error Code is set and is equal to: %d\n",
CrFwGetAppErrCode());
#define CR_MA_N_OF_FW_CMP
The number of framework components.
void CrDaClientSocketSetHost(char *name)
Set the host name of the server.
#define TEMP_LIMIT
The temperature limit.
Interface for the client socket used in the CORDET Demo.
Interface through which framework components access the current time.
void CrFwCmpInit(FwSmDesc_t smDesc)
Initialize a framework component.
#define CR_DA_SERV_SUBTYPE_SET
The identifier of the service sub-type to set the temperature limit.
int main()
Main program for the Master Application.
CrFwBool_t CrFwCmpIsInConfigured(FwSmDesc_t smDesc)
Return true if the argument component is in state CONFIGURED.
Header file to define constants and types for the CORDET Demo.
InFactory configuration parameters for InCommands are inconsistent (see CrFwAuxInFactoryInCmdConfigCh...
#define CR_DA_SOCKET_PORT
The port number for the socket port.
Auxiliary module to check the static part of an application's configuration.
Definition of the OutStream component.
Definition of the OutFactory component.
#define CR_DA_SERV_TYPE
The identifier of the service type supported by the demo application.
FwSmDesc_t CrFwOutManagerMake(CrFwInstanceId_t i)
Factory function to retrieve the i-th OutManager State Machine instance.
Interface for creating and accessing a report or command packet.
Definition of the InStream component.
#define CR_DA_SERV_SUBTYPE_DIS
The identifier of the service sub-type to disable temperature monitoring.
#define CR_DA_SLAVE_2
The identifier of the first Slave Application of the CORDET Demo.
Definition of the OutRegistry Component.
Definition of the InRegistry Component.
CrFwBool_t CrFwCmpIsInInitialized(FwSmDesc_t smDesc)
Return true if the argument component is in state INITIALIZED.
CrFwConfigCheckOutcome_t CrFwAuxConfigCheck()
Check the configuration of an application.
Interface for reporting an error detected by a framework component.
FwSmDesc_t CrFwInRegistryMake()
Factory function for the singleton instance of the InRegistry.
CrFwConfigCheckOutcome_t
Type for the outcome of the consistency check on the configuration parameters.
#define CR_DA_SERV_SUBTYPE_EN
The identifier of the service sub-type to enable temperature monitoring.
OutFactory configuration parameters are inconsistent (see CrFwAuxOutFactoryConfigCheck.h)
All configuration consistency checks have been passed.
FwSmDesc_t CrFwInLoaderMake()
Factory function to retrieve the state machine implementing the InLoader singleton component...
FwSmDesc_t CrFwOutLoaderMake()
Factory function to retrieve the OutLoader State Machine instance.
FwSmDesc_t CrFwInManagerMake(CrFwInstanceId_t i)
Factory function to retrieve the i-th InManager State Machine instance.
Definition of the InFactory component.
InFactory configuration parameters for InReports are inconsistent (see CrFwAuxInFactoryInRepConfigChe...
Definition of the utility functions for the CORDET Framework.
FwSmDesc_t CrFwOutRegistryMake()
Factory function for the singleton instance of the OutRegistry.
void CrFwCmpReset(FwSmDesc_t smDesc)
Reset a framework component.
#define CR_DA_SLAVE_1
The identifier of the first Slave Application of the CORDET Demo.
void CrMaOutCmpSetTempLimitSetTempLimit(char tempLimit)
Set the value of the temperature limit (an integer in the range 0 to 127).
Interface for the server socket used in the CORDET Demo.
Definition of Base Component.
FwSmDesc_t CrFwInFactoryMake()
Factory function for the singleton instance of the InFactory.
void CrFwInLoaderSetInStream(FwSmDesc_t inStream)
Set the InStream from which the packets will be retrieved the next time the InLoader is executed...
Definition of the OutComponent Component of the framework.
FwSmDesc_t CrFwOutFactoryMake()
Factory function for the singleton instance of the OutFactory.
FwSmDesc_t CrFwOutStreamMake(CrFwInstanceId_t i)
Factory function to retrieve the i-th OutStream State Machine instance.
void CrFwOutCmpSetDest(FwSmDesc_t smDesc, CrFwDestSrc_t dest)
Set the destination of the OutComponent.
FwSmDesc_t CrFwInStreamMake(CrFwInstanceId_t i)
Factory function to retrieve the i-th InStream State Machine instance.
CrFwBool_t CrFwOutLoaderLoad(FwSmDesc_t outCmp)
Load an OutComponent into its OutManager.
No application errors have been detected.
void CrDaClientSocketPoll()
Poll the client socket to check whether a new packet has arrived.
void CrDaClientSocketSetPort(int n)
Set the port number for the socket.
Definition of the OutLoader component.
FwSmDesc_t CrFwOutFactoryMakeOutCmp(CrFwServType_t type, CrFwServSubType_t subType, CrFwDiscriminant_t discriminant, CrFwPcktLength_t length)
Make function for an OutComponent.
Header file to define constants and types for the Master Application of the CORDET Demo...
CrFwAppErrCode_t CrFwGetAppErrCode()
Return the value of the application error code.
OutRegistry configuration parameters are inconsistent (see CrFwAuxOutRegistryConfigCheck.h)