CORDET Framework - C2 Implementation
CrFwTime.h File Reference

Interface through which framework components access the current time. More...

Go to the source code of this file.

Functions

CrFwTime_t CrFwGetCurrentTime ()
 Return the current application time in standard format. More...
 
CrFwTimeStamp_t CrFwGetCurrentTimeStamp ()
 Return the current time in the format used for the command and report time-stamp. More...
 
CrFwTimeCyc_t CrFwGetCurrentCycTime ()
 Return the current time in "cycle format" (integer number of cycles elapsed since some event). More...
 
CrFwTimeStamp_t CrFwStdTimeToTimeStamp (CrFwTime_t stdTime)
 Convert a time value from standard time format to time-stamp format. More...
 
CrFwTime_t CrFwTimeStampToStdTime (CrFwTimeStamp_t timeStamp)
 Convert a time value from time-stamp format to standard time format. More...
 

Detailed Description

Interface through which framework components access the current time.

Framework component need access to the current time to time-stamp out-going command and report packets.

This interface recognizes three formats for the application time:

  • The "standard format" where the time is expressed as a float representing the fractional number of time units elapsed since some specific event
  • The "time-stamp format" used in the time-stamp of the commands and reports
  • The "cycle format" where the time is expressed as an integer number of cycle elapsed since some specific event (e.g. the latest application start)

This interface offers functions to retrieve the current time in all three formats and it offers function to convert times between standard and time-stamp format.

All applications must support the time-stamp format (because this is needed for the time-stamping of commands and reports) but support for the other two time formats is optional.

The implementation of this interface is entirely application-specific. A simple default implementation is provided in CrFwTime.c. This default implementation is primarily intended for testing and demonstration purposes.

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 CrFwTime.h.

Function Documentation

CrFwTimeCyc_t CrFwGetCurrentCycTime ( )

Return the current time in "cycle format" (integer number of cycles elapsed since some event).

If the host application does not support the "cycle format", this function returns zero.

Returns
the current time in cycle format or zero if the cycle format is not supported.

Definition at line 51 of file CrFwTime.c.

CrFwTime_t CrFwGetCurrentTime ( )

Return the current application time in standard format.

If the host application does not support this time format, then this function is implemented to return zero.

Returns
the current time in standard format or zero if this format is not supported.

Definition at line 46 of file CrFwTime.c.

CrFwTimeStamp_t CrFwGetCurrentTimeStamp ( )

Return the current time in the format used for the command and report time-stamp.

Returns
the current time.

Definition at line 40 of file CrFwTime.c.

CrFwTimeStamp_t CrFwStdTimeToTimeStamp ( CrFwTime_t  stdTime)

Convert a time value from standard time format to time-stamp format.

Parameters
stdTimethe time in standard format
Returns
the time in time-stamp format

Definition at line 56 of file CrFwTime.c.

CrFwTime_t CrFwTimeStampToStdTime ( CrFwTimeStamp_t  timeStamp)

Convert a time value from time-stamp format to standard time format.

Parameters
timeStampthe time in time-stamp format
Returns
the time in standard format

Definition at line 61 of file CrFwTime.c.

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