CORDET Framework - C2 Implementation
CrFwOutCmpSample1.c
Go to the documentation of this file.
1 
19 #include <stdlib.h>
20 /* Include configuration files */
21 #include "CrFwCmpData.h"
22 /* Include framework files */
23 #include "CrFwConstants.h"
24 #include "OutCmp/CrFwOutCmp.h"
25 #include "BaseCmp/CrFwBaseCmp.h"
26 #include "BaseCmp/CrFwInitProc.h"
27 #include "BaseCmp/CrFwResetProc.h"
30 #include "Pckt/CrFwPckt.h"
31 /* Include FW Profile files */
32 #include "FwPrConfig.h"
33 #include "FwPrDCreate.h"
34 #include "FwSmConfig.h"
35 #include "FwSmDCreate.h"
36 #include "FwPrCore.h"
37 
40 
42 static CrFwBool_t readyFlag = 0;
43 
46 
48 static unsigned char counter;
49 
50 /*-----------------------------------------------------------------------------------------*/
52  (void)(smDesc);
53  return enableFlag;
54 }
55 
56 /*-----------------------------------------------------------------------------------------*/
58  (void)(smDesc);
59  return readyFlag;
60 }
61 
62 /*-----------------------------------------------------------------------------------------*/
64  (void)(smDesc);
65  return repeatFlag;
66 }
67 
68 void CrFwOutCmpSample1UpdateAction(FwSmDesc_t smDesc) {
69  (void)(smDesc);
70  counter++;
71 }
72 
73 /*-----------------------------------------------------------------------------------------*/
74 void CrFwOutCmpSample1Serialize(FwSmDesc_t smDesc) {
75  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
76  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)cmpData->cmpSpecificData;
77  CrFwOutCmpDefSerialize(smDesc);
78  cmpSpecificData->pckt[CrFwPcktGetMaxLength()-3] = (char)counter;
79 }
80 
81 /*-----------------------------------------------------------------------------------------*/
83  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
84  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)cmpData->cmpSpecificData;
85  return (cmpSpecificData->pckt);
86 }
87 
88 /*-----------------------------------------------------------------------------------------*/
90  enableFlag = flag;
91 }
92 
93 /*-----------------------------------------------------------------------------------------*/
95  readyFlag = flag;
96 }
97 
98 /*-----------------------------------------------------------------------------------------*/
100  repeatFlag = flag;
101 }
102 
103 /*-----------------------------------------------------------------------------------------*/
104 void CrFwOutCmpSample1SetCounter(unsigned char cnt) {
105  counter = cnt;
106 }
107 
Type for the Framework Component Data (FCD).
Definition: CrFwCmpData.h:79
Definition of the Framework Component Data (FCD) Type.
static CrFwBool_t enableFlag
The Enable Flag.
unsigned char * CrFwPckt_t
Type for packets (see CrFwPckt.h).
Definition: CrFwConstants.h:38
void CrFwOutCmpSample1SetReadyFlag(CrFwBool_t flag)
Set the value of Ready Flag (see CrFwOutCmpSample1ReadyCheck).
void CrFwOutCmpSample1SetEnableFlag(CrFwBool_t flag)
Set the value of Enable Flag (see CrFwOutCmpSample1EnableCheck).
void CrFwOutCmpSample1Serialize(FwSmDesc_t smDesc)
Implementation of the Serialize Operation for the Sample 1 OutComponent.
Definition of the OutFactory component.
Type for the data describing an OutComponent.
CrFwPckt_t pckt
Packet to which the out-going command or report is serialized.
Interface for creating and accessing a report or command packet.
CrFwBool_t CrFwOutCmpSample1RepeatCheck(FwSmDesc_t smDesc)
Implementation of the Repeat Check Operation for the Sample 1 OutComponent.
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.
Header file to define all invariant publicly available constants and types for the CORDET Framework...
static CrFwBool_t readyFlag
The Ready Flag.
void CrFwOutCmpSample1SetRepeatFlag(CrFwBool_t flag)
Set the value of Repeat Flag (see CrFwOutCmpSample1RepeatCheck).
static CrFwBool_t repeatFlag
The Repeat Flag.
CrFwBool_t CrFwOutCmpSample1ReadyCheck(FwSmDesc_t smDesc)
Implementation of the Ready Check Operation for the Sample 1 OutComponent.
void * cmpSpecificData
Derived data which are specific to each type of framework component.
Definition: CrFwCmpData.h:101
CrFwPcktLength_t CrFwPcktGetMaxLength()
Return the maximum length of a packet in number of bytes.
Definition: CrFwPckt.c:201
void CrFwOutCmpDefSerialize(FwSmDesc_t smDesc)
Default implementation of the Serialize Operation for an OutComponent.
Definition: CrFwOutCmp.c:173
Definition of Base Component.
Component Initialization Procedure (CIP) for the Base Component.
Definition of the OutComponent Component of the framework.
CrFwPckt_t CrFwOutCmpSample1GetPckt(FwSmDesc_t smDesc)
Return the packet associated to the Sample 1 OutComponent.
void CrFwOutCmpSample1UpdateAction(FwSmDesc_t smDesc)
Implementation of the Update Operation for the Sample 1 OutComponent.
static unsigned char counter
The Sample 1 Counter.
CrFwBool_t CrFwOutCmpSample1EnableCheck(FwSmDesc_t smDesc)
Implementation of the Enable Check Operation for the Sample 1 OutComponent.
void CrFwOutCmpSample1SetCounter(unsigned char cnt)
Set the value of Sample 1 Counter (see CrFwOutCmpSample1Serialize).
Component Reset Procedure (CRP) for the Base Component.
P&P Software GmbH, Copyright 2012-2013, All Rights Reserved