CORDET Framework - C2 Implementation
cordetfw/tests/config/CrFwRepErr.c File Reference

Default implementation of the error reporting interface of CrFwRepErr.h. More...

Go to the source code of this file.

Data Structures

struct  CrFwErrRep_t
 The structure for an error report. More...
 

Macros

#define CR_FW_ERR_REP_ARRAY_SIZE   100
 The size of the error report array.
 
#define CR_FW_ERR_REP_PAR_SIZE   12
 The size in number of bytes of the parameter part of an error report.
 

Functions

CrFwCounterU2_t CrFwRepErrStubGetPos ()
 Return the position in the error report array at which the next error report will be written. More...
 
void CrFwRepErrStubReset ()
 Reset the error reporting interface. More...
 
void CrFwRepErr (CrFwRepErrCode_t errCode, CrFwTypeId_t typeId, CrFwInstanceId_t instanceId)
 Report an error which has no parameters attached to it. More...
 
void CrFwRepErrDestSrc (CrFwRepErrCode_t errCode, CrFwTypeId_t typeId, CrFwInstanceId_t instanceId, CrFwDestSrc_t destSrc)
 Report an error which has one single parameter attached to it representing a command or report destination or source. More...
 
void CrFwRepErrInstanceIdAndDest (CrFwRepErrCode_t errCode, CrFwTypeId_t typeId, CrFwInstanceId_t instanceId, CrFwInstanceId_t secondaryInstanceId, CrFwDestSrc_t dest, CrFwPckt_t pckt)
 Report an error which has three parameters attached to it representing the instance identifier of a component other than the originator of the error report (the secondary instance identifier), a command or report destination and a command or report packet. More...
 
void CrFwRepErrGroup (CrFwRepErrCode_t errCode, CrFwTypeId_t typeId, CrFwInstanceId_t instanceId, CrFwGroup_t group)
 Report an error which has one single parameter attached to it representing a command or report group. More...
 
void CrFwRepErrSeqCnt (CrFwRepErrCode_t errCode, CrFwTypeId_t typeId, CrFwInstanceId_t instanceId, CrFwSeqCnt_t expSeqCnt, CrFwSeqCnt_t actSeqCnt, CrFwPckt_t pckt)
 Report an error which has two parameters attached to it representing expected and actual sequence counter values. More...
 
void CrFwRepErrInstanceIdAndOutcome (CrFwRepErrCode_t errCode, CrFwTypeId_t typeId, CrFwInstanceId_t instanceId, CrFwInstanceId_t secondaryInstanceId, CrFwOutcome_t outcome)
 Report an error which has two parameters attached to it representing the instance identifier of a component other than the originator of the error report (the secondary instance identifier) and the outcome field of a component's data. More...
 
void CrFwRepErrPckt (CrFwRepErrCode_t errCode, CrFwTypeId_t typeId, CrFwInstanceId_t instanceId, CrFwPckt_t pckt)
 Report an error which has one parameter attached to it representing a command or report packet. More...
 
void CrFwRepErrRep (CrFwRepErrCode_t errCode, CrFwTypeId_t typeId, CrFwInstanceId_t instanceId, FwSmDesc_t rep)
 Report an error which has one parameter attached to it representing an report component. More...
 
void CrFwRepErrCmd (CrFwRepErrCode_t errCode, CrFwTypeId_t typeId, CrFwInstanceId_t instanceId, FwSmDesc_t cmd)
 Report an error which has one parameter attached to it representing a command component. More...
 
void CrFwRepErrKind (CrFwRepErrCode_t errCode, CrFwTypeId_t typeId, CrFwInstanceId_t instanceId, CrFwServType_t servType, CrFwServSubType_t servSubType, CrFwDiscriminant_t disc)
 Report an error which has three parameters attached to it representing the kind of a report or command as given by the triplet [type, sub-type, discriminant]. More...
 
CrFwRepErrCode_t CrFwRepErrStubGetErrCode (CrFwCounterU2_t errRepPos)
 Return the error code of the error report at position errRepPos. More...
 
CrFwTypeId_t CrFwRepErrStubGetTypeId (CrFwCounterU2_t errRepPos)
 Return the type identifier of the error report at position errRepPos. More...
 
CrFwInstanceId_t CrFwRepErrStubGetInstanceId (CrFwCounterU2_t errRepPos)
 Return the type identifier of the error report at position errRepPos. More...
 
CrFwCounterU1_tCrFwRepErrStubGetParArray (CrFwCounterU2_t errRepPos)
 Return the array holding the parameters associated to the error report at position errRepPos. More...
 
CrFwDestSrc_t CrFwRepErrStubGetDest (CrFwCounterU2_t errRepPos)
 Return the destination associated to the error report at position errRepPos. More...
 
CrFwSeqCnt_t CrFwRepErrStubGetExpSeqCnt (CrFwCounterU2_t errRepPos)
 Return the expected sequence counter associated to the error report at position errRepPos. More...
 
CrFwSeqCnt_t CrFwRepErrStubGetActualSeqCnt (CrFwCounterU2_t errRepPos)
 Return the actual sequence counter associated to the error report at position errRepPos. More...
 
CrFwInstanceId_t CrFwRepErrStubGetSecondatyInstanceId (CrFwCounterU2_t errRepPos)
 Return the secondary instance identifier associated to the error report at position errRepPos. More...
 
CrFwOutcome_t CrFwRepErrStubGetOutcome (CrFwCounterU2_t errRepPos)
 Return the outcome associated to the error report at position errRepPos. More...
 

Variables

static CrFwErrRep_t errRepArray [CR_FW_ERR_REP_ARRAY_SIZE]
 The error report array.
 
static CrFwCounterU2_t errRepPos = 0
 The position in the error report array at which the next error report will be written.
 

Detailed Description

Default implementation of the error reporting interface of CrFwRepErr.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 error 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 error 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 cordetfw/tests/config/CrFwRepErr.c.

Function Documentation

void CrFwRepErr ( CrFwRepErrCode_t  errCode,
CrFwTypeId_t  typeId,
CrFwInstanceId_t  instanceId 
)

Report an error which has no parameters attached to it.

This function generate an error report without error parameters.

Parameters
errCodethe error code
instanceIdthe instance identifier of the component which raises the error report
typeIdthe type identifier of the component which raises the error report

Definition at line 81 of file cordetfw/tests/config/CrFwRepErr.c.

void CrFwRepErrCmd ( CrFwRepErrCode_t  errCode,
CrFwTypeId_t  typeId,
CrFwInstanceId_t  instanceId,
FwSmDesc_t  cmd 
)

Report an error which has one parameter attached to it representing a command component.

This function generate an error report with one parameter.

Parameters
errCodethe error code
instanceIdthe instance identifier of the component which raises the error report
typeIdthe type identifier of the component which raises the error report
cmda component holding a command

Definition at line 224 of file cordetfw/tests/config/CrFwRepErr.c.

void CrFwRepErrDestSrc ( CrFwRepErrCode_t  errCode,
CrFwTypeId_t  typeId,
CrFwInstanceId_t  instanceId,
CrFwDestSrc_t  destSrc 
)

Report an error which has one single parameter attached to it representing a command or report destination or source.

This function generate an error report with one parameter.

Parameters
errCodethe error code
instanceIdthe instance identifier of the component which raises the error report
typeIdthe type identifier of the component which raises the error report
destSrcthe invalid destination or source

Definition at line 94 of file cordetfw/tests/config/CrFwRepErr.c.

void CrFwRepErrGroup ( CrFwRepErrCode_t  errCode,
CrFwTypeId_t  typeId,
CrFwInstanceId_t  instanceId,
CrFwGroup_t  group 
)

Report an error which has one single parameter attached to it representing a command or report group.

This function generate an error report with one parameter.

Parameters
errCodethe error code
instanceIdthe instance identifier of the component which raises the error report
typeIdthe type identifier of the component which raises the error report
groupthe invalid group

Definition at line 128 of file cordetfw/tests/config/CrFwRepErr.c.

void CrFwRepErrInstanceIdAndDest ( CrFwRepErrCode_t  errCode,
CrFwTypeId_t  typeId,
CrFwInstanceId_t  instanceId,
CrFwInstanceId_t  secondaryInstanceId,
CrFwDestSrc_t  dest,
CrFwPckt_t  pckt 
)

Report an error which has three parameters attached to it representing the instance identifier of a component other than the originator of the error report (the secondary instance identifier), a command or report destination and a command or report packet.

This function generate an error report with two parameters.

Parameters
errCodethe error code
instanceIdthe instance identifier of the component which raises the error report
typeIdthe type identifier of the component which raises the error report
secondaryInstanceIdinstance identifier of a component other than the originator of the error report
desta command or report destination
pckta packet holding a command or report (this is a pointer which is only guaranteed valid during the function execution)

Definition at line 109 of file cordetfw/tests/config/CrFwRepErr.c.

void CrFwRepErrInstanceIdAndOutcome ( CrFwRepErrCode_t  errCode,
CrFwTypeId_t  typeId,
CrFwInstanceId_t  instanceId,
CrFwInstanceId_t  secondaryInstanceId,
CrFwOutcome_t  outcome 
)

Report an error which has two parameters attached to it representing the instance identifier of a component other than the originator of the error report (the secondary instance identifier) and the outcome field of a component's data.

This function generate an error report with two parameters.

Parameters
errCodethe error code
instanceIdthe instance identifier of the component which raises the error report
typeIdthe type identifier of the component which raises the error report
secondaryInstanceIdinstance identifier of a component other than the originator of the error report
outcomeoutcome field of a component's data

Definition at line 175 of file cordetfw/tests/config/CrFwRepErr.c.

void CrFwRepErrKind ( CrFwRepErrCode_t  errCode,
CrFwTypeId_t  typeId,
CrFwInstanceId_t  instanceId,
CrFwServType_t  servType,
CrFwServSubType_t  servSubType,
CrFwDiscriminant_t  disc 
)

Report an error which has three parameters attached to it representing the kind of a report or command as given by the triplet [type, sub-type, discriminant].

This function generate an error report with three parameters.

Parameters
errCodethe error code
instanceIdthe instance identifier of the component which raises the error report
typeIdthe type identifier of the component which raises the error report
servTypethe report or command type
servSubTypethe report or command sub-type
discthe report or command discriminant

Definition at line 241 of file cordetfw/tests/config/CrFwRepErr.c.

void CrFwRepErrPckt ( CrFwRepErrCode_t  errCode,
CrFwTypeId_t  typeId,
CrFwInstanceId_t  instanceId,
CrFwPckt_t  pckt 
)

Report an error which has one parameter attached to it representing a command or report packet.

This function generate an error report with one parameter.

Parameters
errCodethe error code
instanceIdthe instance identifier of the component which raises the error report
typeIdthe type identifier of the component which raises the error report
pckta packet holding a command or report (this is a pointer which is only guaranteed valid during the function execution)

Definition at line 193 of file cordetfw/tests/config/CrFwRepErr.c.

void CrFwRepErrRep ( CrFwRepErrCode_t  errCode,
CrFwTypeId_t  typeId,
CrFwInstanceId_t  instanceId,
FwSmDesc_t  rep 
)

Report an error which has one parameter attached to it representing an report component.

This function generate an error report with one parameter.

Parameters
errCodethe error code
instanceIdthe instance identifier of the component which raises the error report
typeIdthe type identifier of the component which raises the error report
repa component holding a report

Definition at line 207 of file cordetfw/tests/config/CrFwRepErr.c.

void CrFwRepErrSeqCnt ( CrFwRepErrCode_t  errCode,
CrFwTypeId_t  typeId,
CrFwInstanceId_t  instanceId,
CrFwSeqCnt_t  expSeqCnt,
CrFwSeqCnt_t  actSeqCnt,
CrFwPckt_t  pckt 
)

Report an error which has two parameters attached to it representing expected and actual sequence counter values.

This function generate an error report with two parameters.

Parameters
errCodethe error code
instanceIdthe instance identifier of the component which raises the error report
typeIdthe type identifier of the component which raises the error report
expSeqCntthe expected sequence counter
actSeqCntthe actual sequence counter
pckta packet holding a command or report (this is a pointer which is only guaranteed valid during the function execution)

Definition at line 143 of file cordetfw/tests/config/CrFwRepErr.c.

CrFwSeqCnt_t CrFwRepErrStubGetActualSeqCnt ( CrFwCounterU2_t  errRepPos)

Return the actual sequence counter associated to the error report at position errRepPos.

This function assumes that the error report at position errRepPos was created with a call to CrFwRepErrSeqCnt.

Parameters
errRepPosthe position in the error reporting array
Returns
the actual sequence counter

Definition at line 290 of file cordetfw/tests/config/CrFwRepErr.c.

CrFwDestSrc_t CrFwRepErrStubGetDest ( CrFwCounterU2_t  errRepPos)

Return the destination associated to the error report at position errRepPos.

This function assumes that the error report at position errRepPos was created with a call to CrFwRepErrDestSrc.

Parameters
errRepPosthe position in the error reporting array
Returns
the destination

Definition at line 279 of file cordetfw/tests/config/CrFwRepErr.c.

CrFwRepErrCode_t CrFwRepErrStubGetErrCode ( CrFwCounterU2_t  errRepPos)

Return the error code of the error report at position errRepPos.

This function is provided for convenience during testing. It is not part of the error reporting interface.

Parameters
errRepPosthe position in the error reporting array
Returns
the error code

Definition at line 259 of file cordetfw/tests/config/CrFwRepErr.c.

CrFwSeqCnt_t CrFwRepErrStubGetExpSeqCnt ( CrFwCounterU2_t  errRepPos)

Return the expected sequence counter associated to the error report at position errRepPos.

This function assumes that the error report at position errRepPos was created with a call to CrFwRepErrSeqCnt.

Parameters
errRepPosthe position in the error reporting array
Returns
the expected sequence counter

Definition at line 284 of file cordetfw/tests/config/CrFwRepErr.c.

CrFwInstanceId_t CrFwRepErrStubGetInstanceId ( CrFwCounterU2_t  errRepPos)

Return the type identifier of the error report at position errRepPos.

This function is provided for convenience during testing. It is not part of the error reporting interface.

Parameters
errRepPosthe position in the error reporting array
Returns
the error code

Definition at line 269 of file cordetfw/tests/config/CrFwRepErr.c.

CrFwOutcome_t CrFwRepErrStubGetOutcome ( CrFwCounterU2_t  errRepPos)

Return the outcome associated to the error report at position errRepPos.

This function assumes that the error report at position errRepPos was created with a call to CrFwRepErrInstanceIdAndOutcome.

Parameters
errRepPosthe position in the error reporting array
Returns
the value of the outcome

Definition at line 301 of file cordetfw/tests/config/CrFwRepErr.c.

CrFwCounterU1_t* CrFwRepErrStubGetParArray ( CrFwCounterU2_t  errRepPos)

Return the array holding the parameters associated to the error report at position errRepPos.

This function is provided for convenience during testing. It is not part of the error reporting interface.

Parameters
errRepPosthe position in the error reporting array
Returns
the error code

Definition at line 274 of file cordetfw/tests/config/CrFwRepErr.c.

CrFwCounterU2_t CrFwRepErrStubGetPos ( )

Return the position in the error report array at which the next error report will be written.

Returns
the position in the error report array at which the next error report will be written

Definition at line 71 of file cordetfw/tests/config/CrFwRepErr.c.

CrFwInstanceId_t CrFwRepErrStubGetSecondatyInstanceId ( CrFwCounterU2_t  errRepPos)

Return the secondary instance identifier associated to the error report at position errRepPos.

This function assumes that the error report at position errRepPos was created with a call to CrFwRepErrInstanceIdAndOutcome.

Parameters
errRepPosthe position in the error reporting array
Returns
the secondary instance identifier

Definition at line 296 of file cordetfw/tests/config/CrFwRepErr.c.

CrFwTypeId_t CrFwRepErrStubGetTypeId ( CrFwCounterU2_t  errRepPos)

Return the type identifier of the error report at position errRepPos.

This function is provided for convenience during testing. It is not part of the error reporting interface.

Parameters
errRepPosthe position in the error reporting array
Returns
the error code

Definition at line 264 of file cordetfw/tests/config/CrFwRepErr.c.

void CrFwRepErrStubReset ( )

Reset the error reporting interface.

This effectively deletes all error reports created since the last reset.

Definition at line 76 of file cordetfw/tests/config/CrFwRepErr.c.

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