CORDET Framework - C2 Implementation
|
Default implementation of the InCommand Outcome Reporting interface of CrFwRepInCmdOutcome.h
.
More...
Go to the source code of this file.
Data Structures | |
struct | CrFwInCmdOutcomeRep_t |
The structure for an InCommand Outcome Report. More... | |
Macros | |
#define | CR_FW_INCMD_OUTCOME_REP_ARRAY_SIZE 10 |
The size of the InCommand Outcome Report array. | |
Functions | |
CrFwCounterU2_t | CrFwRepInCmdOutcomeStubGetPos () |
Return the position in the InCommand Outcome Report array at which the next outcome report will be written. More... | |
void | CrFwRepInCmdOutcomeStubReset () |
Reset the InCommand Outcome Reporting interface. More... | |
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. More... | |
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. More... | |
CrFwRepInCmdOutcome_t | CrFwRepInCmdOutcomeStubGetOutcome (CrFwCounterU2_t repPos) |
Return the outcome of the InCommand Outcome Report at position repPos . More... | |
CrFwOutcome_t | CrFwRepInCmdOutcomeStubGetFailCode (CrFwCounterU2_t repPos) |
Return the failure code of the InCommand Outcome Report at position repPos . More... | |
CrFwInstanceId_t | CrFwRepInCmdOutcomeStubGetInstanceId (CrFwCounterU2_t repPos) |
Return the instance identifier of the InCommand Outcome Report at position repPos . More... | |
CrFwServType_t | CrFwRepInCmdOutcomeStubGetServType (CrFwCounterU2_t repPos) |
Return the service type of the InCommand Outcome Report at position repPos . More... | |
CrFwServSubType_t | CrFwRepInCmdOutcomeStubGetServSubType (CrFwCounterU2_t repPos) |
Return the service sub-type of the InCommand Outcome Report at position repPos . More... | |
CrFwDiscriminant_t | CrFwRepInCmdOutcomeStubGetDiscriminant (CrFwCounterU2_t repPos) |
Return the discriminant of the InCommand Outcome Report at position repPos . More... | |
Variables | |
static CrFwInCmdOutcomeRep_t | inCmdOutcomeRepArray [CR_FW_INCMD_OUTCOME_REP_ARRAY_SIZE] |
The InCommand Outcome Report array. | |
static CrFwCounterU2_t | inCmdOutcomeRepPos = 0 |
The position in the InCommand Outcome Report array at which the next InCommand Outcome Report will be written. | |
Default implementation of the InCommand Outcome Reporting interface of CrFwRepInCmdOutcome.h
.
The implementation of this interface is one of the adaptation points of the CORDET Framework. This file provides a default implementation which is primarily intended to support testing. It is expected that applications will provide their own implementation. Application will therefore normally replace this file with their own file providing their application-specific implementation.
This implementation stores the InCommand Outcome Reports in a pre-allocated array with a fixed size. The array is managed as a ring-buffer. Functions are provide to let external components access the InCommand Outcome Report array.
This file is part of the CORDET Framework.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
For information on alternative licensing, please contact P&P Software GmbH.
Definition in file cordetfw/tests/config/CrFwRepInCmdOutcome.c.
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.
The last parameter of this function is the InCommand whose outcome is being reported. This is a pointer variable. The owner of the pointer is the caller of the function. The function can use it in read-only mode to access the values of the command parameters.
outcome | the outcome of the InCommand processing |
instanceId | the instance identifier of the InCommand |
servType | the service type of the InCommand |
servSubType | the service sub-type of the InCommand |
disc | the discriminant of the InCommand |
failCode | the failure code (don't care in case of a "successful" outcome) |
inCmd | the InCommand component whose outcome is being reported |
Definition at line 80 of file cordetfw/tests/config/CrFwRepInCmdOutcome.c.
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 "creation failure" outcome is declared when a packet carrying an InCommand is received but it is not possible to create an InCommand component to encapsulate it. The failure to create the InCommand may be due either to a lack of resources in the application or to the fact that the command kind as given by its [type, sub-type, discriminant] is illegal. The last parameter of this function is the packet which carries the incoming command for which no InCommand component could be created. This is a pointer variable. The owner of the pointer is the caller of the function. The function can use it in read-only mode to access the values of the command parameters.
outcome | the outcome of the packet processing (always equal to crCmdAckCreFail in this version of the framework) |
failCode | the failure code |
pckt | the packet carrying the InCommand |
Definition at line 95 of file cordetfw/tests/config/CrFwRepInCmdOutcome.c.
CrFwDiscriminant_t CrFwRepInCmdOutcomeStubGetDiscriminant | ( | CrFwCounterU2_t | repPos | ) |
Return the discriminant of the InCommand Outcome Report at position repPos
.
This function is provided for convenience during testing. It is not part of the InCommand Outcome Reporting interface.
repPos | the position in the InCommand Outcome Report array |
Definition at line 136 of file cordetfw/tests/config/CrFwRepInCmdOutcome.c.
CrFwOutcome_t CrFwRepInCmdOutcomeStubGetFailCode | ( | CrFwCounterU2_t | repPos | ) |
Return the failure code of the InCommand Outcome Report at position repPos
.
This function is provided for convenience during testing. It is not part of the InCommand Outcome Reporting interface.
repPos | the position in the InCommand Outcome Report array |
Definition at line 116 of file cordetfw/tests/config/CrFwRepInCmdOutcome.c.
CrFwInstanceId_t CrFwRepInCmdOutcomeStubGetInstanceId | ( | CrFwCounterU2_t | repPos | ) |
Return the instance identifier of the InCommand Outcome Report at position repPos
.
This function is provided for convenience during testing. It is not part of the InCommand Outcome Reporting interface.
repPos | the position in the InCommand Outcome Report array |
Definition at line 121 of file cordetfw/tests/config/CrFwRepInCmdOutcome.c.
CrFwRepInCmdOutcome_t CrFwRepInCmdOutcomeStubGetOutcome | ( | CrFwCounterU2_t | repPos | ) |
Return the outcome of the InCommand Outcome Report at position repPos
.
This function is provided for convenience during testing. It is not part of the InCommand Outcome Reporting interface.
repPos | the position in the InCommand Outcome Report array |
Definition at line 111 of file cordetfw/tests/config/CrFwRepInCmdOutcome.c.
CrFwCounterU2_t CrFwRepInCmdOutcomeStubGetPos | ( | ) |
Return the position in the InCommand Outcome Report array at which the next outcome report will be written.
Definition at line 70 of file cordetfw/tests/config/CrFwRepInCmdOutcome.c.
CrFwServSubType_t CrFwRepInCmdOutcomeStubGetServSubType | ( | CrFwCounterU2_t | repPos | ) |
Return the service sub-type of the InCommand Outcome Report at position repPos
.
This function is provided for convenience during testing. It is not part of the InCommand Outcome Reporting interface.
repPos | the position in the InCommand Outcome Report array |
Definition at line 131 of file cordetfw/tests/config/CrFwRepInCmdOutcome.c.
CrFwServType_t CrFwRepInCmdOutcomeStubGetServType | ( | CrFwCounterU2_t | repPos | ) |
Return the service type of the InCommand Outcome Report at position repPos
.
This function is provided for convenience during testing. It is not part of the InCommand Outcome Reporting interface.
repPos | the position in the InCommand Outcome Report array |
Definition at line 126 of file cordetfw/tests/config/CrFwRepInCmdOutcome.c.
void CrFwRepInCmdOutcomeStubReset | ( | ) |
Reset the InCommand Outcome Reporting interface.
This effectively deletes all outcome reports created since the last reset.
Definition at line 75 of file cordetfw/tests/config/CrFwRepInCmdOutcome.c.