CORDET Framework - C2 Implementation
|
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_t * | CrFwRepErrStubGetParArray (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. | |
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.
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.
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.
errCode | the error code |
instanceId | the instance identifier of the component which raises the error report |
typeId | the 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.
errCode | the error code |
instanceId | the instance identifier of the component which raises the error report |
typeId | the type identifier of the component which raises the error report |
cmd | a 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.
errCode | the error code |
instanceId | the instance identifier of the component which raises the error report |
typeId | the type identifier of the component which raises the error report |
destSrc | the 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.
errCode | the error code |
instanceId | the instance identifier of the component which raises the error report |
typeId | the type identifier of the component which raises the error report |
group | the 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.
errCode | the error code |
instanceId | the instance identifier of the component which raises the error report |
typeId | the type identifier of the component which raises the error report |
secondaryInstanceId | instance identifier of a component other than the originator of the error report |
dest | a command or report destination |
pckt | a 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.
errCode | the error code |
instanceId | the instance identifier of the component which raises the error report |
typeId | the type identifier of the component which raises the error report |
secondaryInstanceId | instance identifier of a component other than the originator of the error report |
outcome | outcome 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.
errCode | the error code |
instanceId | the instance identifier of the component which raises the error report |
typeId | the type identifier of the component which raises the error report |
servType | the report or command type |
servSubType | the report or command sub-type |
disc | the 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.
errCode | the error code |
instanceId | the instance identifier of the component which raises the error report |
typeId | the type identifier of the component which raises the error report |
pckt | a 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.
errCode | the error code |
instanceId | the instance identifier of the component which raises the error report |
typeId | the type identifier of the component which raises the error report |
rep | a 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.
errCode | the error code |
instanceId | the instance identifier of the component which raises the error report |
typeId | the type identifier of the component which raises the error report |
expSeqCnt | the expected sequence counter |
actSeqCnt | the actual sequence counter |
pckt | a 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
.
errRepPos | the position in the error reporting array |
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
.
errRepPos | the position in the error reporting array |
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.
errRepPos | the position in the error reporting array |
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
.
errRepPos | the position in the error reporting array |
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.
errRepPos | the position in the error reporting array |
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
.
errRepPos | the position in the error reporting array |
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.
errRepPos | the position in the error reporting array |
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.
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
.
errRepPos | the position in the error reporting array |
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.
errRepPos | the position in the error reporting array |
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.