CORDET Framework - C2 Implementation
CrFwOutCmp.c File Reference

Implementation of OutComponent component. More...

Go to the source code of this file.

Functions

void LoadedToCpsTransAction (FwSmDesc_t smDesc)
 Transition action on the transition out of the LOADED state. More...
 
void PendingDoAction (FwSmDesc_t smDesc)
 Do action of the PENDING state (including behaviour of Send Packet Procedure). More...
 
void PendingEntryAction (FwSmDesc_t smDesc)
 Entry action of the SENDING state (including behaviour of Send Packet Procedure). More...
 
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...
 
CrFwServType_t CrFwOutCmpGetServType (FwSmDesc_t smDesc)
 Return the type of the OutComponent. More...
 
CrFwDestSrc_t CrFwOutCmpGetSrc (FwSmDesc_t smDesc)
 Return the source 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...
 

Variables

static FwSmDesc_t baseOutCmpSmDesc = NULL
 Base OutComponent from which all other OutComponents are derived.
 

Detailed Description

Implementation of OutComponent component.

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

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.

◆ LoadedToCpsTransAction()

void LoadedToCpsTransAction ( FwSmDesc_t  smDesc)

Transition action on the transition out of the LOADED state.

This transition action executes the enable check and then sets the outcome as follows:

  • if the enable check returns "not enabled", the outcome is set to 0
  • if the enable check returns "enabled" the outcome is set to 1

The setting of the isRepeat flag is not done in this function. This flag will only be evaluated after the Repeat Check is performed and there is therefore no need to set it here.

Parameters
smDescthe descriptor of the OutComponent state machine

Definition at line 302 of file CrFwOutCmp.c.

◆ PendingDoAction()

void PendingDoAction ( FwSmDesc_t  smDesc)

Do action of the PENDING state (including behaviour of Send Packet Procedure).

The outcome of the Repeat Check and of the Enable Check are stored in the outcome field of the component data as follows:

  • If the Enable Check reports 'Not Enabled', the outcome is set to zero
  • If the Enable Check reports 'Enabled' and the Repeat Check reports 'No Repeat', the outcome is set to 2
  • In all other cases, the outcome is set to 1.

In order to understand why the logic in this function is equivalent to that of the specification, consider the outcome of executing and terminating the OutComponent for all possible values of the Ready Check, Repeat Check, Enable Check and validity statuses of the OutComponent's destination:

  • isReady==true, isRepeat==true, isEnabled==true, dest. is valid --> PENDING, outcome=1
  • isReady=='any', isRepeat=='any', isEnabled==false, dest. is 'any' --> ABORTED, outcome=0
  • isReady==true, isRepeat==false, isEnabled==true, dest. is valid --> TERMINATED, outcome=2
  • isReady==true, isRepeat=='any', isEnabled==true, dest. is false --> TERMINATED, outcome=2
  • isReady==false, isRepeat=='any', isEnabled==true, dest. is 'any' --> PENDING, outcome=1
Parameters
smDescthe descriptor of the OutComponent state machine

Definition at line 340 of file CrFwOutCmp.c.

◆ PendingEntryAction()

void PendingEntryAction ( FwSmDesc_t  smDesc)

Entry action of the SENDING state (including behaviour of Send Packet Procedure).

The outcome of the Repeat Check is stored in the outcome field of the component data (a value of '1' corresponds to: 'Repeat' and a value of '2' corresponds to: 'No Repeat').

In order to understand why the logic in this function is equivalent to that of the specification, consider the outcome of executing and terminating the OutComponent for all possible for all possible values of the Ready Check, Repeat Check, and validity statuses of the OutComponent's destination (recall that isRepeat and isEnabled are guaranteed to be true at entry):

  • isReady==true, isRepeat==true, dest. is valid --> PENDING, outcome=1
  • isReady==true, isRepeat==false, dest. is valid --> TERMINATED, outcome=2
  • isReady==false, isRepeat=='any', dest. is 'any' --> PENDING, outcome=1
  • isReady==true, isRepeat=='any', dest. is not valid --> TERMINATED, outcome=2
Parameters
smDescthe descriptor of the OutComponent state machine

Definition at line 310 of file CrFwOutCmp.c.

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