CORDET Framework - C2 Implementation
CrFwInRegistry.c File Reference

Implementation of InRegistry component. More...

Go to the source code of this file.

Data Structures

struct  CrFwTrackedState_t
 An instance of this type holds the information about an incoming command or report which is being tracked by the InRegistry. More...
 

Functions

static void InRegistryConfigAction (FwPrDesc_t resetPr)
 Configuration action for InRegistry. More...
 
static void InRegistryShutdownAction (FwSmDesc_t smDesc)
 Shutdown action for InRegistry. More...
 
FwSmDesc_t CrFwInRegistryMake ()
 Factory function for the singleton instance of the InRegistry. More...
 
void CrFwInRegistryStartTracking (FwSmDesc_t inCmp)
 Ask the InRegistry to start tracking an incoming command or report. More...
 
void CrFwInRegistryUpdateState (FwSmDesc_t inCmp, CrFwInRegistryCmdRepState_t newState)
 Ask the InRegistry to update the state of an incoming command or report. More...
 
CrFwInRegistryCmdRepState_t CrFwInRegistryGetState (CrFwInstanceId_t cmdRepId)
 Query the InRegistry for the state of an incoming command or report. More...
 

Variables

static CrFwTrackedState_t cmdRepState [CR_FW_INREGISTRY_N]
 Array to track the state of incoming commands or reports.
 
static CrFwTrackingIndex_t cmdRepStateIndex = 0
 The index of the most recent entry in cmdRepState.
 
static FwSmDesc_t inRegistry = NULL
 The InRegistry singleton.
 
static CrFwCmpData_t inRegistryData
 The data for the InRegistry singleton.
 

Detailed Description

Implementation of InRegistry 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 CrFwInRegistry.c.

Function Documentation

◆ CrFwInRegistryGetState()

CrFwInRegistryCmdRepState_t CrFwInRegistryGetState ( CrFwInstanceId_t  cmdRepId)

Query the InRegistry for the state of an incoming command or report.

If the specified index does not correspond to any command or report being tracked by the InRegistry, a value of crInRegistryNotTracked is returned. This function searches all locations in the InRegistry in sequence until it finds the incoming command or report.

Parameters
cmdRepIdthe instance identifier of the incoming command or report.
Returns
the state of the incoming command or report (or crInRegistryNotTracked if the command or report is not tracked)

Definition at line 162 of file CrFwInRegistry.c.

◆ CrFwInRegistryMake()

FwSmDesc_t CrFwInRegistryMake ( )

Factory function for the singleton instance of the InRegistry.

The first time this function is called, it creates and configures the InRegistry. Subsequent calls returns the same singleton instance. The first time this function is called, it returns the InRegistry in state CREATED.

If the creation or the configuration of the InRegistry fails, the function returns NULL.

Returns
singleton instance of the InRegistry or NULL if the creation or configuration of the InRegistry failed.

Definition at line 78 of file CrFwInRegistry.c.

◆ CrFwInRegistryStartTracking()

void CrFwInRegistryStartTracking ( FwSmDesc_t  inCmp)

Ask the InRegistry to start tracking an incoming command or report.

The InRegistry tracks the state of the last N incoming command or reports to have been loaded with this function. Initially, when this function is called, the incoming command or report is placed in state PENDING.

This function runs the procedure in the left-hand side of the activity diagram shown in the figure.

Parameters
inCmpthe incoming command or report to be tracked

Definition at line 121 of file CrFwInRegistry.c.

◆ CrFwInRegistryUpdateState()

void CrFwInRegistryUpdateState ( FwSmDesc_t  inCmp,
CrFwInRegistryCmdRepState_t  newState 
)

Ask the InRegistry to update the state of an incoming command or report.

If the argument component is not tracked by the InRegistry (perhaps because too many commands and reports have been added to the list of tracked components), nothing is done. This function runs the procedure in the right-hand side of the activity diagram shown in the figure.

Parameters
inCmpthe incoming command or report to be tracked
newStatethe new state of the incoming command or report

Definition at line 143 of file CrFwInRegistry.c.

◆ InRegistryConfigAction()

static void InRegistryConfigAction ( FwPrDesc_t  resetPr)
static

Configuration action for InRegistry.

This function resets the queue of tracked commands and reports. The outcome of the configuration action is always: "successful"

Parameters
resetPrthe Configuration Procedure of the InRegistry

Definition at line 186 of file CrFwInRegistry.c.

◆ InRegistryShutdownAction()

static void InRegistryShutdownAction ( FwSmDesc_t  smDesc)
static

Shutdown action for InRegistry.

This function resets the queue of tracked commands and reports.

Parameters
smDescthe InRegistry state machine

Definition at line 199 of file CrFwInRegistry.c.

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