SELKIELogger  1.0.0
Collaboration diagram for Logger: Timer functions:

Classes

struct  timer_params
 Timer specific parameters. More...
 

Functions

void * timer_setup (void *ptargs)
 Check parameters, but no other setup required. More...
 
void * timer_logging (void *ptargs)
 Generate timer message at requested frequency. More...
 
void * timer_shutdown (void *ptargs)
 No shutdown required - does nothing. More...
 
void * timer_channels (void *ptargs)
 Generate channel map and push to logging queue. More...
 
device_callbacks timer_getCallbacks (void)
 Fill out device callback functions for logging. More...
 
timer_params timer_getParams (void)
 Fill out default timer parameters. More...
 
bool timer_parseConfig (log_thread_args_t *lta, config_section *s)
 Take a configuration section and parse parameters. More...
 

Detailed Description

Generate timestamps at as close to a regular frequency as possible, which can be used to synchronise the output.

Function Documentation

◆ timer_channels()

void* timer_channels ( void *  ptargs)

Generate channel map and push to logging queue.

Populate list of channels and push to queue as a map message

Exits thread in case of error.

Parameters
[in]ptargsPointer to log_thread_args_t
Returns
NULL - Exit code in ptargs->returnCode if required

Definition at line 146 of file LoggerTime.c.

◆ timer_getCallbacks()

device_callbacks timer_getCallbacks ( void  )

Fill out device callback functions for logging.

Returns
device_callbacks for timestamp generators

Definition at line 187 of file LoggerTime.c.

◆ timer_getParams()

timer_params timer_getParams ( void  )

Fill out default timer parameters.

Returns
Default parameters for a timestamp generator

Definition at line 198 of file LoggerTime.c.

◆ timer_logging()

void* timer_logging ( void *  ptargs)

Generate timer message at requested frequency.

Generate timestamp messages at the specified interval using CLOCK_MONOTONIC, and epoch messages whenever the value of time() changes (i.e once a second).

The loop saves the value of CLOCK_MONOTONIC at the start of each iteration and uses that to calculate the target start time for the next iteration. If the execution of the loop has taken too long (i.e. the next iteration should already have started), a warning is generated.

Parameters
[in]ptargsPointer to log_thread_args_t
Returns
NULL - Exit code in ptargs->returnCode if required

Definition at line 61 of file LoggerTime.c.

◆ timer_parseConfig()

bool timer_parseConfig ( log_thread_args_t lta,
config_section s 
)

Take a configuration section and parse parameters.

Parameters
[in]ltaPointer to log_thread_args_t
[in]sPointer to config_section to be parsed
Returns
True on success, false on error

Definition at line 212 of file LoggerTime.c.

◆ timer_setup()

void* timer_setup ( void *  ptargs)

Check parameters, but no other setup required.

Ensure a name is allocated to the timer.

No other initialisation is required in this case.

Parameters
[in]ptargsPointer to log_thread_args_t
Returns
NULL - Exit code in ptargs->returnCode if required

Definition at line 34 of file LoggerTime.c.

◆ timer_shutdown()

void* timer_shutdown ( void *  ptargs)

No shutdown required - does nothing.

Free resources as required.

Parameters
[in]ptargsPointer to log_thread_args_t
Returns
NULL - Exit code in ptargs->returnCode if required

Definition at line 127 of file LoggerTime.c.