CORDET Framework - C2 Implementation
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 
unsigned short CrFwInstanceId_t
Type used for instance identifiers.
unsigned char * CrFwPckt_t
Type for packets (see CrFwPckt.h).
Definition: CrFwConstants.h:38
The CORDET Framework defines an interface for reporting the outcome of an InCommand (see CrFwRepInCmd...
CrFwServType_t CrFwPcktGetServType(CrFwPckt_t pckt)
Return the service type of the command or report encapsulated in a packet.
Definition: CrFwPckt.c:291
CrFwInstanceId_t CrFwRepInCmdOutcomeStubGetInstanceId(CrFwCounterU2_t repPos)
Return the instance identifier of the InCommand Outcome Report at position repPos.
void CrFwRepInCmdOutcomeStubReset()
Reset the InCommand Outcome Reporting interface.
CrFwOutcome_t CrFwRepInCmdOutcomeStubGetFailCode(CrFwCounterU2_t repPos)
Return the failure code of the InCommand Outcome Report at position repPos.
Interface for creating and accessing a report or command packet.
CrFwOutcome_t failCode
The failure code (only meaningful for failure outcomes)
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.
static CrFwServSubType_t servSubType
Service sub-type.
unsigned char CrFwOutcome_t
Type used for the outcome of a check (see CrFwCmpData).
Header file to define all invariant publicly available constants and types for the CORDET Framework...
unsigned short CrFwDiscriminant_t
Type used for the discriminant of a command or report.
CrFwServType_t CrFwRepInCmdOutcomeStubGetServType(CrFwCounterU2_t repPos)
Return the service type of the InCommand Outcome Report at position repPos.
CrFwRepInCmdOutcome_t outcome
The outcome of the InCommand.
CrFwRepInCmdOutcome_t CrFwRepInCmdOutcomeStubGetOutcome(CrFwCounterU2_t repPos)
Return the outcome of the InCommand Outcome Report at position repPos.
static CrFwDiscriminant_t disc
Discriminant.
unsigned short CrFwCounterU2_t
Type used for unsigned integers with a "medium" range.
CrFwDiscriminant_t CrFwPcktGetDiscriminant(CrFwPckt_t pckt)
Return the discriminant of the command or report encapsulated in a packet.
Definition: CrFwPckt.c:273
static CrFwInCmdOutcomeRep_t inCmdOutcomeRepArray[CR_FW_INCMD_OUTCOME_REP_ARRAY_SIZE]
The InCommand Outcome Report array.
CrFwCounterU2_t CrFwRepInCmdOutcomeStubGetPos()
Return the position in the InCommand Outcome Report array at which the next outcome report will be wr...
CrFwServSubType_t servSubType
The service sub-type of the InCommand whose outcome is being reported.
FwSmDesc_t inCmd
The inCmd where the error occurred (NB: this is a pointer!)
CrFwServSubType_t CrFwPcktGetServSubType(CrFwPckt_t pckt)
Return the service sub-type of the command or report encapsulated in a packet.
Definition: CrFwPckt.c:303
CrFwDiscriminant_t CrFwRepInCmdOutcomeStubGetDiscriminant(CrFwCounterU2_t repPos)
Return the discriminant of the InCommand Outcome Report at position repPos.
Interface for reporting the outcome of the processing of an InCommand.
The structure for an InCommand Outcome Report.
CrFwServType_t servType
The service type of the InCommand whose outcome is being reported.
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.
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...
#define CR_FW_INCMD_OUTCOME_REP_ARRAY_SIZE
The size of the InCommand Outcome Report array.
CrFwInstanceId_t CrFwPcktGetCmdRepId(CrFwPckt_t pckt)
Return the command or report identifier of the command or report encapsulated in a packet...
Definition: CrFwPckt.c:339
static CrFwCounterU2_t inCmdOutcomeRepPos
The position in the InCommand Outcome Report array at which the next InCommand Outcome Report will be...
CrFwServSubType_t CrFwRepInCmdOutcomeStubGetServSubType(CrFwCounterU2_t repPos)
Return the service sub-type 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
unsigned char CrFwServType_t
Type used for the service type of a command or report.
CrFwInstanceId_t instanceId
The instance identifier of the InCommand whose outcome is being reported.
unsigned char CrFwServSubType_t
Type used for the command or report sub-type.
P&P Software GmbH, Copyright 2012-2013, All Rights Reserved