CORDET Framework - C2 Implementation
|
Implementation of InManager State Machine. More...
Go to the source code of this file.
Functions | |
static void | InManagerInitAction (FwPrDesc_t initPr) |
Initialization action for InManagers. More... | |
static void | InManagerConfigAction (FwPrDesc_t initPr) |
Configuration action for InManagers. More... | |
static void | InManagerShutdownAction (FwSmDesc_t smDesc) |
Shutdown action for InManager. More... | |
static void | InManagerExecAction (FwPrDesc_t execPr) |
Implement the logic of the Execution Procedure (see figure below). More... | |
FwSmDesc_t | CrFwInManagerMake (CrFwInstanceId_t i) |
Factory function to retrieve the i-th InManager State Machine instance. More... | |
CrFwBool_t | CrFwInManagerLoad (FwSmDesc_t smDesc, FwSmDesc_t inCmp) |
Load a new InReport or InCommand into the InManager. More... | |
CrFwCounterU1_t | CrFwInManagerGetNOfPendingInCmp (FwSmDesc_t smDesc) |
Return the number of InReport or InCommands currently in the PCRL of an InManager. More... | |
CrFwCounterU2_t | CrFwInManagerGetNOfLoadedInCmp (FwSmDesc_t smDesc) |
Return the number of InReport or InCommands successfully loaded since the InManager was last reset. More... | |
CrFwCounterU1_t | CrFwInManagerGetPCRLSize (FwSmDesc_t smDesc) |
Return the size of the PCRL of an InManager. More... | |
Variables | |
static CrFwCounterU2_t | inManagerPcrlSize [CR_FW_NOF_INMANAGER] = CR_FW_INMANAGER_PCRLSIZE |
The sizes of the PCRL in the InManager components. More... | |
static FwSmDesc_t | inManagerDesc [CR_FW_NOF_INMANAGER] |
The descriptors of the InManager State Machines. More... | |
static CrFwCmpData_t | inManagerData [CR_FW_NOF_INMANAGER] |
The data structures for the InManager State Machines and their Procedures. More... | |
static CrFwInManagerData_t | inManagerCmpSpecificData [CR_FW_NOF_INMANAGER] |
The component-specific data for the InManager instances. | |
Implementation of InManager State Machine.
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 CrFwInManager.c.
CrFwCounterU2_t CrFwInManagerGetNOfLoadedInCmp | ( | FwSmDesc_t | smDesc | ) |
Return the number of InReport or InCommands successfully loaded since the InManager was last reset.
smDesc | the descriptor of the InManager State Machine. |
Definition at line 301 of file CrFwInManager.c.
CrFwCounterU1_t CrFwInManagerGetNOfPendingInCmp | ( | FwSmDesc_t | smDesc | ) |
Return the number of InReport or InCommands currently in the PCRL of an InManager.
smDesc | the descriptor of the InManager State Machine. |
Definition at line 294 of file CrFwInManager.c.
CrFwCounterU1_t CrFwInManagerGetPCRLSize | ( | FwSmDesc_t | smDesc | ) |
Return the size of the PCRL of an InManager.
smDesc | the descriptor of the InManager State Machine. |
Definition at line 308 of file CrFwInManager.c.
CrFwBool_t CrFwInManagerLoad | ( | FwSmDesc_t | smDesc, |
FwSmDesc_t | inCmp | ||
) |
Load a new InReport or InCommand into the InManager.
The behaviour implemented by this function is shown in the activity diagram below. If the PCRL is not full, the function identifies a free position in the PCRL where to store the InReport/InCommand. This function adds InReport/InCommand to the PCRL. The PCRL is flushed when the InManager is executed (i.e. it is flushed by function InManagerExecAction
). The algorithms to identify a free position in the PCRL and to process the PCRL entries when the InManager is executed are optimized for a situation where multiple load operations are performed before the InManager is executed.
Additionally, these algorithms guarantee the following ordering constraint. Let InReports/InCommands C1 to Cn be successfully loaded into an InManager through a sequence of calls to function CrFwInManagerLoad
and assume that this sequence of load operations is not interrupted by an execution of the InManager. Under these conditions, when the InManager is executed next, the InReport/InCommand C1 to Cn will be processed in the order in which they have been loaded.
The implementation of function CrFwInManagerLoad
is based on the internal variable freePos
. This variable has the following characteristics:
freePos
either points to the next free position in the PCRL or is equal to the PCRL size if the PCRL is full;smDesc | the descriptor of the InManager State Machine. |
inCmp | the descriptor of the InCommand or InReport to be loaded in the InManager |
Definition at line 189 of file CrFwInManager.c.
FwSmDesc_t CrFwInManagerMake | ( | CrFwInstanceId_t | inManagerId | ) |
Factory function to retrieve the i-th InManager State Machine instance.
The first time this function is called with a certain value of the argument i, it creates the i-th InManager State Machine instance. Subsequent calls returns the same instance.
The InManager identifier i must be in the range: [0, CR_FW_NOF_INMANAGER
-1]. If the identifier is out of range, the function returns NULL and sets the application error code to: crInManagerIllId
.
The first time this function is called with a certain value of i, it returns an InManager State Machine which has been started but which still needs to be initialized and configured.
inManagerId | the identifier of the InManager |
Definition at line 96 of file CrFwInManager.c.
|
static |
Configuration action for InManagers.
This function resets the PCRL, releases all InCommands and InReports in the PCRL and resets the counter of successfully loaded InReports or InCommands. The outcome of the initialization action is always: "success"
initPr | the Initialization Procedure of the InManager |
Definition at line 248 of file CrFwInManager.c.
|
static |
Implement the logic of the Execution Procedure (see figure below).
This function is executed every time the Execution Procedure of the InManager is executed.
execPr | the Execution Procedure of the InManager |
Definition at line 148 of file CrFwInManager.c.
|
static |
Initialization action for InManagers.
This function allocates the memory for the InManager data structures and initializes them. The outcome of the initialization action is always "success" (the situation where the memory allocation fails is not handled).
initPr | the Initialization Procedure of the InManager |
Definition at line 235 of file CrFwInManager.c.
|
static |
Shutdown action for InManager.
This function resets the PCRL and releases all InCommands and InReports in the PCRL.
smDesc | the InManager state machine |
Definition at line 272 of file CrFwInManager.c.
|
static |
The data structures for the InManager State Machines and their Procedures.
Definition at line 55 of file CrFwInManager.c.
|
static |
The descriptors of the InManager State Machines.
Definition at line 52 of file CrFwInManager.c.
|
static |
The sizes of the PCRL in the InManager components.
Definition at line 49 of file CrFwInManager.c.