CORDET Framework - C2 Implementation
tests/CrFwInStreamStub.c File Reference

Implementation of InStream Stub. More...

Go to the source code of this file.

Functions

CrFwPckt_t CrFwInStreamStubPcktCollect (CrFwDestSrc_t src)
 Stub function implementing the packet collect operation for the InStream (see CrFwInStream.h). More...
 
CrFwBool_t CrFwInStreamStubIsPcktAvail (CrFwDestSrc_t src)
 Stub function implementing the packet available check operation for the InStream (see CrFwInStream.h). More...
 
void CrFwInStreamStubDummyCheck (FwPrDesc_t prDesc)
 Dummy implementation of an initialization or configuration check. More...
 
void CrFwInStreamStubInitAction (FwPrDesc_t prDesc)
 Dummy implementation of an initialization action. More...
 
void CrFwInStreamStubConfigAction (FwPrDesc_t prDesc)
 Dummy implementation of a configuration action. More...
 
void CrFwInStreamStubShutdown (FwSmDesc_t smDesc)
 Stub function implementing the shutdown operation for an InStream (see CrFwInStream.h). More...
 
void CrFwInStreamStubSetCheckFlag (CrFwBool_t flag)
 Set the value of the check flag which determines the outcome of the dummy check of CrFwInStreamStubDummyCheck. More...
 
void CrFwInStreamStubSetActionFlag (CrFwBool_t flag)
 Set the value of the action flag which determines the outcome of the initialization or configuration action. More...
 
void CrFwInStreamStubSetPcktCollectionCnt (CrFwCounterU1_t cnt)
 Set the value of the packet collection counter which defines the number of packets available at the middleware interface (see CrFwInStreamStubPcktCollect). More...
 
void CrFwInStreamStubSetPcktSeqCnt (CrFwSeqCnt_t cnt)
 Set the value of the sequence counter of the next packet collected (see CrFwInStreamStubPcktCollect). More...
 
void CrFwInStreamStubSetPcktGroup (CrFwGroup_t group)
 Set the value of the group of the next packet collected (see CrFwInStreamStubPcktCollect). More...
 
void CrFwInStreamStubSetPcktDest (CrFwDestSrc_t d)
 Set the value of the destination of the next packet collected (see CrFwInStreamStubPcktCollect). More...
 
void CrFwInStreamStubSetPcktCmdRepId (CrFwInstanceId_t id)
 Set the value of the command or report identifier of the next packet collected (see CrFwInStreamStubPcktCollect). More...
 
void CrFwInStreamStubSetPcktCmdRepType (CrFwCmdRepType_t type)
 Set the type (command or report) of the next packet collected (see CrFwInStreamStubPcktCollect). More...
 
void CrFwInStreamStubSetPcktAckLevel (CrFwBool_t acc, CrFwBool_t str, CrFwBool_t prg, CrFwBool_t trm)
 Set the value of the acknowledge level of the next packet collected (see CrFwInStreamStubPcktCollect). More...
 
void CrFwInStreamStubSetPcktType (CrFwServType_t sType, CrFwServSubType_t sSubType, CrFwDiscriminant_t d)
 Set the value of the service type, sub-type and discriminant of the next packet collected (see CrFwInStreamStubPcktCollect). More...
 
CrFwCounterU1_t CrFwInStreamStubGetShutdownCnt ()
 Get the value of the shutdown counter (see CrFwInStreamStubShutdown). More...
 

Variables

static CrFwCounterU1_t pcktCollectCnt = 0
 Number of packets currently waiting to be collected from the middleware.
 
static CrFwSeqCnt_t pcktSeqCnt = 0
 Sequence counter.
 
static CrFwDestSrc_t dest = 0
 Destination.
 
static CrFwCmdRepType_t cmdRepType = crCmdType
 Destination.
 
static CrFwServType_t servType = 0
 Service type.
 
static CrFwServSubType_t servSubType = 0
 Service sub-type.
 
static CrFwDiscriminant_t disc = 0
 Discriminant.
 
static CrFwGroup_t pcktGroup = 0
 group
 
static CrFwBool_t ackAcc = 0
 Acknowledge level for acceptance.
 
static CrFwBool_t ackStr = 0
 Acknowledge level for start.
 
static CrFwBool_t ackPrg = 0
 Acknowledge level for progress.
 
static CrFwBool_t ackTrm = 0
 Acknowledge level for termination.
 
static CrFwInstanceId_t cmdRepId = 0
 Command or Report Identifier.
 
static CrFwBool_t checkFlag = 1
 Outcome of dummy check.
 
static CrFwBool_t actionFlag = 1
 Outcome of dummy action.
 
static CrFwCounterU1_t shutdownCnt = 0
 Counter incremented by stub Shutdown Operation.
 

Detailed Description

Implementation of InStream Stub.

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 tests/CrFwInStreamStub.c.

Function Documentation

void CrFwInStreamStubConfigAction ( FwPrDesc_t  prDesc)

Dummy implementation of a configuration action.

The outcome of this action is given by the value of the actionFlag whose value is set through function CrFwInStreamStubSetActionFlag.

Like all application-specific InStream Configuration Actions, this function also calls the default InStream Configuration Action.

Parameters
prDescthe initialization or configuration procedure descriptor (this parameter is not used).

Definition at line 134 of file tests/CrFwInStreamStub.c.

void CrFwInStreamStubDummyCheck ( FwPrDesc_t  prDesc)

Dummy implementation of an initialization or configuration check.

The outcome of this implementation is given by the value of a settable flag (the check flag) whose value is set through function CrFwInStreamStubSetCheckFlag.

Parameters
prDescthe initialization or configuration procedure descriptor (this parameter is not used).

Definition at line 119 of file tests/CrFwInStreamStub.c.

CrFwCounterU1_t CrFwInStreamStubGetShutdownCnt ( )

Get the value of the shutdown counter (see CrFwInStreamStubShutdown).

Returns
the value of the packet sequence counter

Definition at line 203 of file tests/CrFwInStreamStub.c.

void CrFwInStreamStubInitAction ( FwPrDesc_t  prDesc)

Dummy implementation of an initialization action.

The outcome of this action is given by the value of the actionFlag whose value is set through function CrFwInStreamStubSetActionFlag.

Like all application-specific InStream Initialization Actions, this function also calls the default OutStream Initialization Action (CrFwInStreamDefInitAction) to ensure that default initialization actions are performed. The CrFwInStreamDefInitAction function dynamically allocates memory for an internal InStream data structure. In order to avoid memory leaks, function CrFwInStreamDefInitAction is only called if the InStream data structure has not yet been initialized.

Parameters
prDescthe initialization or configuration procedure descriptor (this parameter is not used).

Definition at line 125 of file tests/CrFwInStreamStub.c.

CrFwBool_t CrFwInStreamStubIsPcktAvail ( CrFwDestSrc_t  src)

Stub function implementing the packet available check operation for the InStream (see CrFwInStream.h).

This stub returns true if the packet collection counter is greater than zero.

Parameters
srcthe source associated to the InStream (not used in this stub)
Returns
the value of a predefined flag

Definition at line 113 of file tests/CrFwInStreamStub.c.

CrFwPckt_t CrFwInStreamStubPcktCollect ( CrFwDestSrc_t  src)

Stub function implementing the packet collect operation for the InStream (see CrFwInStream.h).

This stub manages a counter (the packet collection counter) which is decremented every time the function is called. The value of the packet collection counter can be set with function CrFwInStreamStubSetPcktCollectionCnt. This stub creates and returns a packet. The packet is unconfigured other than for the following fields:

Parameters
srcthe source associated to the InStream (not used in this stub)
Returns
the packet

Definition at line 89 of file tests/CrFwInStreamStub.c.

void CrFwInStreamStubSetActionFlag ( CrFwBool_t  flag)

Set the value of the action flag which determines the outcome of the initialization or configuration action.

Parameters
flagthe action flag

Definition at line 152 of file tests/CrFwInStreamStub.c.

void CrFwInStreamStubSetCheckFlag ( CrFwBool_t  flag)

Set the value of the check flag which determines the outcome of the dummy check of CrFwInStreamStubDummyCheck.

Parameters
flagthe value of the check flag

Definition at line 147 of file tests/CrFwInStreamStub.c.

void CrFwInStreamStubSetPcktAckLevel ( CrFwBool_t  acc,
CrFwBool_t  str,
CrFwBool_t  prg,
CrFwBool_t  trm 
)

Set the value of the acknowledge level of the next packet collected (see CrFwInStreamStubPcktCollect).

Parameters
accacknowledge level for command acceptance
stracknowledge level for command start
prgacknowledge level for command progress
trmacknowledge level for command termination

Definition at line 187 of file tests/CrFwInStreamStub.c.

void CrFwInStreamStubSetPcktCmdRepId ( CrFwInstanceId_t  id)

Set the value of the command or report identifier of the next packet collected (see CrFwInStreamStubPcktCollect).

Parameters
idthe command or report identifier

Definition at line 177 of file tests/CrFwInStreamStub.c.

void CrFwInStreamStubSetPcktCmdRepType ( CrFwCmdRepType_t  cmdRepType)

Set the type (command or report) of the next packet collected (see CrFwInStreamStubPcktCollect).

Parameters
cmdRepTypethe command or report type

Definition at line 182 of file tests/CrFwInStreamStub.c.

void CrFwInStreamStubSetPcktCollectionCnt ( CrFwCounterU1_t  cnt)

Set the value of the packet collection counter which defines the number of packets available at the middleware interface (see CrFwInStreamStubPcktCollect).

Parameters
cntthe value of the packet collection counter

Definition at line 157 of file tests/CrFwInStreamStub.c.

void CrFwInStreamStubSetPcktDest ( CrFwDestSrc_t  dest)

Set the value of the destination of the next packet collected (see CrFwInStreamStubPcktCollect).

Parameters
destthe packet destination

Definition at line 172 of file tests/CrFwInStreamStub.c.

void CrFwInStreamStubSetPcktGroup ( CrFwGroup_t  group)

Set the value of the group of the next packet collected (see CrFwInStreamStubPcktCollect).

Parameters
groupthe value of the group

Definition at line 167 of file tests/CrFwInStreamStub.c.

void CrFwInStreamStubSetPcktSeqCnt ( CrFwSeqCnt_t  cnt)

Set the value of the sequence counter of the next packet collected (see CrFwInStreamStubPcktCollect).

Parameters
cntthe value of the packet sequence counter

Definition at line 162 of file tests/CrFwInStreamStub.c.

void CrFwInStreamStubSetPcktType ( CrFwServType_t  servType,
CrFwServSubType_t  servSubType,
CrFwDiscriminant_t  disc 
)

Set the value of the service type, sub-type and discriminant of the next packet collected (see CrFwInStreamStubPcktCollect).

Parameters
servTypethe service type
servSubTypethe service sub-type
discthe discriminant

Definition at line 195 of file tests/CrFwInStreamStub.c.

void CrFwInStreamStubShutdown ( FwSmDesc_t  smDesc)

Stub function implementing the shutdown operation for an InStream (see CrFwInStream.h).

This function increments a counter (the shutdown counter) and then calls the default shutdown operation (CrFwInStreamDefShutdownAction).

Parameters
smDescthe descriptor of the InStream state machine
Returns
the value of a predefined flag

Definition at line 141 of file tests/CrFwInStreamStub.c.

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