![]() |
This is Unofficial EPICS BASE Doxygen Site
|
The generalTime framework provides a mechanism for several time providers to be present within the system. More...
#include "libComAPI.h"
Go to the source code of this file.
Macros | |
#define | NUM_TIME_EVENTS 256 |
The number of time events that are validated. More... | |
#define | generalTimeCurrentTpName generalTimeCurrentProviderName |
Old name provided for backwards compatibility. More... | |
#define | generalTimeEventTpName generalTimeEventProviderName |
Old name provided for backwards compatibility. More... | |
Functions | |
LIBCOM_API void | generalTime_Init (void) |
Initialise the framework. More... | |
LIBCOM_API int | installLastResortEventProvider (void) |
Install a Time Event time provider that returns the current time for any Time event number. More... | |
LIBCOM_API void | generalTimeResetErrorCounts (void) |
Reset the internal counter of the number of times the time returned was earlier than when previously requested. More... | |
LIBCOM_API int | generalTimeGetErrorCounts (void) |
Return the internal counter of the number of times the time returned was earlier than when previously requested. More... | |
LIBCOM_API const char * | generalTimeCurrentProviderName (void) |
Return the nume of the provider that last returned a valid current time, or NULL if none. More... | |
LIBCOM_API const char * | generalTimeEventProviderName (void) |
Return the name of the provider that last returned a valid Time Event time, or NULL of none. More... | |
LIBCOM_API const char * | generalTimeHighestCurrentName (void) |
Return the name of the registered current time provider that has the highest priority. More... | |
LIBCOM_API long | generalTimeReport (int interest) |
Provide information about the installed providers and their current best times. More... | |
The generalTime framework provides a mechanism for several time providers to be present within the system.
There are two types of time provider, one type provides the current wall-clock time, the other provides Event System times. Each time provider is registered with a priority, and installed providers are queried in priority order whenever a time is requested, until one returns successfully. Thus there is a fallback from higher priority providers (smaller value of priority) to lower priority providers (larger value of priority) if the highest priority ones fail. Each architecture has a "last resort" provider, installed at priority 999, usually based on the system clock, which is used in the absence of any other provider.
Targets running VxWorks and RTEMS have an NTP provider installed at priority 100.
Registered providers may also add an interrupt-safe routine that will be called from the epicsTimeGetCurrentInt() or epicsTimeGetEventInt() API routines. These interfaces cannot check the priority queue, so will only succeed if the last-used provider has registered a suitable routine.
Definition in file epicsGeneralTime.h.
#define generalTimeCurrentTpName generalTimeCurrentProviderName |
Old name provided for backwards compatibility.
Definition at line 140 of file epicsGeneralTime.h.
#define generalTimeEventTpName generalTimeEventProviderName |
Old name provided for backwards compatibility.
Definition at line 142 of file epicsGeneralTime.h.
#define NUM_TIME_EVENTS 256 |
The number of time events that are validated.
Time Events numbered 0 through (NUM_TIME_EVENTS-1) are validated by code in epicsGeneralTime.c that tests for advancing timestamps and enforces that restriction.
Definition at line 56 of file epicsGeneralTime.h.
LIBCOM_API void generalTime_Init | ( | void | ) |
Initialise the framework.
This routine is called automatically by any function that requires the framework. It does not need to be called explicitly.
Definition at line 99 of file epicsGeneralTime.c.
LIBCOM_API const char* generalTimeCurrentProviderName | ( | void | ) |
Return the nume of the provider that last returned a valid current time, or NULL if none.
Used by stringin device support with:
Definition at line 638 of file epicsGeneralTime.c.
LIBCOM_API const char* generalTimeEventProviderName | ( | void | ) |
Return the name of the provider that last returned a valid Time Event time, or NULL of none.
Used by stringin device support with:
Definition at line 645 of file epicsGeneralTime.c.
LIBCOM_API int generalTimeGetErrorCounts | ( | void | ) |
Return the internal counter of the number of times the time returned was earlier than when previously requested.
Used by device support for longin record with:
Definition at line 630 of file epicsGeneralTime.c.
LIBCOM_API const char* generalTimeHighestCurrentName | ( | void | ) |
Return the name of the registered current time provider that has the highest priority.
Used by stringin device support with:
Definition at line 652 of file epicsGeneralTime.c.
LIBCOM_API long generalTimeReport | ( | int | interest | ) |
Provide information about the installed providers and their current best times.
interest | Desired interest level to report |
Definition at line 529 of file epicsGeneralTime.c.
LIBCOM_API void generalTimeResetErrorCounts | ( | void | ) |
Reset the internal counter of the number of times the time returned was earlier than when previously requested.
Used by device support for binary out record with:
Definition at line 623 of file epicsGeneralTime.c.
LIBCOM_API int installLastResortEventProvider | ( | void | ) |
Install a Time Event time provider that returns the current time for any Time event number.
Definition at line 520 of file epicsGeneralTime.c.