CORDET Framework - C2 Implementation
cordetfw/tests/config/CrFwRepInCmdOutcome.c
Go to the documentation of this file.
1 
33 #include <stdlib.h>
34 /* Include Framework Files */
35 #include "CrFwConstants.h"
36 #include "CrFwRepInCmdOutcome.h"
37 #include "Pckt/CrFwPckt.h"
38 /* Include Configuration Files */
40 
42 #define CR_FW_INCMD_OUTCOME_REP_ARRAY_SIZE 10
43 
45 typedef struct {
59  FwSmDesc_t inCmd;
61 
64 
68 
69 /*-----------------------------------------------------------------------------------------*/
71  return inCmdOutcomeRepPos;
72 }
73 
74 /*-----------------------------------------------------------------------------------------*/
77 }
78 
79 /*-----------------------------------------------------------------------------------------*/
82 
83  inCmdOutcomeRepArray[inCmdOutcomeRepPos].outcome = outcome;
84  inCmdOutcomeRepArray[inCmdOutcomeRepPos].instanceId = instanceId;
85  inCmdOutcomeRepArray[inCmdOutcomeRepPos].failCode = failCode;
86  inCmdOutcomeRepArray[inCmdOutcomeRepPos].servType = servType;
87  inCmdOutcomeRepArray[inCmdOutcomeRepPos].servSubType = servSubType;
88  inCmdOutcomeRepArray[inCmdOutcomeRepPos].discriminant = disc;
89  inCmdOutcomeRepArray[inCmdOutcomeRepPos].inCmd = inCmd;
90 
92 }
93 
94 /*-----------------------------------------------------------------------------------------*/
96 
97  inCmdOutcomeRepArray[inCmdOutcomeRepPos].outcome = outcome;
98  inCmdOutcomeRepArray[inCmdOutcomeRepPos].instanceId = CrFwPcktGetCmdRepId(pckt);
99  inCmdOutcomeRepArray[inCmdOutcomeRepPos].failCode = failCode;
100  inCmdOutcomeRepArray[inCmdOutcomeRepPos].servType = CrFwPcktGetServType(pckt);
101  inCmdOutcomeRepArray[inCmdOutcomeRepPos].servSubType = CrFwPcktGetServSubType(pckt);
102  inCmdOutcomeRepArray[inCmdOutcomeRepPos].discriminant = CrFwPcktGetDiscriminant(pckt);
103  inCmdOutcomeRepArray[inCmdOutcomeRepPos].inCmd = NULL;
104 
106 }
107 
108 
109 
110 /*-----------------------------------------------------------------------------------------*/
112  return inCmdOutcomeRepArray[repPos].outcome;
113 }
114 
115 /*-----------------------------------------------------------------------------------------*/
117  return inCmdOutcomeRepArray[repPos].failCode;
118 }
119 
120 /*-----------------------------------------------------------------------------------------*/
122  return inCmdOutcomeRepArray[repPos].instanceId;
123 }
124 
125 /*-----------------------------------------------------------------------------------------*/
127  return inCmdOutcomeRepArray[repPos].servType;
128 }
129 
130 /*-----------------------------------------------------------------------------------------*/
132  return inCmdOutcomeRepArray[repPos].servSubType;
133 }
134 
135 /*-----------------------------------------------------------------------------------------*/
137  return inCmdOutcomeRepArray[repPos].discriminant;
138 }
139 
void CrFwRepInCmdOutcomeStubReset()
Reset the InCommand Outcome Reporting interface.
CrFwCounterU2_t CrFwRepInCmdOutcomeStubGetPos()
Return the position in the InCommand Outcome Report array at which the next outcome report will be wr...
CrFwServType_t CrFwPcktGetServType(CrFwPckt_t pckt)
Return the service type 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.
CrFwInstanceId_t CrFwPcktGetCmdRepId(CrFwPckt_t pckt)
Return the command or report identifier of the command or report encapsulated in a packet...
unsigned char CrFwServSubType_t
Type used for the command or report sub-type.
unsigned char * CrFwPckt_t
Type for packets (see CrFwPckt.h).
Definition: CrFwConstants.h:38
void CrFwRepInCmdOutcomeCreFail(CrFwRepInCmdOutcome_t outcome, CrFwOutcome_t failCode, CrFwPckt_t pckt)
Report the a "creation failure" outcome for the processing of a packet carrying an InCommand...
The CORDET Framework defines an interface for reporting the outcome of an InCommand (see CrFwRepInCmd...
unsigned short CrFwInstanceId_t
Type used for instance identifiers.
Interface for creating and accessing a report or command packet.
CrFwOutcome_t failCode
The failure code (only meaningful for failure outcomes)
static CrFwServSubType_t servSubType
Service sub-type.
unsigned char CrFwServType_t
Type used for the service type of a command or report.
Header file to define all invariant publicly available constants and types for the CORDET Framework...
CrFwRepInCmdOutcome_t outcome
The outcome of the InCommand.
static CrFwDiscriminant_t disc
Discriminant.
CrFwRepInCmdOutcome_t CrFwRepInCmdOutcomeStubGetOutcome(CrFwCounterU2_t repPos)
Return the outcome of the InCommand Outcome Report at position repPos.
CrFwInstanceId_t CrFwRepInCmdOutcomeStubGetInstanceId(CrFwCounterU2_t repPos)
Return the instance identifier of the InCommand Outcome Report at position repPos.
CrFwServSubType_t servSubType
The service sub-type of the InCommand whose outcome is being reported.
void CrFwRepInCmdOutcome(CrFwRepInCmdOutcome_t outcome, CrFwInstanceId_t instanceId, CrFwServType_t servType, CrFwServSubType_t servSubType, CrFwDiscriminant_t disc, CrFwOutcome_t failCode, FwSmDesc_t inCmd)
Report the outcome of the processing of an InCommand.
CrFwServSubType_t CrFwRepInCmdOutcomeStubGetServSubType(CrFwCounterU2_t repPos)
Return the service sub-type of the InCommand Outcome Report at position repPos.
FwSmDesc_t inCmd
The inCmd where the error occurred (NB: this is a pointer!)
unsigned char CrFwOutcome_t
Type used for the outcome of a check (see CrFwCmpData).
Interface for reporting the outcome of the processing of an InCommand.
unsigned short CrFwDiscriminant_t
Type used for the discriminant of a command or report.
The structure for an InCommand Outcome Report.
CrFwServType_t servType
The service type of the InCommand whose outcome is being reported.
CrFwServSubType_t CrFwPcktGetServSubType(CrFwPckt_t pckt)
Return the service sub-type of the command or report encapsulated in a packet.
CrFwRepInCmdOutcome_t
Enumerated type for the outcome of the processing of an incoming command.
CrFwDiscriminant_t discriminant
The discriminant of the InCommand whose outcome is being reported.
static CrFwServType_t servType
The InCommand type as computed in the Validity Check.
static CrFwCounterU2_t inCmdOutcomeRepPos
The position in the InCommand Outcome Report array at which the next InCommand Outcome Report will be...
CrFwServType_t CrFwRepInCmdOutcomeStubGetServType(CrFwCounterU2_t repPos)
Return the service type of the InCommand Outcome Report at position repPos.
CrFwDiscriminant_t CrFwRepInCmdOutcomeStubGetDiscriminant(CrFwCounterU2_t repPos)
Return the discriminant of the InCommand Outcome Report at position repPos.
static FwSmDesc_t inCmd[CR_FW_INFACTORY_MAX_NOF_INCMD]
The pre-allocated InCommand instances.
Definition: CrFwInFactory.c:58
static CrFwInCmdOutcomeRep_t inCmdOutcomeRepArray[CR_FW_INCMD_OUTCOME_REP_ARRAY_SIZE]
The InCommand Outcome Report array.
#define CR_FW_INCMD_OUTCOME_REP_ARRAY_SIZE
The size of the InCommand Outcome Report array.
unsigned short CrFwCounterU2_t
Type used for unsigned integers with a "medium" range.
CrFwOutcome_t CrFwRepInCmdOutcomeStubGetFailCode(CrFwCounterU2_t repPos)
Return the failure code of the InCommand Outcome Report at position repPos.
CrFwInstanceId_t instanceId
The instance identifier of the InCommand whose outcome is being reported.
P&P Software GmbH, Copyright 2012-2013, All Rights Reserved