21 #include "FwSmConstants.h" 22 #include "FwSmConfig.h" 24 #include "FwPrConfig.h" 26 #include "FwPrConstants.h" 27 #include "FwPrDCreate.h" 29 #include "CrFwCmpData.h" 45 #include "config/CrFwOutFactoryUserPar.h" 70 static uint8_t memArray2set[
LPTSIZE*2];
71 static uint8_t memArray2get[
LPTSIZE*2];
87 if (outFactory == NULL)
89 if (FwSmCheckRec(outFactory) != smSuccess)
93 if (inFactory == NULL)
95 if (FwSmCheckRec(inFactory) != smSuccess)
99 if (outManager == NULL)
101 if (FwSmCheckRec(outManager) != smSuccess)
418 uint32_t
i, partsize, o, LptBuffer;
424 memArray2set[
i] = rand() % 255;
432 if (outFactory == NULL)
434 if (FwSmCheckRec(outFactory) != smSuccess)
438 if (inFactory == NULL)
440 if (FwSmCheckRec(inFactory) != smSuccess)
444 if (outManager == NULL)
446 if (FwSmCheckRec(outManager) != smSuccess)
486 memptr = &memArray2set[0];
487 o=(
sizeof(TcHeader_t)+
sizeof(CrPsTid_t)+
sizeof(CrPsNumberU4_t));
489 memcpy(&((uint8_t*)pckt)[o], memptr, partsize);
536 memptr = &memArray2set[partsize *
i];
537 o=(
sizeof(TcHeader_t)+
sizeof(CrPsTid_t)+
sizeof(CrPsNumberU4_t));
539 memcpy(&((uint8_t*)pckt)[o], memptr, partsize);
568 if ((partsize*(i+2)) >= (LPTSIZE))
592 memptr = &memArray2set[partsize *
i];
593 o=(
sizeof(TcHeader_t)+
sizeof(CrPsTid_t)+
sizeof(CrPsNumberU4_t));
594 partsize = LPTSIZE - partsize*
i;
595 memcpy(&((uint8_t*)pckt)[o], memptr, partsize);
629 if (memcmp(memArray2set, memArray2get, LPTSIZE))
672 uint32_t
i, PartSeqNmb, o, partsize, lptRemSize, LptBufferId;
686 if (outFactory == NULL)
688 if (FwSmCheckRec(outFactory) != smSuccess)
692 if (inFactory == NULL)
694 if (FwSmCheckRec(inFactory) != smSuccess)
698 if (outManager == NULL)
700 if (FwSmCheckRec(outManager) != smSuccess)
771 outCmp = outManagerCSData->
pocl[0];
820 o=(
sizeof(TmHeader_t)+
sizeof(CrPsTid_t)+
sizeof(CrPsNumberU4_t));
822 memcpy(&memArray2get[0], &((uint8_t*)cmpSpecificData->
pckt)[o], partsize);
827 outCmp = outManagerCSData->
pocl[1];
846 memcpy(&memArray2get[partsize], &((uint8_t*)cmpSpecificData->
pckt)[o], partsize);
855 memcpy(&memArray2get[partsize*2], &((uint8_t*)cmpSpecificData->
pckt)[o], partsize);
863 memcpy(&memArray2get[partsize*3], &((uint8_t*)cmpSpecificData->
pckt)[o], partsize);
868 outCmp = outManagerCSData->
pocl[2];
883 memcpy(&memArray2get[partsize*4], &((uint8_t*)cmpSpecificData->
pckt)[o], (
CrFwPcktGetLength(cmpSpecificData->
pckt) - o - CRC_LENGTH));
887 if (memcmp(memArray2set, memArray2get, LPTSIZE))
954 outCmp = outManagerCSData->
pocl[0];
971 outCmp = outManagerCSData->
pocl[1];
1047 uint32_t LptBufferId;
1061 if (outFactory == NULL)
1063 if (FwSmCheckRec(outFactory) != smSuccess)
1067 if (inFactory == NULL)
1069 if (FwSmCheckRec(inFactory) != smSuccess)
1073 if (outManager == NULL)
1075 if (FwSmCheckRec(outManager) != smSuccess)
1142 outCmp = outManagerCSData->
pocl[0];
1197 outCmp = outManagerCSData->
pocl[1];
1233 outCmp = outManagerCSData->
pocl[2];
1266 outCmp = outManagerCSData->
pocl[3];
1283 outCmp = outManagerCSData->
pocl[4];
Implementation of TM(13,2) LptDownInterRep.
void CrPsLptDownFirstRepUpdateAction(FwSmDesc_t smDesc)
Update action of TM(13,1) LptDownFirstRep.
Type for the Framework Component Data (FCD).
Interface through which framework components access the current time.
void CrPsLptStartDownCmdStartAction(FwSmDesc_t smDesc)
Start action of TC(13,129) LptStartDownCmd.
CrFwBool_t CrPsLptDownInterRepRepeatCheck(FwSmDesc_t smDesc)
Repeat check of TM(13,2) LptDownInterRep.
CrFwOutcome_t outcome
The outcome of an action or check executed by a state machine or by one of its procedures.
Definition of the InLoader component.
CrFwCounterU4_t i
CrPsCmd5EidStart function definitions.
#define CR_FW_OUTCMP_TYPE
Type identifier for the OutComponent components.
Implementation of TC(13,130) LptAbortDownCmd.
CrFwTypeId_t CrFwCmpGetTypeId(FwSmDesc_t smDesc)
Return the type identifier of the argument component.
void CrFwCmpInit(FwSmDesc_t smDesc)
Initialize a framework component.
Implementation of TC(13,9) LptUpFirstCmd.
FwSmBool_t CrPsLptIsTransferFinished(FwSmDesc_t smDesc)
Guard on the transition from DOWN_TRANSFER to INACTIVE.
Implementation of TM(13,1) LptDownFirstRep.
#define CR_FW_MAX_PCKT_LENGTH
The maximum size in number of bytes of a packet.
void CrFwPcktSetServType(CrFwPckt_t pckt, CrFwServType_t servType)
Set the service type of the command or report encapsulated in a packet.
#define LPTSIZE
The maximum size in number of bytes of a packet.
Create one instance of the CrPsLptUpCmdStart procedure.
static FwSmDesc_t outCmp[CR_FW_OUTFACTORY_MAX_NOF_OUTCMP]
The pre-allocated OutComponent instances.
#define CRFW_UNUSED(x)
A macro that can be used to specify that a function parameter is not used.
CrFwBool_t CrFwCmpIsInConfigured(FwSmDesc_t smDesc)
Return true if the argument component is in state CONFIGURED.
static CrPsSize_t getDplptRemSizeItem(int i)
Gets the value of the i-th element in the datapool array lptRemSize.
#define CRC_LENGTH
The length of CRC.
static void setDplptFailCodeItem(int i, CrPsFailCode_t lptFailCode)
Sets the value of the i-th element in the datapool array lptFailCode.
void CrFwSetAppErrCode(CrFwAppErrCode_t errCode)
Set the value of the application error code (see CrFwGetAppErrCode).
Header file to define all user-configurable constants and types for the IASW Application.
Interface for accessing data pool items.
static void setLptUpFirstCmdPartSeqNmb(void *p, CrPsNumberU4_t PartSeqNmb)
Set "PartSeqNmb" in "LptUpFirstCmd" packet.
static FwSmDesc_t inFactory
The singleton instance of the InFactory.
void CrFwPcktSetSrc(CrFwPckt_t pckt, CrFwDestSrc_t src)
Set the source of the command or report encapsulated in a packet.
#define CR_FW_OUTFACTORY_MAX_NOF_OUTCMP
The maximum number of OutComponents which may be allocated at any one time.
void CrPsLptUpLastCmdStartAction(FwSmDesc_t smDesc)
Start action of TC(13,11) LptUpLastCmd.
Definition of the OutFactory component.
Type for the data describing an OutComponent.
uint32_t getLptMemSize(uint32_t LptBuffer)
Getter function to return the size of the Data.
An OutComponent allocation request has failed (see CrFwOutFactoryMakeOutCmp).
CrFwPckt_t CrFwPcktMake(CrFwPcktLength_t pcktLength)
Make function for command or report packets.
static void setDplptTimeItem(int i, CrFwTimeStamp_t lptTime)
Sets the value of the i-th element in the datapool array lptTime.
static CrFwCmpData_t outManagerData[CR_FW_NOF_OUTMANAGER]
The data structures for the OutManager State Machines and their Procedures.
FwSmDesc_t CrFwOutManagerMake(CrFwInstanceId_t i)
Factory function to retrieve the i-th OutManager State Machine instance.
CrFwPckt_t pckt
Packet to which the out-going command or report is serialized.
Interface for creating and accessing a report or command packet.
void CrPsLptUpLastCmdTerminationAction(FwSmDesc_t smDesc)
Termination action of TC(13,11) LptUpLastCmd.
Interface through which applications can initialize and execute framework PUS extension components...
int CrFwBool_t
Type used for boolean values (1 represent "true" and 0 represents "false").
CrFwServType_t CrFwOutCmpGetServType(FwSmDesc_t smDesc)
Return the type of the OutComponent.
FwSmBool_t CrPsLptIsFailed(FwSmDesc_t smDesc)
Guard on the transition from UP_TRANSFER to INACTIVE.
void CrPsLptUpAbortRepUpdateAction(FwSmDesc_t smDesc)
Update action of TM(13,16) LptUpAbortRep.
Definition of the OutRegistry Component.
void CrFwPcktSetCmdRepType(CrFwPckt_t pckt, CrFwCmdRepType_t type)
Set the type of a packet (either a command packet or a report packet).
void CrPsLptStartDownCmdProgressAction(FwSmDesc_t smDesc)
Progress action of TC(13,129) LptStartDownCmd.
void CrPsLptAbortDownCmdTerminationAction(FwSmDesc_t smDesc)
Termination action of TC(13,130) LptAbortDownCmd.
Create one instance of the CrPsLpt state machine.
CrFwBool_t CrPsLptTestCase3()
Test the Service 13 EventReporting Service Down-Transfer.
static CrPsFailCode_t getDplptFailCodeItem(int i)
Gets the value of the i-th element in the datapool array lptFailCode.
void CrFwPcktSetSeqCnt(CrFwPckt_t pckt, CrFwSeqCnt_t seqCnt)
Set the sequence counter of the command or report encapsulated in a packet.
static void setDplptRemSizeItem(int i, CrPsSize_t lptRemSize)
Sets the value of the i-th element in the datapool array lptRemSize.
void CrPsLptUpInterCmdTerminationAction(FwSmDesc_t smDesc)
Termination action of TC(13,10) LptUpInterCmd.
static void setLptUpLastCmdTid(void *p, CrPsTid_t Tid)
Set "Tid" in "LptUpLastCmd" packet.
static FwSmDesc_t outFactory
The singleton instance of the OutFactory.
Interface for reporting an error detected by a framework component.
CrFwPcktLength_t CrFwPcktGetLength(CrFwPckt_t pckt)
Return the length (in number of bytes) of a packet.
void CrPsLptUpLastCmdProgressAction(FwSmDesc_t smDesc)
Progress action of TC(13,11) LptUpLastCmd.
void CrPsLptUpTransferDoAction(FwSmDesc_t smDesc)
Do Action for the state UP_TRANSFER.
CrFwBool_t CrPsLptDownInterRepEnableCheck(FwSmDesc_t smDesc)
Enable check of TM(13,2) LptDownInterRep.
Implementation of TC(13,129) LptStartDownCmd.
void CrFwPcktSetGroup(CrFwPckt_t pckt, CrFwGroup_t group)
Set the group of the command/report encapsulated in a packet.
void setLptUpLastCmdPart(void *p, CrPsPart_t Part, uint32_t o)
Set "Part" in "LptUpLastCmd" packet.
CrFwServType_t CrFwOutCmpGetServSubType(FwSmDesc_t smDesc)
Return the sub-type of the OutComponent.
void CrPsExecServLpt()
Execution of CORDET Framework PUS Extension components.
void CrPsLptAbortDownCmdStartAction(FwSmDesc_t smDesc)
Start action of TC(13,130) LptAbortDownCmd.
void * cmpSpecificData
Derived data which are specific to each type of framework component.
void CrFwPcktSetAckLevel(CrFwPckt_t pckt, CrFwBool_t accept, CrFwBool_t start, CrFwBool_t progress, CrFwBool_t term)
Set the acknowledge level for the command encapsulated in a packet.
Definition of the InFactory component.
Interface for accessing fields in packets of service "ServLPT".
Definition of the utility functions for the CORDET Framework.
Implementation of TM(13,3) LptDownLastRep.
void CrFwPcktSetServSubType(CrFwPckt_t pckt, CrFwServSubType_t servSubType)
Set the service sub-type of the command or report encapsulated in a packet.
void CrPsLptUpInterCmdProgressAction(FwSmDesc_t smDesc)
Progress action of TC(13,10) LptUpInterCmd.
Packet header definitions.
void CrFwCmpReset(FwSmDesc_t smDesc)
Reset a framework component.
FwSmDesc_t * pocl
Pending OutComponent List (POCL) for the OutManager.
static void setLptUpFirstCmdTid(void *p, CrPsTid_t Tid)
Set "Tid" in "LptUpFirstCmd" packet.
CrFwBool_t CrPsLptDownLastRepEnableCheck(FwSmDesc_t smDesc)
Enable check of TM(13,3) LptDownLastRep.
void CrPsExecServLptSm()
Execution of CORDET Framework PUS Extension components.
void CrPsLptLoadReport(FwSmDesc_t smDesc)
Action on the transition from UP_TRANSFER to INACTIVE.
CrFwCounterU2_t CrFwPcktGetNOfAllocated()
Return the number of packets which are currently allocated.
uint32_t * getLptMemStartAddr(uint32_t LptBuffer)
Getter function for the Address of the Data.
void CrPsLptDownInterRepUpdateAction(FwSmDesc_t smDesc)
Update action of TM(13,2) LptDownInterRep.
void CrFwCmpExecute(FwSmDesc_t smDesc)
Execute a framework component.
void CrPsLptUpFirstCmdTerminationAction(FwSmDesc_t smDesc)
Termination action of TC(13,9) LptUpFirstCmd.
CrFwOutFactoryPoolIndex_t CrFwOutFactoryGetNOfAllocatedOutCmp()
Return the number of OutComponents which are currently allocated.
void CrFwPcktSetDest(CrFwPckt_t pckt, CrFwDestSrc_t dest)
Set the destination of the command or report encapsulated in a packet.
Definition of Base Component.
static void setLptStartDownCmdTid(void *p, CrPsTid_t Tid)
Set "Tid" in "LptStartDownCmd" packet.
FwSmDesc_t CrFwInFactoryMake()
Factory function for the singleton instance of the InFactory.
void CrPsLptStartDownCmdTerminationAction(FwSmDesc_t smDesc)
Termination action of TC(13,129) LptStartDownCmd.
Implementation of TC(13,11) LptUpLastCmd.
void CrFwOutFactoryReleaseOutCmp(FwSmDesc_t outCmpInstance)
Release function for an OutComponent.
void CrPsLptUpFirstCmdProgressAction(FwSmDesc_t smDesc)
Progress action of TC(13,9) LptUpFirstCmd.
void CrFwInFactoryReleaseInCmd(FwSmDesc_t inCmdInstance)
Release function for an InCommand.
char * CrFwPckt_t
Type for packets (see CrFwPckt.h).
void setLptUpInterCmdPart(void *p, CrPsPart_t Part, uint32_t o)
Set "Part" in "LptUpInterCmd" packet.
CrFwBool_t CrPsLptTestCase2()
Test the Service 13 EventReporting Service Up-Transfer.
static void setLptUpInterCmdTid(void *p, CrPsTid_t Tid)
Set "Tid" in "LptUpInterCmd" packet.
static CrFwCounterU4_t getDppartSeqNmbItem(int i)
Gets the value of the i-th element in the datapool array partSeqNmb.
FwSmDesc_t CrFwOutFactoryMake()
Factory function for the singleton instance of the OutFactory.
static CrFwCmpData_t outCmpData[CR_FW_OUTFACTORY_MAX_NOF_OUTCMP]
The data for the pre-allocated OutComponent instances.
auxiliary Interface for accessing fields in packets of service "ServLPT".
CrFwBool_t CrPsLptDownFirstRepEnableCheck(FwSmDesc_t smDesc)
Enable check of TM(13,1) LptDownFirstRep.
void CrPsLptUpInterCmdStartAction(FwSmDesc_t smDesc)
Start action of TC(13,10) LptUpInterCmd.
Implementation of TC(13,10) LptUpInterCmd.
Interface through which applications can initialize and execute framework PUS extension components...
void setLptUpFirstCmdPart(void *p, CrPsPart_t Part, uint32_t o)
Set "Part" in "LptUpFirstCmd" packet.
int CrPsInitServLpt()
Initialization of CORDET Framework PUS Extension components.
void CrPsLptDownLastRepUpdateAction(FwSmDesc_t smDesc)
Update action of TM(13,3) LptDownLastRep.
static void setDppartSeqNmbItem(int i, CrFwCounterU4_t partSeqNmb)
Sets the value of the i-th element in the datapool array partSeqNmb.
static void setLptUpInterCmdPartSeqNmb(void *p, CrPsNumberU4_t PartSeqNmb)
Set "PartSeqNmb" in "LptUpInterCmd" packet.
CrFwCounterU1_t CrFwOutManagerGetNOfPendingOutCmp(FwSmDesc_t smDesc)
Return the number of OutComponents currently in the POCL of an OutManager.
CrFwInFactoryPoolIndex_t CrFwInFactoryGetNOfAllocatedInCmd()
Return the number of InCommands which are currently allocated.
No application errors have been detected.
static FwSmDesc_t inCmd[CR_FW_INFACTORY_MAX_NOF_INCMD]
The pre-allocated InCommand instances.
void CrPsLptUpFirstCmdStartAction(FwSmDesc_t smDesc)
Start action of TC(13,9) LptUpFirstCmd.
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.
CrFwBool_t CrPsLptTestCase1()
Check Service 13 (all standard functions to return outcome = 1)
FwSmDesc_t CrFwInFactoryMakeInCmd(CrFwPckt_t pckt)
Make function for a component encapsulating an incoming command (InCommand).
CrFwAppErrCode_t CrFwGetAppErrCode()
Return the value of the application error code.
void CrFwPcktSetDiscriminant(CrFwPckt_t pckt, CrFwDiscriminant_t discriminant)
Set the discriminant of the command or report encapsulated in a packet.
void CrPsLptAbortDownCmdProgressAction(FwSmDesc_t smDesc)
Progress action of TC(13,130) LptAbortDownCmd.
Definition of the InCommand Component of the framework.
unsigned int CrFwTimeStamp_t
Type used for the time stamp of a command or report.
Type for the data describing an OutManager.
CrFwBool_t CrPsLptTestCase4()
Test the Service 13 EventReporting Service other stuff.
static void setLptUpLastCmdPartSeqNmb(void *p, CrPsNumberU4_t PartSeqNmb)
Set "PartSeqNmb" in "LptUpLastCmd" packet.