CORDET Framework - C2 Implementation
cordetfw-examples/src/CrConfigDemoSlave2/CrFwRepInCmdOutcome.c
Go to the documentation of this file.
1 
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <string.h>
24 #include "CrDaConstants.h"
25 /* Include Framework Files */
26 #include "CrFwConstants.h"
27 #include "CrFwRepInCmdOutcome.h"
28 
29 /*-----------------------------------------------------------------------------------------*/
32  if (outcome == crCmdAckStrSucc) {
33  if ((servType == CR_DA_SERV_TYPE) && (servSubType == CR_DA_SERV_SUBTYPE_EN))
34  printf("S2: successful start for InCommand to enable temperature monitoring\n");
35  else if ((servType == CR_DA_SERV_TYPE) && (servSubType == CR_DA_SERV_SUBTYPE_DIS))
36  printf("S2: successful start for InCommand to disable temperature monitoring\n");
37  else if ((servType == CR_DA_SERV_TYPE) && (servSubType == CR_DA_SERV_SUBTYPE_SET))
38  printf("S2: successful start for InCommand to set temperature limit\n");
39  return;
40  }
41 
42  if (outcome == crCmdAckPrgSucc) {
43  printf("S2: unexpected progress report for InCommand %d, service type %d,\n",instanceId,servType);
44  printf(" service sub-type %d, and discriminant %d\n",servSubType,disc);
45  } else if (outcome == crCmdAckTrmSucc) {
46  printf("S2: unexpected termination report for InCommand %d, service type %d,\n",instanceId,servType);
47  printf(" service sub-type %d, and discriminant %d\n",servSubType,disc);
48  } else if (outcome == crCmdAckAccFail) {
49  printf("S2: unexpected acceptance failure report for InCommand %d, service type %d,\n",instanceId,servType);
50  printf(" service sub-type %d, and discriminant %d; fail code: %d\n",servSubType,disc,failCode);
51  } else if (outcome == crCmdAckStrFail) {
52  printf("S2: unexpected start failure report for InCommand %d, service type %d,\n",instanceId,servType);
53  printf(" service sub-type %d, and discriminant %d; fail code: %d\n",servSubType,disc,failCode);
54  } else if (outcome == crCmdAckPrgFail) {
55  printf("S2: unexpected progress failure report for InCommand %d, service type %d,\n",instanceId,servType);
56  printf(" service sub-type %d, and discriminant %d; fail code: %d\n",servSubType,disc,failCode);
57  } else if (outcome == crCmdAckTrmFail) {
58  printf("S2: unexpected termination failure report for InCommand %d, service type %d,\n",instanceId,servType);
59  printf(" service sub-type %d, and discriminant %d; fail code: %d\n",servSubType,disc,failCode);
60  }
61 }
62 
63 /*-----------------------------------------------------------------------------------------*/
65 
66  printf("S2: failure to create InCommand component\n");
67 }
68 
#define CR_DA_SERV_SUBTYPE_SET
The identifier of the service sub-type to set the temperature limit.
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
unsigned short CrFwInstanceId_t
Type used for instance identifiers.
#define CR_DA_SERV_TYPE
The identifier of the service type supported by the demo application.
Acceptance failure.
#define CR_DA_SERV_SUBTYPE_DIS
The identifier of the service sub-type to disable temperature monitoring.
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...
Start failure.
static CrFwDiscriminant_t disc
Discriminant.
#define CR_DA_SERV_SUBTYPE_EN
The identifier of the service sub-type to enable temperature monitoring.
Termination failure.
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.
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...
Termination success.
CrFwRepInCmdOutcome_t
Enumerated type for the outcome of the processing of an incoming command.
static CrFwServType_t servType
The InCommand type as computed in the Validity Check.
Start success.
static FwSmDesc_t inCmd[CR_FW_INFACTORY_MAX_NOF_INCMD]
The pre-allocated InCommand instances.
Definition: CrFwInFactory.c:58
Progress success.
Progress failure.
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.
P&P Software GmbH, Copyright 2012-2013, All Rights Reserved