CORDET Framework - C2 Implementation
CrFwConstants.h File Reference

Header file to define all invariant publicly available constants and types for the CORDET Framework. More...

Go to the source code of this file.

Data Structures

struct  CrFwPcktQueue
 Descriptor for a Packet Queue (PQ) in an OutStream or InStream. More...
 
struct  CrFwInRepKindDesc_t
 InReport kind descriptor type. More...
 
struct  CrFwInCmdKindDesc_t
 InCommand kind descriptor type. More...
 
struct  CrFwOutCmpKindDesc_t
 OutComponent kind descriptor type. More...
 
struct  CrFwServDesc_t
 Service descriptor type. More...
 
struct  InManagerData
 Type for the data describing an InManager. More...
 
struct  OutManagerData
 Type for the data describing an OutManager. More...
 
struct  InLoaderData
 Type for the data describing an InLoader. More...
 
struct  InStreamData
 Type for the data describing an InStream. More...
 
struct  OutStreamData
 Type for the data describing an OutStream. More...
 
struct  InCmdData
 Type for the data describing an InCommand. More...
 
struct  InRepData
 Type for the data describing an InReport. More...
 
struct  OutCmpData
 Type for the data describing an OutComponent. More...
 

Macros

#define CRFW_UNUSED(x)   (void)(x);
 A macro that can be used to specify that a function parameter is not used.
 
#define CR_FW_OUTSTREAM_TYPE   1
 Type identifier for the OutStream components.
 
#define CR_FW_INSTREAM_TYPE   2
 Type identifier for the InStream components.
 
#define CR_FW_OUTCMP_TYPE   3
 Type identifier for the OutComponent components.
 
#define CR_FW_OUTREGISTRY_TYPE   4
 Type identifier for the OutRegistry component.
 
#define CR_FW_OUTFACTORY_TYPE   5
 Type identifier for the OutFactory component.
 
#define CR_FW_OUTMANAGER_TYPE   6
 Type identifier for the OutManager component.
 
#define CR_FW_OUTLOADER_TYPE   7
 Type identifier for the OutLoader component.
 
#define CR_FW_INFACTORY_TYPE   8
 Type identifier for the InFactory component.
 
#define CR_FW_INREPORT_TYPE   9
 Type identifier for the InReport component.
 
#define CR_FW_INCOMMAND_TYPE   10
 Type identifier for the InCommand component.
 
#define CR_FW_INREGISTRY_TYPE   11
 Type identifier for the OutRegistry component.
 
#define CR_FW_INMANAGER_TYPE   12
 Type identifier for the InManager component.
 
#define CR_FW_INLOADER_TYPE   13
 Type identifier for the InLoader component.
 
#define CR_FW_APP_TYPE   14
 Type identifier for the Application State Machine.
 
#define CR_FW_MAX_NOF_TRANS_CMDS   4
 Maximum number of transition commands defined on a framework component or framework state machine.
 
#define CR_FW_BASE_STATE_CREATED   1
 State identifier for state CREATED in the Base State Machine.
 
#define CR_FW_BASE_STATE_INITIALIZED   2
 State identifier for state INITIALIZED in the Base State Machine.
 
#define CR_FW_BASE_STATE_CONFIGURED   3
 State identifier for state CONFIGURED in the Base State Machine.
 
#define CR_FW_BASE_TR_INIT   1
 Identifier for transition command "Init" in the Base State Machine.
 
#define CR_FW_BASE_TR_RESET   2
 Identifier for transition command "Reset" in the Base State Machine.
 
#define CR_FW_BASE_TR_SHUTDOWN   3
 Identifier for transition command "Shutdown" in the Base State Machine.
 
#define CR_FW_INCMD_STATE_ACCEPTED   1
 State identifier for state ACCEPTED in the InCommand State Machine.
 
#define CR_FW_INCMD_STATE_PROGRESS   2
 State identifier for state PROGRESS in the InCommand State Machine.
 
#define CR_FW_INCMD_STATE_TERMINATED   3
 State identifier for state TERMINATED in the InCommand State Machine.
 
#define CR_FW_INCMD_STATE_ABORTED   4
 State identifier for state ABORTED in the InCommand State Machine.
 
#define CR_FW_INCMD_TR_TERMINATE   CR_FW_INCOMMAND_TYPE*CR_FW_MAX_NOF_TRANS_CMDS+0
 Identifier for transition command "Terminate" in the InCommand State Machine.
 
#define CR_FW_INSTREAM_STATE_WAITING   1
 State identifier for state WAITING in the InStream State Machine.
 
#define CR_FW_INSTREAM_STATE_PCKT_AVAIL   2
 State identifier for state PCKT_AVAIL in the InStream State Machine.
 
#define CR_FW_INSTREAM_TR_GET_PCKT   CR_FW_INSTREAM_TYPE*CR_FW_MAX_NOF_TRANS_CMDS+0
 Identifier for transition command "GetPacket" in the InStream State Machine.
 
#define CR_FW_INSTREAM_TR_PACKET_AVAILABLE   CR_FW_INSTREAM_TYPE*CR_FW_MAX_NOF_TRANS_CMDS+1
 Identifier for transition command "PacketAvailable" in the InStream State Machine.
 
#define CR_FW_OUTCMP_STATE_LOADED   1
 State identifier for state LOADED in the OutComponent State Machine.
 
#define CR_FW_OUTCMP_STATE_ABORTED   2
 State identifier for state ABORTED in the OutComponent State Machine.
 
#define CR_FW_OUTCMP_STATE_PENDING   3
 State identifier for state PENDING in the OutComponent State Machine.
 
#define CR_FW_OUTCMP_STATE_TERMINATED   4
 State identifier for state TERMINATED the OutComponent State Machine.
 
#define CR_FW_OUTCMP_TR_TERMINATE   CR_FW_OUTCMP_TYPE*CR_FW_MAX_NOF_TRANS_CMDS+0
 Identifier for transition command "Terminate" in the OutComponent State Machine.
 
#define CR_FW_OUTSTREAM_STATE_READY   1
 State identifier for state READY in the OutStream State Machine.
 
#define CR_FW_OUTSTREAM_STATE_BUFFERING   2
 State identifier for state INITIALIZED in the OutStream State Machine.
 
#define CR_FW_OUTSTREAM_TR_SEND   CR_FW_OUTSTREAM_TYPE*CR_FW_MAX_NOF_TRANS_CMDS+0
 Identifier for transition command "Send" in the OutStream State Machine.
 
#define CR_FW_OUTSTREAM_TR_CONNECTION_AVAILABLE   CR_FW_OUTSTREAM_TYPE*CR_FW_MAX_NOF_TRANS_CMDS+1
 Identifier for transition command "Reset" in the OutStream State Machine.
 

Typedefs

typedef int CrFwBool_t
 Type used for boolean values (1 represent "true" and 0 represents "false").
 
typedef unsigned short CrFwCmdRepIndex_t
 Type for the index of a command or report in the InRegistry or OutRegistry.
 
typedef unsigned char * CrFwPckt_t
 Type for packets (see CrFwPckt.h). More...
 
typedef void(* CrFwInRepUpdateAction_t) (FwPrDesc_t)
 Type for a pointer to a function implementing the Update Action Operation for an InReport. More...
 
typedef CrFwBool_t(* CrFwInRepValidityCheck_t) (FwPrDesc_t)
 Type for a pointer to a function implementing the Validity Check Operation for an InReport. More...
 
typedef CrFwBool_t(* CrFwInCmdValidityCheck_t) (FwPrDesc_t)
 Type for a pointer to a function implementing the Validity Check Operation for an InCommand. More...
 
typedef CrFwBool_t(* CrFwInCmdReadyCheck_t) (FwSmDesc_t)
 Type for a pointer to a function implementing the Ready Check Operation for an InCommand. More...
 
typedef void(* CrFwInCmdStartAction_t) (FwSmDesc_t)
 Type for a pointer to a function implementing the Start Action Operation for an InCommand. More...
 
typedef void(* CrFwInCmdProgressAction_t) (FwSmDesc_t)
 Type for a pointer to a function implementing the Progress Action Operation for an InCommand. More...
 
typedef void(* CrFwInCmdTerminationAction_t) (FwSmDesc_t)
 Type for a pointer to a function implementing the Termination Action Operation for an InCommand. More...
 
typedef void(* CrFwInCmdAbortAction_t) (FwSmDesc_t)
 Type for a pointer to a function implementing the Abort Action Operation for an InCommand. More...
 
typedef CrFwBool_t(* CrFwOutCmpEnableCheck_t) (FwSmDesc_t)
 Type for a pointer to a function implementing the Enable Check Operation for an OutComponent. More...
 
typedef CrFwBool_t(* CrFwOutCmpReadyCheck_t) (FwSmDesc_t)
 Type for a pointer to a function implementing the Ready Check Operation for an OutComponent. More...
 
typedef CrFwBool_t(* CrFwOutCmpRepeatCheck_t) (FwSmDesc_t)
 Type for a pointer to a function implementing the Repeat Check Operation for an OutComponent. More...
 
typedef void(* CrFwOutCmpUpdate_t) (FwSmDesc_t)
 Type for a pointer to a function implementing the Update Operation for an OutComponent. More...
 
typedef void(* CrFwOutCmpSerialize_t) (FwSmDesc_t)
 Type for a pointer to a function implementing the Serialize Operation for an OutComponent. More...
 
typedef CrFwPckt_t(* CrFwPcktCollect_t) (CrFwDestSrc_t, CrFwDestSrc_t *)
 Type for a pointer to a function implementing the Packet Collect Operation of an InStream. More...
 
typedef CrFwBool_t(* CrFwPcktAvailCheck_t) (CrFwDestSrc_t, CrFwDestSrc_t *)
 Type for a pointer to a function implementing the Packet Available Check Operation of an InStream. More...
 
typedef CrFwBool_t(* CrFwPcktHandover_t) (CrFwPckt_t pckt)
 Type for a pointer to a function implementing the Packet Hand-Over Operation of an OutStream. More...
 
typedef void(* CrFwSetDst_t) (CrFwCounterU2_t *nofTypeCounter, CrFwDestTypeKey_t **destTypeKey)
 Type for a pointer to a function implement the Set DTS operation of an OutStream. More...
 
typedef struct CrFwPcktQueueCrFwPcktQueue_t
 Type used in the framework to represent a packet queue.
 
typedef struct InManagerData CrFwInManagerData_t
 Type for the data describing an InManager.
 
typedef struct OutManagerData CrFwOutManagerData_t
 Type for the data describing an OutManager.
 
typedef struct InLoaderData CrFwInLoaderData_t
 Type for the data describing an InLoader.
 
typedef struct InStreamData CrFwInStreamData_t
 Type for the data describing an InStream.
 
typedef struct OutStreamData CrFwOutStreamData_t
 Type for the data describing an OutStream.
 
typedef struct InCmdData CrFwInCmdData_t
 Type for the data describing an InCommand.
 
typedef struct InRepData CrFwInRepData_t
 Type for the data describing an InReport.
 
typedef struct OutCmpData CrFwOutCmpData_t
 Type for the data describing an OutComponent.
 

Enumerations

enum  CrFwCmdRepType_t { crCmdType = 1 , crRepType = 2 }
 Enumerated type for command and reports. More...
 

Detailed Description

Header file to define all invariant publicly available constants and types for the CORDET Framework.

The invariant constants and types are those which are not intended to be modified by the user during the framework instantiation process. User-configurable constant and types are defined in CrFwUserConstants.h.

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 CrFwConstants.h.

Typedef Documentation

◆ CrFwInCmdAbortAction_t

typedef void(* CrFwInCmdAbortAction_t) (FwSmDesc_t)

Type for a pointer to a function implementing the Abort Action Operation for an InCommand.

The Abort Action Operation is one of the adaptation points of the framework. A function which implements this operation takes the InCommand descriptor as an argument and returns void.

Definition at line 193 of file CrFwConstants.h.

◆ CrFwInCmdProgressAction_t

typedef void(* CrFwInCmdProgressAction_t) (FwSmDesc_t)

Type for a pointer to a function implementing the Progress Action Operation for an InCommand.

The Progress Action Operation is one of the adaptation points of the framework. A function which implements this operation takes the InCommand descriptor as an argument and returns void.

The Progress Action has two outcomes: the Completion Outcome and the Success Outcome. The Completion Outcome is a boolean which indicates whether the progress action is "completed" (to signify that no more executions of the Progress Action are needed) or "not completed" (to signify that the Progress Action must be executed again). The Completion Outcome of an InCommand is accessed with functions CrFwInCmdSetProgressActionCompleted and CrFwInCmdIsProgressActionCompleted.

The success outcome is either '1' (to signify that the execution of the progress step has been successful), or an integer different from '1' (to signify that the progress step failed – in this case the outcome is a code which identifies the reason for the failure). The success outcome of an InCommand is accessed with functions CrFwSetSmOutcome and CrFwGetSmOutcome.

Definition at line 168 of file CrFwConstants.h.

◆ CrFwInCmdReadyCheck_t

typedef CrFwBool_t(* CrFwInCmdReadyCheck_t) (FwSmDesc_t)

Type for a pointer to a function implementing the Ready Check Operation for an InCommand.

The Ready Check Operation is one of the adaptation points of the framework. A function which implements this operation takes the InCommand descriptor as an argument and returns true if the command is ready to start execution and false otherwise.

Definition at line 127 of file CrFwConstants.h.

◆ CrFwInCmdStartAction_t

typedef void(* CrFwInCmdStartAction_t) (FwSmDesc_t)

Type for a pointer to a function implementing the Start Action Operation for an InCommand.

The Start Action Operation is one of the adaptation points of the framework. A function which implements this operation takes the InCommand descriptor as an argument and returns void. The Start Action has an outcome which it records in field outcome of CrFwCmpData_t. The outcome is either '1' (to signify that the action was successful) or an integer different from '1' (to signify that the action failed – in this case the outcome is a code which identifies the reason for the failure). The success outcome of an InCommand is accessed with functions CrFwSetSmOutcome and CrFwGetSmOutcome.

Definition at line 143 of file CrFwConstants.h.

◆ CrFwInCmdTerminationAction_t

typedef void(* CrFwInCmdTerminationAction_t) (FwSmDesc_t)

Type for a pointer to a function implementing the Termination Action Operation for an InCommand.

The Termination Action Operation is one of the adaptation points of the framework. A function which implements this operation takes the InCommand descriptor as an argument and returns void. The Termination Action has an outcome which it records in field outcome of CrFwCmpData_t. The outcome is either '1' (to signify that the action was successful) or an integer different from '1' (to signify that the action failed – in this case the outcome is a code which identifies the reason for the failure). The success outcome of an InCommand is accessed with functions CrFwSetSmOutcome and CrFwGetSmOutcome.

Definition at line 184 of file CrFwConstants.h.

◆ CrFwInCmdValidityCheck_t

typedef CrFwBool_t(* CrFwInCmdValidityCheck_t) (FwPrDesc_t)

Type for a pointer to a function implementing the Validity Check Operation for an InCommand.

The Validity Check Operation is one of the adaptation points of the framework. This operation is executed when the InCommand is reset. It determines whether the InCommand reset was successful or not (see CrFwInCmdConfigCheck). A default implementation for the validity check of an InCommand is provided by function CrFwInCmdDefValidityCheck. Another default implementation which is guaranteed to always return 'InCommand Valid' is provided by function CrFwPrCheckAlwaysTrue.

A function which implements this operation takes as argument the descriptor of the InCommand's reset procedure and returns true if the data in the InCommand packet are valid and returns false otherwise. The packet holding the InCommand can be retrieved as follows from the descriptor of the InCommand's Reset Procedure prDesc:

    CrFwCmpData_t* cmpData = FwPrGetData(prDesc);
    CrFwInCmdData_t* inCmdData = (CrFwInCmdData_t*)(cmpData->cmpSpecificData);
    CrFwPckt_t pckt = inCmdData->pckt;

Alternatively, the packet can also be retrieved using function CrFwInCmdGetPcktFromPrDesc.

Definition at line 117 of file CrFwConstants.h.

◆ CrFwInRepUpdateAction_t

typedef void(* CrFwInRepUpdateAction_t) (FwPrDesc_t)

Type for a pointer to a function implementing the Update Action Operation for an InReport.

The Update Action Operation is one of the adaptation points of the framework. A function which implements this operation takes the descriptor of the Execution Procedure of the InReport as an argument and returns void.

The packet holding the InReport can be retrieved as follows from the Execution Procedure descriptor prDesc:

    CrFwCmpData_t* cmpData = FwPrGetData(prDesc);
    CrFwInRepData_t* inRepData = (CrFwInRepData_t*)(cmpData->cmpSpecificData);
    CrFwPckt_t pckt = inRepData->pckt;

Definition at line 63 of file CrFwConstants.h.

◆ CrFwInRepValidityCheck_t

typedef CrFwBool_t(* CrFwInRepValidityCheck_t) (FwPrDesc_t)

Type for a pointer to a function implementing the Validity Check Operation for an InReport.

The Validity Check Operation is one of the adaptation points of the framework. The Validity Check Operation is called when an InReport is reset (i.e. it is called from the Reset Procedure of the InReport). It returns true if the data in the InReport are valid and false otherwise.

Function CrFwInRepDefValidityCheck provides a default implementation for the InReport validity check. Another default is provided by function CrFwPrCheckAlwaysTrue which implements a validity check which always returns true.

A function which implements this operation takes the descriptor of the Reset Procedure of the InReport as an argument and returns true if the data in the InReport packet are valid and returns false otherwise.

The packet holding the InReport can be retrieved as follows from the Execution Procedure descriptor prDesc:

    CrFwCmpData_t* cmpData = FwPrGetData(prDesc);
    CrFwInRepData_t* inRepData = (CrFwInRepData_t*)(cmpData->cmpSpecificData);
    CrFwPckt_t pckt = inRepData->pckt;

Definition at line 90 of file CrFwConstants.h.

◆ CrFwOutCmpEnableCheck_t

typedef CrFwBool_t(* CrFwOutCmpEnableCheck_t) (FwSmDesc_t)

Type for a pointer to a function implementing the Enable Check Operation for an OutComponent.

The Enable Check Operation is one of the adaptation points of the framework. A function which implements this operation takes the OutComponent descriptor as an argument and returns true if the packet encapsulated by the OutComponent is enabled and false otherwise.

Definition at line 203 of file CrFwConstants.h.

◆ CrFwOutCmpReadyCheck_t

typedef CrFwBool_t(* CrFwOutCmpReadyCheck_t) (FwSmDesc_t)

Type for a pointer to a function implementing the Ready Check Operation for an OutComponent.

The Ready Check Operation is one of the adaptation points of the framework. A function which implements this operation takes the OutComponent descriptor as an argument and returns true if the packet encapsulated by the OutComponent is ready to be sent out and false otherwise.

Definition at line 213 of file CrFwConstants.h.

◆ CrFwOutCmpRepeatCheck_t

typedef CrFwBool_t(* CrFwOutCmpRepeatCheck_t) (FwSmDesc_t)

Type for a pointer to a function implementing the Repeat Check Operation for an OutComponent.

The Repeat Check Operation is one of the adaptation points of the framework. A function which implements this operation takes the OutComponent descriptor as an argument and returns true if the OutComponent must be sent to its destination again and false otherwise.

Definition at line 223 of file CrFwConstants.h.

◆ CrFwOutCmpSerialize_t

typedef void(* CrFwOutCmpSerialize_t) (FwSmDesc_t)

Type for a pointer to a function implementing the Serialize Operation for an OutComponent.

This operation serializes the OutComponent to the packet associated to the OutComponent (see CrFwOutCmpData_t). A function which implements this operation takes the OutComponent descriptor as an argument and returns void.

Definition at line 244 of file CrFwConstants.h.

◆ CrFwOutCmpUpdate_t

typedef void(* CrFwOutCmpUpdate_t) (FwSmDesc_t)

Type for a pointer to a function implementing the Update Operation for an OutComponent.

This operation is one of the adaptation points of the framework. The operation updates the data which the OutComponent must carry to its destination. A function which implements this operation takes the OutComponent descriptor as an argument and returns void.

Definition at line 234 of file CrFwConstants.h.

◆ CrFwPckt_t

typedef unsigned char* CrFwPckt_t

Type for packets (see CrFwPckt.h).

Packets are treated as arrays of bytes.

Definition at line 38 of file CrFwConstants.h.

◆ CrFwPcktAvailCheck_t

typedef CrFwBool_t(* CrFwPcktAvailCheck_t) (CrFwDestSrc_t, CrFwDestSrc_t *)

Type for a pointer to a function implementing the Packet Available Check Operation of an InStream.

The Packet Available Check Operation is one of the adaptation points of the framework. A function which implements this operation takes the packet sources attached to an inStream and returns 1 if a new packet is available at the middleware interface from one of the inStream's sources or 0 if no packet is available. A return value of 1 implies that a call to the Packet Collect Operation will return at least one packet.

The packet sources attached to an inStream are passed to the function through two arguments representing: the number N of packet sources attached to the inStream and the array holding the N packet sources. The array must be allocated by the caller.

Definition at line 283 of file CrFwConstants.h.

◆ CrFwPcktCollect_t

typedef CrFwPckt_t(* CrFwPcktCollect_t) (CrFwDestSrc_t, CrFwDestSrc_t *)

Type for a pointer to a function implementing the Packet Collect Operation of an InStream.

The Packet Collect Operation is one of the adaptation points of the framework. A function which implements this operation takes the packet sources attached to an inStream as its argument and returns a packet collected from the middleware interface associated to the packet sources or NULL if no packet could be collected. The packet returned by this function must be created through function CrFwPcktMake (release of the packet is the responsibility of the user of the InStream).

The packet sources attached to an inStream are passed to the function through two arguments representing: the number N of packet sources attached to the inStream and the array holding the N packet sources. The array must be allocated by the caller.

If there is a need to verify whether a packet is available for collection through the Packet Collect Operation, this can be done using the Packet Available Check Operation.

Definition at line 266 of file CrFwConstants.h.

◆ CrFwPcktHandover_t

typedef CrFwBool_t(* CrFwPcktHandover_t) (CrFwPckt_t pckt)

Type for a pointer to a function implementing the Packet Hand-Over Operation of an OutStream.

The Packet Hand-Over Operation is one of the adaptation points of the framework. A function which implements this operation takes the packet to be handed over to the middleware as an argument and returns either 1 if the hand-over was successful or 0 if the hand-over failed.

The function must not modify the content of the packet. The argument of the function is a pointer to the packet. This pointer is "owned" by the caller and the function should not use it after it has returned.

Definition at line 298 of file CrFwConstants.h.

◆ CrFwSetDst_t

typedef void(* CrFwSetDst_t) (CrFwCounterU2_t *nofTypeCounter, CrFwDestTypeKey_t **destTypeKey)

Type for a pointer to a function implement the Set DTS operation of an OutStream.

The Set DTS operation is one of the adaptation points of the framwork. It Set DTS operation computes the set of triplets (destination, type, sub-type) for which the application OutStreams and must maintain the type counters.

A Set DTS Function returns:

  • The number of type counters to be managed by the OutStreams
  • The array of destination-type keys for which type counters must be maintained

A destination-type key is an unsigned integer obtained as the product of: t*s_max*d_max + s*d_max + d, where d, t, and s are a destination identifier, a service type identifier and a service sub-type identifier for which a type counter is maintained by the OutStreams and d_max and s_max are the maximum value of d and s (as given by constants CR_FW_MAX_DEST and CR_FW_MAX_SERV_SUBTYPE).

The entries in the array returned by the Set DTS Function are arranged in increasing order. The memory for the array is allocated by the Set DST function.

A defaul value for this function is provided by CrFwOutStreamDefSetDTS.

Definition at line 324 of file CrFwConstants.h.

Enumeration Type Documentation

◆ CrFwCmdRepType_t

Enumerated type for command and reports.

Enumerator
crCmdType 

Command type.

crRepType 

Report type.

Definition at line 41 of file CrFwConstants.h.

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