CORDET Framework - C2 Implementation

Definition of the OutComponent Component of the framework. More...

Go to the source code of this file.

Functions

FwSmDesc_t CrFwOutCmpMakeBase ()
 Return the base OutComponent from which all other OutComponents are derived. More...
 
void CrFwOutCmpTerminate (FwSmDesc_t smDesc)
 Send command Terminate to the argument OutComponent. More...
 
CrFwBool_t CrFwOutCmpIsInLoaded (FwSmDesc_t smDesc)
 Return true if the argument OutComponent is in state LOADED. More...
 
CrFwBool_t CrFwOutCmpIsInAborted (FwSmDesc_t smDesc)
 Return true if the argument OutComponent is in state ABORTED. More...
 
CrFwBool_t CrFwOutCmpIsInPending (FwSmDesc_t smDesc)
 Return true if the argument OutComponent is in state PENDING. More...
 
CrFwBool_t CrFwOutCmpIsInTerminated (FwSmDesc_t smDesc)
 Return true if the argument OutComponent is in state TERMINATED. More...
 
CrFwBool_t CrFwOutCmpDefEnableCheck (FwSmDesc_t smDesc)
 Default implementation of the Enable Check Operation for an OutComponent. More...
 
void CrFwOutCmpDefSerialize (FwSmDesc_t smDesc)
 Default implementation of the Serialize Operation for an OutComponent. More...
 
CrFwDestSrc_t CrFwOutCmpGetDest (FwSmDesc_t smDesc)
 Return the destination of the OutComponent. More...
 
void CrFwOutCmpSetDest (FwSmDesc_t smDesc, CrFwDestSrc_t dest)
 Set the destination of the OutComponent. More...
 
CrFwGroup_t CrFwOutCmpGetGroup (FwSmDesc_t smDesc)
 Return the group of the OutComponent. More...
 
void CrFwOutCmpSetGroup (FwSmDesc_t smDesc, CrFwGroup_t group)
 Set the group of the OutComponent. More...
 
CrFwTimeStamp_t CrFwOutCmpGetTimeStamp (FwSmDesc_t smDesc)
 Return the time stamp attribute of the OutComponent. More...
 
void CrFwOutCmpSetTimeStamp (FwSmDesc_t smDesc, CrFwTimeStamp_t timeStamp)
 Set the time stamp attribute of the OutComponent. More...
 
CrFwDestSrc_t CrFwOutCmpGetSrc (FwSmDesc_t smDesc)
 Return the source of the OutComponent. More...
 
CrFwServType_t CrFwOutCmpGetServType (FwSmDesc_t smDesc)
 Return the type of the OutComponent. More...
 
CrFwServType_t CrFwOutCmpGetServSubType (FwSmDesc_t smDesc)
 Return the sub-type of the OutComponent. More...
 
CrFwDiscriminant_t CrFwOutCmpGetDiscriminant (FwSmDesc_t smDesc)
 Return the discriminant of the OutComponent. More...
 
void CrFwOutCmpSetDiscriminant (FwSmDesc_t smDesc, CrFwDiscriminant_t discriminant)
 Set the discriminant of the OutComponent. More...
 
void CrFwOutCmpSetAckLevel (FwSmDesc_t smDesc, CrFwBool_t accept, CrFwBool_t start, CrFwBool_t progress, CrFwBool_t term)
 Set the acknowledge level for the command encapsulated in the OutComponent. More...
 
CrFwBool_t CrFwOutCmpIsAcceptAck (FwSmDesc_t smDesc)
 Return the acknowledge level for command acceptance for the command encapsulated in the OutComponent. More...
 
CrFwBool_t CrFwOutCmpIsStartAck (FwSmDesc_t smDesc)
 Return the acknowledge level for command start for the command encapsulated in the OutComponent. More...
 
CrFwBool_t CrFwOutCmpIsProgressAck (FwSmDesc_t smDesc)
 Return the acknowledge level for command progress for the command encapsulated in the OutComponent. More...
 
CrFwBool_t CrFwOutCmpIsTermAck (FwSmDesc_t smDesc)
 Return the acknowledge level for command termination for the command encapsulated in the OutComponent. More...
 
CrFwPckt_t CrFwOutCmpGetParStart (FwSmDesc_t smDesc)
 Return the start address of the parameter area of the OutComponent. More...
 
CrFwPcktLength_t CrFwOutCmpGetParLength (FwSmDesc_t smDesc)
 Return the length in bytes of the parameter area of the OutComponent. More...
 
CrFwPcktLength_t CrFwOutCmpGetLength (FwSmDesc_t smDesc)
 Return the length in bytes of the packet to which the OutComponent is serialized. More...
 
CrFwPckt_t CrFwOutCmpGetPckt (FwSmDesc_t smDesc)
 Return the pointer to the packet which holds the OutComponent. More...
 

Detailed Description

Definition of the OutComponent Component of the framework.

An OutComponent encapsulates an out-going command or an out-going report. The OutComponent is responsible for serializing the out-going command or report to a packet and sending the packet to an OutStream for dispatching to its destination. The behaviour of an OutComponent is defined by the OutComponent State Machine embedded in the CONFIGURED state of the Base State Machine and by the Send Packet Procedure (see figures below).

Mode of Use of an OutComponent Component

Applications create OutComponents dynamically through calls to the factory function CrFwOutFactoryMakeOutCmp. OutComponents thus returned are expected to be in state CREATED (if this is not the case - perhaps because the OutComponent's configuration action has failed to complete successfully - the OutComponent will remain permanently pending and will never be sent to its destination).

An OutComponent is used to encapsulate an out-going command or report of a certain kind. The "kind" of an out-going command or report is defined by the triplet: [service type, service sub-type, discriminant]. OutComponents are adapted to a certain kind of out-going report or command by modifying one or more of the following:

  • The Enable Check Operation
  • The Ready Check Operation
  • The Repeat Check Operation
  • The Update Action Operation
  • The Serialize Operation

These operations are statically defined for each kind of OutComponent in CrFwOutFactoryUserPar.h.

This header file defines default values for all configurable operations listed above. The default implementations for the Enable Check, Ready Check and Repeat Check will often be suitable for many kinds of out-going reports or commands but dedicated implementations of the Serialize and Update Action will probably have to be provided for application-specific out-going reports or commands.

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

Function Documentation

◆ CrFwOutCmpDefEnableCheck()

CrFwBool_t CrFwOutCmpDefEnableCheck ( FwSmDesc_t  smDesc)

Default implementation of the Enable Check Operation for an OutComponent.

This function retrieves the enable status of the OutComponent from the OutRegistry (see CrFwOutRegistryIsEnabled).

This function should never be directly called by the end-application. It is declared as a public function so that it may be used in application-specific Enable Check Operations.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent.
Returns
1 if the OutComponent is enabled, 0 if it is not enabled.

Definition at line 168 of file CrFwOutCmp.c.

◆ CrFwOutCmpDefSerialize()

void CrFwOutCmpDefSerialize ( FwSmDesc_t  smDesc)

Default implementation of the Serialize Operation for an OutComponent.

This implementation writes to the packet encapsulated in the OutComponent all the following attributes of the out-going report or command:

  • The command or report identifier (this is set equal to the instance identifier of the OutComponent)

This function should never be directly called by the end-application. It is declared as a public function so that it may be used in application-specific Serialize Operations.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent.

Definition at line 173 of file CrFwOutCmp.c.

◆ CrFwOutCmpGetDest()

CrFwDestSrc_t CrFwOutCmpGetDest ( FwSmDesc_t  smDesc)

Return the destination of the OutComponent.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent
Returns
the destination of the OutComponent

Definition at line 185 of file CrFwOutCmp.c.

◆ CrFwOutCmpGetDiscriminant()

CrFwDiscriminant_t CrFwOutCmpGetDiscriminant ( FwSmDesc_t  smDesc)

Return the discriminant of the OutComponent.

The discriminant of the OutComponent is set when the OutComponent is created by function CrFwOutFactoryMakeOutCmp but can subsequently be changed through function CrFwOutCmpSetDiscriminant.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent
Returns
the discriminant of the OutComponent

Definition at line 251 of file CrFwOutCmp.c.

◆ CrFwOutCmpGetGroup()

CrFwGroup_t CrFwOutCmpGetGroup ( FwSmDesc_t  smDesc)

Return the group of the OutComponent.

By default, the group of an OutComponent is set when the OutComponent is created by function CrFwOutFactoryMakeOutCmp but its value can be overridden with function CrFwOutCmpSetGroup.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent
Returns
the group of the OutComponent

Definition at line 200 of file CrFwOutCmp.c.

◆ CrFwOutCmpGetLength()

CrFwPcktLength_t CrFwOutCmpGetLength ( FwSmDesc_t  smDesc)

Return the length in bytes of the packet to which the OutComponent is serialized.

The length returned by this function covers both the packet header and the packet parameter area. The length of the packet parameter area is returned by function CrFwOutCmpGetParLength.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent
Returns
the length in bytes of the OutComponent packet

Definition at line 395 of file CrFwOutCmp.c.

◆ CrFwOutCmpGetParLength()

CrFwPcktLength_t CrFwOutCmpGetParLength ( FwSmDesc_t  smDesc)

Return the length in bytes of the parameter area of the OutComponent.

The OutComponent is encapsulated in a packet. The parameter area of the OutComponent is the part of the packet which is reserved to the storage of the parameters of the OutComponent. The parameter area consists of an uninterrupted sequence of bytes. The start address of the parameter area is returned by function CrFwOutCmpGetParStart.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent
Returns
the length in bytes of the OutComponent parameter area

Definition at line 388 of file CrFwOutCmp.c.

◆ CrFwOutCmpGetParStart()

CrFwPckt_t CrFwOutCmpGetParStart ( FwSmDesc_t  smDesc)

Return the start address of the parameter area of the OutComponent.

The OutComponent is encapsulated in a packet. The parameter area of the OutComponent is the part of the packet which is reserved to the storage of the parameters of the OutComponent. The parameter area consists of an uninterrupted sequence of bytes. The size of the parameter area is returned by function CrFwOutCmpGetParLength.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent
Returns
the start address of the OutComponent parameter area.

Definition at line 381 of file CrFwOutCmp.c.

◆ CrFwOutCmpGetPckt()

CrFwPckt_t CrFwOutCmpGetPckt ( FwSmDesc_t  smDesc)

Return the pointer to the packet which holds the OutComponent.

The OutComponent is encapsulated in a packet. This function returns this packet. The packet is only initialized if the OutComponent has been correctly configured. This is normally the case if the OutComponent has been successfully returned by the OutFactory. The length of the packet is stored in the packet itself and can be retrieved with function CrFwPcktGetLength.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent
Returns
the pointer to the packet holding the OutComponent.

Definition at line 402 of file CrFwOutCmp.c.

◆ CrFwOutCmpGetServSubType()

CrFwServType_t CrFwOutCmpGetServSubType ( FwSmDesc_t  smDesc)

Return the sub-type of the OutComponent.

The sub-type of the OutComponent is set when the OutComponent is created by function CrFwOutFactoryMakeOutCmp and cannot be changed afterwards.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent
Returns
the sub-type of the OutComponent

Definition at line 244 of file CrFwOutCmp.c.

◆ CrFwOutCmpGetServType()

CrFwServType_t CrFwOutCmpGetServType ( FwSmDesc_t  smDesc)

Return the type of the OutComponent.

The type of the OutComponent is set when the OutComponent is created by function CrFwOutFactoryMakeOutCmp and cannot be changed afterwards.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent
Returns
the type of the OutComponent

Definition at line 230 of file CrFwOutCmp.c.

◆ CrFwOutCmpGetSrc()

CrFwDestSrc_t CrFwOutCmpGetSrc ( FwSmDesc_t  smDesc)

Return the source of the OutComponent.

The source of the OutComponent is set when the OutComponent is created by function CrFwOutFactoryMakeOutCmp and cannot be changed afterwards.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent
Returns
the source of the OutComponent

Definition at line 237 of file CrFwOutCmp.c.

◆ CrFwOutCmpGetTimeStamp()

CrFwTimeStamp_t CrFwOutCmpGetTimeStamp ( FwSmDesc_t  smDesc)

Return the time stamp attribute of the OutComponent.

By default, the time stamp is set when the OutComponent is loaded into the OutLoader (see CrFwOutLoaderLoad) but its value can be overridden with function CrFwOutCmpSetTimeStamp.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent
Returns
the time stamp attribute of the OutComponent

Definition at line 215 of file CrFwOutCmp.c.

◆ CrFwOutCmpIsAcceptAck()

CrFwBool_t CrFwOutCmpIsAcceptAck ( FwSmDesc_t  smDesc)

Return the acknowledge level for command acceptance for the command encapsulated in the OutComponent.

If the OutComponent does not hold a command, the behaviour of the function is undefined.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent.
Returns
1 if command acceptance is to be acknowledged, 0 otherwise.

Definition at line 274 of file CrFwOutCmp.c.

◆ CrFwOutCmpIsInAborted()

CrFwBool_t CrFwOutCmpIsInAborted ( FwSmDesc_t  smDesc)

Return true if the argument OutComponent is in state ABORTED.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent
Returns
1 if the argument OutComponent is in state CONFIGURED, sub-state ABORTED; 0 otherwise

Definition at line 153 of file CrFwOutCmp.c.

◆ CrFwOutCmpIsInLoaded()

CrFwBool_t CrFwOutCmpIsInLoaded ( FwSmDesc_t  smDesc)

Return true if the argument OutComponent is in state LOADED.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent
Returns
1 if the argument OutComponent is in state CONFIGURED, sub-state LOADED; 0 otherwise

Definition at line 148 of file CrFwOutCmp.c.

◆ CrFwOutCmpIsInPending()

CrFwBool_t CrFwOutCmpIsInPending ( FwSmDesc_t  smDesc)

Return true if the argument OutComponent is in state PENDING.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent
Returns
1 if the argument OutComponent is in state CONFIGURED, sub-state PENDING; 0 otherwise

Definition at line 158 of file CrFwOutCmp.c.

◆ CrFwOutCmpIsInTerminated()

CrFwBool_t CrFwOutCmpIsInTerminated ( FwSmDesc_t  smDesc)

Return true if the argument OutComponent is in state TERMINATED.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent
Returns
1 if the argument OutComponent is in state CONFIGURED, sub-state TERMINATED; 0 otherwise

Definition at line 163 of file CrFwOutCmp.c.

◆ CrFwOutCmpIsProgressAck()

CrFwBool_t CrFwOutCmpIsProgressAck ( FwSmDesc_t  smDesc)

Return the acknowledge level for command progress for the command encapsulated in the OutComponent.

If the OutComponent does not hold a command, the behaviour of the function is undefined.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent.
Returns
1 if command progress is to be acknowledged, 0 otherwise.

Definition at line 288 of file CrFwOutCmp.c.

◆ CrFwOutCmpIsStartAck()

CrFwBool_t CrFwOutCmpIsStartAck ( FwSmDesc_t  smDesc)

Return the acknowledge level for command start for the command encapsulated in the OutComponent.

If the OutComponent does not hold a command, the behaviour of the function is undefined.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent.
Returns
1 if command start is to be acknowledged, 0 otherwise.

Definition at line 281 of file CrFwOutCmp.c.

◆ CrFwOutCmpIsTermAck()

CrFwBool_t CrFwOutCmpIsTermAck ( FwSmDesc_t  smDesc)

Return the acknowledge level for command termination for the command encapsulated in the OutComponent.

If the OutComponent does not hold a command, the behaviour of the function is undefined.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent.
Returns
1 if command termination is to be acknowledged, 0 otherwise.

Definition at line 295 of file CrFwOutCmp.c.

◆ CrFwOutCmpMakeBase()

FwSmDesc_t CrFwOutCmpMakeBase ( )

Return the base OutComponent from which all other OutComponents are derived.

The base OutComponent is a singleton. The first time it is called, this function creates and configures the base OutComponent instance. Subsequent calls return this same instance. This function is only intended to be used by the OutFactory (see CrFwOutFactory.h) and should not be used by applications.

Returns
the singleton instance of the base OutComponent

Definition at line 105 of file CrFwOutCmp.c.

◆ CrFwOutCmpSetAckLevel()

void CrFwOutCmpSetAckLevel ( FwSmDesc_t  smDesc,
CrFwBool_t  accept,
CrFwBool_t  start,
CrFwBool_t  progress,
CrFwBool_t  term 
)

Set the acknowledge level for the command encapsulated in the OutComponent.

This function should only be called on OutComponents which encapsulate an out-going command (but no check is performed that this is actually the case).

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent.
accept1 if acknowledge of command acceptance is desired, 0 otherwise.
start1 if acknowledge of command start is desired, 0 otherwise.
progress1 if acknowledge of command progress is desired, 0 otherwise.
term1 if acknowledge of command acceptance termination is desired, 0 otherwise.

Definition at line 265 of file CrFwOutCmp.c.

◆ CrFwOutCmpSetDest()

void CrFwOutCmpSetDest ( FwSmDesc_t  smDesc,
CrFwDestSrc_t  dest 
)

Set the destination of the OutComponent.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent
destthe destination of the OutComponent

Definition at line 192 of file CrFwOutCmp.c.

◆ CrFwOutCmpSetDiscriminant()

void CrFwOutCmpSetDiscriminant ( FwSmDesc_t  smDesc,
CrFwDiscriminant_t  discriminant 
)

Set the discriminant of the OutComponent.

The default value of the discriminant of the OutComponent is set when the OutComponent is created by function CrFwOutFactoryMakeOutCmp. This function allows this default value to be changed.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent
discriminantthe discriminant of the OutComponent

Definition at line 258 of file CrFwOutCmp.c.

◆ CrFwOutCmpSetGroup()

void CrFwOutCmpSetGroup ( FwSmDesc_t  smDesc,
CrFwGroup_t  group 
)

Set the group of the OutComponent.

By default, the group of an OutComponent is set when the OutComponent is created by function CrFwOutFactoryMakeOutCmp but its value can be overridden with this function.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent
groupthe group

Definition at line 207 of file CrFwOutCmp.c.

◆ CrFwOutCmpSetTimeStamp()

void CrFwOutCmpSetTimeStamp ( FwSmDesc_t  smDesc,
CrFwTimeStamp_t  timeStamp 
)

Set the time stamp attribute of the OutComponent.

By default, the time stamp is set when the OutComponent is loaded into the OutLoader (see CrFwOutLoaderLoad). This function can be used to override this default setting.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent
timeStampthe time stamp of the OutComponent

Definition at line 222 of file CrFwOutCmp.c.

◆ CrFwOutCmpTerminate()

void CrFwOutCmpTerminate ( FwSmDesc_t  smDesc)

Send command Terminate to the argument OutComponent.

Parameters
smDescthe descriptor of the Base State Machine of the OutComponent

Definition at line 143 of file CrFwOutCmp.c.

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