CORDET Framework - C2 Implementation
CrMaInRepTempViolation.c
Go to the documentation of this file.
1 
19 #include <stdio.h>
20 #include <stdlib.h>
21 #include <string.h>
22 #include "CrDaConstants.h"
23 /* Include configuration files */
24 #include "CrFwCmpData.h"
25 /* Include framework files */
26 #include "CrFwConstants.h"
27 #include "InRep/CrFwInRep.h"
28 #include "BaseCmp/CrFwBaseCmp.h"
29 #include "BaseCmp/CrFwInitProc.h"
30 #include "BaseCmp/CrFwResetProc.h"
33 #include "Pckt/CrFwPckt.h"
34 /* Include FW Profile files */
35 #include "FwPrConfig.h"
36 #include "FwPrDCreate.h"
37 #include "FwSmConfig.h"
38 #include "FwSmDCreate.h"
39 #include "FwPrCore.h"
40 
41 /*-----------------------------------------------------------------------------------------*/
43  return 1;
44 }
45 
46 /*-----------------------------------------------------------------------------------------*/
47 void CrMaInRepTempViolationUpdateAction(FwPrDesc_t prDesc) {
48  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwPrGetData(prDesc);
49  CrFwInRepData_t* cmpSpecificData = (CrFwInRepData_t*)(cmpData->cmpSpecificData);
50  CrFwPckt_t pckt = cmpSpecificData->pckt; /* the incoming packet */
51  char* pcktPar = CrFwPcktGetParStart(pckt); /* the parameter area of the incoming packet */
52  if (CrFwPcktGetSrc(pckt) == CR_DA_SLAVE_1) {
53  printf("MA: Seq. Counter %d - Limit Violation in Slave 1, Temperature = %d\n", CrFwPcktGetSeqCnt(pckt),
54  pcktPar[0]);
55  cmpData->outcome = 1;
56  return;
57  }
58  if (CrFwPcktGetSrc(pckt) == CR_DA_SLAVE_2) {
59  printf("MA: Seq. Counter %d - Limit Violation in Slave 2, Temperature = %d\n", CrFwPcktGetSeqCnt(pckt),
60  pcktPar[0]);
61  cmpData->outcome = 1;
62  return;
63  }
64  cmpData->outcome = 0;
65 }
Type for the Framework Component Data (FCD).
CrFwOutcome_t outcome
The outcome of an action or check executed by a state machine or by one of its procedures.
CrFwDestSrc_t CrFwPcktGetSrc(CrFwPckt_t pckt)
Return the source of the command or report encapsulated in a packet.
Header file to define constants and types for the CORDET Demo.
unsigned char * CrFwPckt_t
Type for packets (see CrFwPckt.h).
Definition: CrFwConstants.h:38
Definition of the OutFactory component.
Type for the data describing an InReport.
Interface for creating and accessing a report or command packet.
int CrFwBool_t
Type used for boolean values (1 represent "true" and 0 represents "false").
Definition: CrFwConstants.h:32
Dummy Component Execution Procedure (CEP) for the Base Component.
CrFwPckt_t pckt
Packet holding the InReport.
#define CR_DA_SLAVE_2
The identifier of the first Slave Application of the CORDET Demo.
CrFwBool_t CrMaInRepTempViolationValidityCheck(FwPrDesc_t prDesc)
Implementation of the Validity Check Operation for the Master Application.
Header file to define all invariant publicly available constants and types for the CORDET Framework...
CrFwSeqCnt_t CrFwPcktGetSeqCnt(CrFwPckt_t pckt)
Return the sequence counter of the command or report encapsulated in a packet.
Definition of the InReport Component of the framework.
void * cmpSpecificData
Derived data which are specific to each type of framework component.
char * CrFwPcktGetParStart(CrFwPckt_t pckt)
Return the start address of the packet&#39;s parameter area.
#define CR_DA_SLAVE_1
The identifier of the first Slave Application of the CORDET Demo.
Definition of Base Component.
Component Initialization Procedure (CIP) for the Base Component.
void CrMaInRepTempViolationUpdateAction(FwPrDesc_t prDesc)
Implementation of the Update Action Operation for the Master Application.
Component Reset Procedure (CRP) for the Base Component.
P&P Software GmbH, Copyright 2012-2013, All Rights Reserved