24 #include "FwSmConstants.h"
25 #include "FwSmConfig.h"
27 #include "FwPrConfig.h"
29 #include "FwPrConstants.h"
67 if (FwSmCheckRec(outCmp1) != smSuccess)
337 CrFwBool_t acceptAck, startAck, progressAck, termAck;
405 if (cycTime != curTimeStamp)
475 CrFwBool_t acceptAck, startAck, progressAck, termAck;
610 CrFwBool_t acceptAck, startAck, progressAck, termAck;
CrFwInstanceId_t CrFwCmpGetInstanceId(FwSmDesc_t smDesc)
Return the instance identifier of the argument component.
void CrFwCmpInit(FwSmDesc_t smDesc)
Initialize a framework component.
CrFwBool_t CrFwCmpIsInConfigured(FwSmDesc_t smDesc)
Return true if the argument component is in state CONFIGURED.
void CrFwCmpReset(FwSmDesc_t smDesc)
Reset a framework component.
void CrFwCmpExecute(FwSmDesc_t smDesc)
Execute a framework component.
CrFwTypeId_t CrFwCmpGetTypeId(FwSmDesc_t smDesc)
Return the type identifier of the argument component.
Definition of Base Component.
Definition of the Framework Component Data (FCD) Type.
unsigned char * CrFwPckt_t
Type for packets (see CrFwPckt.h).
int CrFwBool_t
Type used for boolean values (1 represent "true" and 0 represents "false").
#define CR_FW_OUTCMP_TYPE
Type identifier for the OutComponent components.
static CrFwDestSrc_t dest
Destination.
void CrFwOutCmpSetDiscriminant(FwSmDesc_t smDesc, CrFwDiscriminant_t discriminant)
Set the discriminant of the OutComponent.
CrFwTimeStamp_t CrFwOutCmpGetTimeStamp(FwSmDesc_t smDesc)
Return the time stamp attribute of the OutComponent.
CrFwPckt_t CrFwOutCmpGetParStart(FwSmDesc_t smDesc)
Return the start address of the parameter area of the OutComponent.
CrFwDestSrc_t CrFwOutCmpGetDest(FwSmDesc_t smDesc)
Return the destination of the OutComponent.
CrFwBool_t CrFwOutCmpIsStartAck(FwSmDesc_t smDesc)
Return the acknowledge level for command start for the command encapsulated in the OutComponent.
CrFwBool_t CrFwOutCmpIsInPending(FwSmDesc_t smDesc)
Return true if the argument OutComponent is in state PENDING.
void CrFwOutCmpSetDest(FwSmDesc_t smDesc, CrFwDestSrc_t dest)
Set the destination of the OutComponent.
CrFwBool_t CrFwOutCmpIsTermAck(FwSmDesc_t smDesc)
Return the acknowledge level for command termination for the command encapsulated in the OutComponent...
CrFwBool_t CrFwOutCmpIsInLoaded(FwSmDesc_t smDesc)
Return true if the argument OutComponent is in state LOADED.
void CrFwOutCmpSetGroup(FwSmDesc_t smDesc, CrFwGroup_t group)
Set the group of the OutComponent.
CrFwServType_t CrFwOutCmpGetServType(FwSmDesc_t smDesc)
Return the type of the OutComponent.
CrFwBool_t CrFwOutCmpIsAcceptAck(FwSmDesc_t smDesc)
Return the acknowledge level for command acceptance for the command encapsulated in the OutComponent.
CrFwGroup_t CrFwOutCmpGetGroup(FwSmDesc_t smDesc)
Return the group of the OutComponent.
CrFwDiscriminant_t CrFwOutCmpGetDiscriminant(FwSmDesc_t smDesc)
Return the discriminant of the OutComponent.
CrFwPckt_t CrFwOutCmpGetPckt(FwSmDesc_t smDesc)
Return the pointer to the packet which holds the OutComponent.
void CrFwOutCmpSetAckLevel(FwSmDesc_t smDesc, CrFwBool_t accept, CrFwBool_t start, CrFwBool_t progress, CrFwBool_t term)
Set the acknowledge level for the command encapsulated in the OutComponent.
CrFwBool_t CrFwOutCmpIsInAborted(FwSmDesc_t smDesc)
Return true if the argument OutComponent is in state ABORTED.
CrFwServType_t CrFwOutCmpGetServSubType(FwSmDesc_t smDesc)
Return the sub-type of the OutComponent.
void CrFwOutCmpSetTimeStamp(FwSmDesc_t smDesc, CrFwTimeStamp_t timeStamp)
Set the time stamp attribute of the OutComponent.
CrFwBool_t CrFwOutCmpIsInTerminated(FwSmDesc_t smDesc)
Return true if the argument OutComponent is in state TERMINATED.
void CrFwOutCmpTerminate(FwSmDesc_t smDesc)
Send command Terminate to the argument OutComponent.
CrFwPcktLength_t CrFwOutCmpGetParLength(FwSmDesc_t smDesc)
Return the length in bytes of the parameter area of the OutComponent.
CrFwBool_t CrFwOutCmpIsProgressAck(FwSmDesc_t smDesc)
Return the acknowledge level for command progress for the command encapsulated in the OutComponent.
Definition of the OutComponent Component of the framework.
void CrFwOutCmpSample1SetCounter(unsigned char cnt)
Set the value of Sample 1 Counter (see CrFwOutCmpSample1Serialize).
void CrFwOutCmpSample1SetReadyFlag(CrFwBool_t flag)
Set the value of Ready Flag (see CrFwOutCmpSample1ReadyCheck).
static unsigned char counter
The Sample 1 Counter.
void CrFwOutCmpSample1SetRepeatFlag(CrFwBool_t flag)
Set the value of Repeat Flag (see CrFwOutCmpSample1RepeatCheck).
CrFwPckt_t CrFwOutCmpSample1GetPckt(FwSmDesc_t smDesc)
Return the packet associated to the Sample 1 OutComponent.
void CrFwOutCmpSample1SetEnableFlag(CrFwBool_t flag)
Set the value of Enable Flag (see CrFwOutCmpSample1EnableCheck).
CrFwBool_t CrFwOutCmpTestCase6()
Check the default Enable Check Operation and Ready Check Operation of an OutComponent.
CrFwBool_t CrFwOutCmpTestCase7()
Check the execution of a "repeat" OutComponent.
CrFwBool_t CrFwOutCmpTestCase8()
Check the execution of a "repeat" OutComponent with an invalid destination.
CrFwBool_t CrFwOutCmpTestCase4()
Check the execution of a "ready" OutComponent with a valid destination.
CrFwBool_t CrFwOutCmpTestCase5()
Check the execution of a "pending" OutComponent with a valid destination.
CrFwBool_t CrFwOutCmpTestCase2()
Check the abort function of an OutComponent.
CrFwBool_t CrFwOutCmpTestCase1()
Check the configuration of a newly created OutComponent.
CrFwBool_t CrFwOutCmpTestCase9()
Check the transition from state PENDING to state ABORTED.
CrFwBool_t CrFwOutCmpTestCase3()
Check the execution of a "ready" OutComponent with an invalid destination.
Declaration of the test cases for the OutComponent Component (see CrFwOutCmp.h).
CrFwOutFactoryPoolIndex_t CrFwOutFactoryGetNOfAllocatedOutCmp()
Return the number of OutComponents which are currently allocated.
static CrFwCmpData_t outCmpData[CR_FW_OUTFACTORY_MAX_NOF_OUTCMP]
The data for the pre-allocated OutComponent instances.
static FwSmDesc_t outFactory
The singleton instance of the OutFactory.
static CrFwInstanceId_t apidInstanceId
The part of the command or report identifier which depends on the application identifier.
FwSmDesc_t CrFwOutFactoryMakeOutCmp(CrFwServType_t type, CrFwServSubType_t subType, CrFwDiscriminant_t discriminant, CrFwPcktLength_t length)
Make function for an OutComponent.
FwSmDesc_t CrFwOutFactoryMake()
Factory function for the singleton instance of the OutFactory.
static FwSmDesc_t outCmp[CR_FW_OUTFACTORY_MAX_NOF_OUTCMP]
The pre-allocated OutComponent instances.
void CrFwOutFactoryReleaseOutCmp(FwSmDesc_t outCmpInstance)
Release function for an OutComponent.
Definition of the OutFactory component.
User-modifiable parameters for the OutFactory component (see CrFwOutFactory.h).
void CrFwOutRegistrySetEnable(CrFwServType_t servType, CrFwServSubType_t servSubType, CrFwDiscriminant_t discriminant, CrFwBool_t isEnabled)
Set the enable state of a set of out-going commands or reports.
Definition of the OutRegistry Component.
User-modifiable parameters for the OutRegistry component (see CrFwOutRegistry.h).
FwSmDesc_t CrFwOutStreamGet(CrFwDestSrc_t dest)
Getter function for the OutStream corresponding to the argument destination.
CrFwCounterU1_t CrFwOutStreamGetNOfPendingPckts(FwSmDesc_t smDesc)
Return the number of packets currently in the packet queue of an OutStream.
void CrFwOutStreamStubSetHandoverFlag(CrFwBool_t flag)
Set the value of the handover flag which determines the outcome of the packet handover in CrFwOutStre...
Interface for the OutStream stub.
Interface for creating and accessing a report or command packet.
CrFwPckt_t CrFwPcktGetParStart(CrFwPckt_t pckt)
Return the start address of the packet's parameter area.
CrFwBool_t CrFwPcktIsProgressAck(CrFwPckt_t pckt)
Return the acknowledge level for command progress for the command encapsulated in the packet.
CrFwBool_t CrFwPcktIsTermAck(CrFwPckt_t pckt)
Return the acknowledge level for command termination for the command encapsulated in the packet.
CrFwCmdRepType_t CrFwPcktGetCmdRepType(CrFwPckt_t pckt)
Return the type of a packet (either a command packet or a report packet).
CrFwPcktLength_t CrFwPcktGetParLength(CrFwPckt_t pckt)
Return the length in bytes of the packet's parameter area.
CrFwCounterU2_t CrFwPcktGetNOfAllocated()
Return the number of packets which are currently allocated.
CrFwServSubType_t CrFwPcktGetServSubType(CrFwPckt_t pckt)
Return the service sub-type of the command or report encapsulated in a packet.
CrFwDestSrc_t CrFwPcktGetDest(CrFwPckt_t pckt)
Return the destination of the command or report encapsulated in a packet.
CrFwInstanceId_t CrFwPcktGetCmdRepId(CrFwPckt_t pckt)
Return the command or report identifier of the command or report encapsulated in a packet.
CrFwBool_t CrFwPcktIsAcceptAck(CrFwPckt_t pckt)
Return the acknowledge level for command acceptance for the command encapsulated in the packet.
CrFwPcktLength_t CrFwPcktGetMaxLength()
Return the maximum length of a packet in number of bytes.
CrFwBool_t CrFwPcktIsStartAck(CrFwPckt_t pckt)
Return the acknowledge level for command start for the command encapsulated in the packet.
CrFwCrc_t CrFwPcktGetCrc(CrFwPckt_t pckt)
Return the CRC of the command or report encapsulated in a packet.
CrFwDiscriminant_t CrFwPcktGetDiscriminant(CrFwPckt_t pckt)
Return the discriminant of the command or report encapsulated in a packet.
CrFwServType_t CrFwPcktGetServType(CrFwPckt_t pckt)
Return the service type of the command or report encapsulated in a packet.
void CrFwRepErrStubReset()
Reset the error reporting interface.
CrFwInstanceId_t CrFwRepErrStubGetInstanceId(CrFwCounterU2_t errRepPos)
Return the type identifier of the error report at position errRepPos.
CrFwCounterU2_t CrFwRepErrStubGetPos()
Return the position in the error report array at which the next error report will be written.
CrFwTypeId_t CrFwRepErrStubGetTypeId(CrFwCounterU2_t errRepPos)
Return the type identifier of the error report at position errRepPos.
CrFwRepErrCode_t CrFwRepErrStubGetErrCode(CrFwCounterU2_t errRepPos)
Return the error code of the error report at position errRepPos.
Interface for reporting an error detected by a framework component.
The CORDET Framework defines an interface for generating error reports (see CrFwRepErr....
Interface through which framework components access the current time.
CrFwTime_t CrFwGetCurrentTime()
Return the current application time in standard format.
CrFwTime_t CrFwTimeStampToStdTime(CrFwTimeStamp_t timeStamp)
Convert a time value from time-stamp format to standard time format.
CrFwTimeStamp_t CrFwGetCurrentTimeStamp()
Return the current time in the format used for the command and report time-stamp.
CrFwTimeCyc_t CrFwGetCurrentCycTime()
Return the current time in "cycle format" (integer number of cycles elapsed since some event).
CrFwTimeStamp_t CrFwStdTimeToTimeStamp(CrFwTime_t stdTime)
Convert a time value from standard time format to time-stamp format.
unsigned int CrFwTimeStamp_t
Type used for the time stamp of a command or report.
float CrFwTime_t
Type used for the application time.
unsigned int CrFwTimeCyc_t
Type used for the number of elapsed cycles.
unsigned char CrFwDestSrc_t
Type used for the command or report destination and source.
unsigned short CrFwCounterU2_t
Type used for unsigned integers with a "medium" range.
#define CR_FW_NBITS_APP_ID
The number of bits reserved for the application identifier in a command or report identifier.
@ crOutCmpSendPcktInvDest
An OutComponent has an invalid destination (see CrFwOutCmp.h)
@ crNoAppErr
No application errors have been detected.
@ crOutStreamUndefDest
A framework function has been called with a destination attribute which is not associated to any OutS...
#define CR_FW_HOST_APP_ID
The identifier of the host application (i.e.
unsigned short CrFwInstanceId_t
Type used for instance identifiers.
CrFwAppErrCode_t CrFwGetAppErrCode()
Return the value of the application error code.
void CrFwSetAppErrCode(CrFwAppErrCode_t errCode)
Set the value of the application error code (see CrFwGetAppErrCode).
Definition of the utility functions for the CORDET Framework.
Type for the Framework Component Data (FCD).
void * cmpSpecificData
Derived data which are specific to each type of framework component.
Type for the data describing an OutComponent.
CrFwPckt_t pckt
Packet to which the out-going command or report is serialized.