SELKIELogger  1.0.0
Collaboration diagram for Logger: LPMS device support:

Classes

struct  lpms_params
 Serial device specific parameters. More...
 

Functions

void * lpms_setup (void *ptargs)
 Generic serial connection setup. More...
 
bool lpms_queue_message (msgqueue *Q, const uint8_t src, const uint8_t chan, const float val)
 Helper function: Create and queue data messages, with error handling. More...
 
void * lpms_logging (void *ptargs)
 Serial source main logging loop. More...
 
void * lpms_shutdown (void *ptargs)
 Serial source shutdown. More...
 
void * lpms_channels (void *ptargs)
 Serial source channel map. More...
 
device_callbacks lpms_getCallbacks (void)
 Fill out device callback functions for logging. More...
 
lpms_params lpms_getParams (void)
 Fill out default MP source parameters. More...
 
bool lpms_parseConfig (log_thread_args_t *lta, config_section *s)
 Take a configuration section and parse parameters. More...
 

Detailed Description

Adds support for LPMS IMU devices.

Function Documentation

◆ lpms_channels()

void* lpms_channels ( void *  ptargs)

Serial source channel map.

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 466 of file LoggerLPMS.c.

◆ lpms_getCallbacks()

device_callbacks lpms_getCallbacks ( void  )

Fill out device callback functions for logging.

Returns
device_callbacks for serial sources

Definition at line 441 of file LoggerLPMS.c.

◆ lpms_getParams()

lpms_params lpms_getParams ( void  )

Fill out default MP source parameters.

Returns
Default parameters for serial sources

Definition at line 452 of file LoggerLPMS.c.

◆ lpms_logging()

void* lpms_logging ( void *  ptargs)

Serial source main logging loop.

Reads messages from the connection established by lpms_setup(), and pushes them to the queue. Data is not interpreted, just pushed into the queue with suitable headers.

Message size is variable, based on min/max limits and the amount of data available to read from the source.

Terminates 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 159 of file LoggerLPMS.c.

◆ lpms_parseConfig()

bool lpms_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 532 of file LoggerLPMS.c.

◆ lpms_queue_message()

bool lpms_queue_message ( msgqueue Q,
const uint8_t  src,
const uint8_t  chan,
const float  val 
)
inline

Helper function: Create and queue data messages, with error handling.

Create a floating point value message for the specified source and channel numbers, and push it to the queue (Q). If unable to create or push the message, tidy up and return false.

Reduces code duplication in lpms_logging()

Parameters
[in]QPointer to message queue
[in]srcMessage source number
[in]chanMessage type/channel number
[in]valMessage value
Returns
True on success, False on error

Definition at line 136 of file LoggerLPMS.c.

◆ lpms_setup()

void* lpms_setup ( void *  ptargs)

Generic serial connection setup.

Opens a serial connection and the required baud rate.

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

Definition at line 58 of file LoggerLPMS.c.

◆ lpms_shutdown()

void* lpms_shutdown ( void *  ptargs)

Serial source shutdown.

Simple wrapper around lpms_closeConnection(), which will do any cleanup required.

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

Definition at line 423 of file LoggerLPMS.c.