CORDET Framework - C2 Implementation
CrFwRepInCmdOutcome.c File Reference

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.
 

Detailed Description

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.

Author
Vaclav Cechticky vacla.nosp@m.v.ce.nosp@m.chtic.nosp@m.ky@p.nosp@m.np-so.nosp@m.ftwa.nosp@m.re.co.nosp@m.m
Alessandro Pasetti paset.nosp@m.ti@p.nosp@m.np-so.nosp@m.ftwa.nosp@m.re.co.nosp@m.m

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 CrFwRepInCmdOutcome.c.

Function Documentation

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.

Parameters
outcomethe outcome of the InCommand processing
instanceIdthe instance identifier of the InCommand
servTypethe service type of the InCommand
servSubTypethe service sub-type of the InCommand
discthe discriminant of the InCommand
failCodethe failure code (don't care in case of a "successful" outcome)
inCmdthe InCommand component whose outcome is being reported

Definition at line 80 of file 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.

Parameters
outcomethe outcome of the packet processing (always equal to crCmdAckCreFail in this version of the framework)
failCodethe failure code
pcktthe packet carrying the InCommand

Definition at line 95 of file 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.

Parameters
repPosthe position in the InCommand Outcome Report array
Returns
the service type

Definition at line 136 of file 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.

Parameters
repPosthe position in the InCommand Outcome Report array
Returns
the failure code

Definition at line 116 of file 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.

Parameters
repPosthe position in the InCommand Outcome Report array
Returns
the instance identifier

Definition at line 121 of file 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.

Parameters
repPosthe position in the InCommand Outcome Report array
Returns
the outcome

Definition at line 111 of file CrFwRepInCmdOutcome.c.

CrFwCounterU2_t CrFwRepInCmdOutcomeStubGetPos ( )

Return the position in the InCommand Outcome Report array at which the next outcome report will be written.

Returns
the position in the InCommand Outcome Report array at which the next outcome report will be written

Definition at line 70 of file 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.

Parameters
repPosthe position in the InCommand Outcome Report array
Returns
the service sub-type

Definition at line 131 of file 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.

Parameters
repPosthe position in the InCommand Outcome Report array
Returns
the service type

Definition at line 126 of file 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 CrFwRepInCmdOutcome.c.

P&P Software GmbH, Copyright 2012-2013, All Rights Reserved