CORDET Framework - C2 Implementation
|
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. More... | |
Implementation of OutComponent component.
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.
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.
smDesc | the descriptor of the Base State Machine of the OutComponent. |
Definition at line 168 of file CrFwOutCmp.c.
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:
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.
smDesc | the descriptor of the Base State Machine of the OutComponent. |
Definition at line 173 of file CrFwOutCmp.c.
CrFwDestSrc_t CrFwOutCmpGetDest | ( | FwSmDesc_t | smDesc | ) |
Return the destination of the OutComponent.
smDesc | the descriptor of the Base State Machine of the OutComponent |
Definition at line 185 of file CrFwOutCmp.c.
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
.
smDesc | the descriptor of the Base State Machine of the OutComponent |
Definition at line 251 of file CrFwOutCmp.c.
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
.
smDesc | the descriptor of the Base State Machine of the OutComponent |
Definition at line 200 of file CrFwOutCmp.c.
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
.
smDesc | the descriptor of the Base State Machine of the OutComponent |
Definition at line 395 of file CrFwOutCmp.c.
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
.
smDesc | the descriptor of the Base State Machine of the OutComponent |
Definition at line 388 of file CrFwOutCmp.c.
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
.
smDesc | the descriptor of the Base State Machine of the OutComponent |
Definition at line 381 of file CrFwOutCmp.c.
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
.
smDesc | the descriptor of the Base State Machine of the OutComponent |
Definition at line 402 of file CrFwOutCmp.c.
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.
smDesc | the descriptor of the Base State Machine of the OutComponent |
Definition at line 244 of file CrFwOutCmp.c.
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.
smDesc | the descriptor of the Base State Machine of the OutComponent |
Definition at line 230 of file CrFwOutCmp.c.
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.
smDesc | the descriptor of the Base State Machine of the OutComponent |
Definition at line 237 of file CrFwOutCmp.c.
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
.
smDesc | the descriptor of the Base State Machine of the OutComponent |
Definition at line 215 of file CrFwOutCmp.c.
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.
smDesc | the descriptor of the Base State Machine of the OutComponent. |
Definition at line 274 of file CrFwOutCmp.c.
CrFwBool_t CrFwOutCmpIsInAborted | ( | FwSmDesc_t | smDesc | ) |
Return true if the argument OutComponent is in state ABORTED.
smDesc | the descriptor of the Base State Machine of the OutComponent |
Definition at line 153 of file CrFwOutCmp.c.
CrFwBool_t CrFwOutCmpIsInLoaded | ( | FwSmDesc_t | smDesc | ) |
Return true if the argument OutComponent is in state LOADED.
smDesc | the descriptor of the Base State Machine of the OutComponent |
Definition at line 148 of file CrFwOutCmp.c.
CrFwBool_t CrFwOutCmpIsInPending | ( | FwSmDesc_t | smDesc | ) |
Return true if the argument OutComponent is in state PENDING.
smDesc | the descriptor of the Base State Machine of the OutComponent |
Definition at line 158 of file CrFwOutCmp.c.
CrFwBool_t CrFwOutCmpIsInTerminated | ( | FwSmDesc_t | smDesc | ) |
Return true if the argument OutComponent is in state TERMINATED.
smDesc | the descriptor of the Base State Machine of the OutComponent |
Definition at line 163 of file CrFwOutCmp.c.
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.
smDesc | the descriptor of the Base State Machine of the OutComponent. |
Definition at line 288 of file CrFwOutCmp.c.
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.
smDesc | the descriptor of the Base State Machine of the OutComponent. |
Definition at line 281 of file CrFwOutCmp.c.
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.
smDesc | the descriptor of the Base State Machine of the OutComponent. |
Definition at line 295 of file CrFwOutCmp.c.
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.
Definition at line 105 of file CrFwOutCmp.c.
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).
smDesc | the descriptor of the Base State Machine of the OutComponent. |
accept | 1 if acknowledge of command acceptance is desired, 0 otherwise. |
start | 1 if acknowledge of command start is desired, 0 otherwise. |
progress | 1 if acknowledge of command progress is desired, 0 otherwise. |
term | 1 if acknowledge of command acceptance termination is desired, 0 otherwise. |
Definition at line 265 of file CrFwOutCmp.c.
void CrFwOutCmpSetDest | ( | FwSmDesc_t | smDesc, |
CrFwDestSrc_t | dest | ||
) |
Set the destination of the OutComponent.
smDesc | the descriptor of the Base State Machine of the OutComponent |
dest | the destination of the OutComponent |
Definition at line 192 of file CrFwOutCmp.c.
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.
smDesc | the descriptor of the Base State Machine of the OutComponent |
discriminant | the discriminant of the OutComponent |
Definition at line 258 of file CrFwOutCmp.c.
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.
smDesc | the descriptor of the Base State Machine of the OutComponent |
group | the group |
Definition at line 207 of file CrFwOutCmp.c.
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.
smDesc | the descriptor of the Base State Machine of the OutComponent |
timeStamp | the time stamp of the OutComponent |
Definition at line 222 of file CrFwOutCmp.c.
void CrFwOutCmpTerminate | ( | FwSmDesc_t | smDesc | ) |
Send command Terminate to the argument OutComponent.
smDesc | the descriptor of the Base State Machine of the OutComponent |
Definition at line 143 of file CrFwOutCmp.c.
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:
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.
smDesc | the descriptor of the OutComponent state machine |
Definition at line 302 of file CrFwOutCmp.c.
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:
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:
smDesc | the descriptor of the OutComponent state machine |
Definition at line 340 of file CrFwOutCmp.c.
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):
smDesc | the descriptor of the OutComponent state machine |
Definition at line 310 of file CrFwOutCmp.c.
|
static |
Base OutComponent from which all other OutComponents are derived.
Definition at line 43 of file CrFwOutCmp.c.