SELKIELogger  1.0.0
Collaboration diagram for Logger: N2K Support:

Classes

struct  n2k_params
 N2K Device specific parameters. More...
 

Macros

#define N2KCHAN_NAME   SLCHAN_NAME
 Source name.
 
#define N2KCHAN_MAP   SLCHAN_MAP
 Channel map.
 
#define N2KCHAN_TSTAMP   SLCHAN_TSTAMP
 Timestamps.
 
#define N2KCHAN_RAW   SLCHAN_RAW
 Raw data (recorded unmodified)
 
#define N2KCHAN_LAT   4
 Latitude (from GPS)
 
#define N2KCHAN_LON   5
 Longitude (from GPS)
 

Functions

void * n2k_setup (void *ptargs)
 N2K Setup. More...
 
void * n2k_logging (void *ptargs)
 N2K logging (with pthread function signature) More...
 
void * n2k_shutdown (void *ptargs)
 N2K Shutdown. More...
 
void * n2k_channels (void *ptargs)
 N2K Channel map. More...
 
device_callbacks n2k_getCallbacks (void)
 Fill out device callback functions for logging. More...
 
n2k_params n2k_getParams (void)
 Fill out default N2K parameters. More...
 
bool n2k_parseConfig (log_thread_args_t *lta, config_section *s)
 Take a configuration section and parse parameters. More...
 

Detailed Description

Adds support for reading messages from an N2K0183 serial device.

Reading messages from the device and parsing to the internal message pack format used by the logger is handled in SELKIELoggerN2K.h

Function Documentation

◆ n2k_channels()

void* n2k_channels ( void *  ptargs)

N2K Channel map.

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

Terminates thread on error

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

Definition at line 208 of file LoggerN2K.c.

◆ n2k_getCallbacks()

device_callbacks n2k_getCallbacks ( void  )

Fill out device callback functions for logging.

Returns
device_callbacks for N2K serial sources

Definition at line 249 of file LoggerN2K.c.

◆ n2k_getParams()

n2k_params n2k_getParams ( void  )

Fill out default N2K parameters.

Returns
Default parameters for N2K serial sources

Definition at line 260 of file LoggerN2K.c.

◆ n2k_logging()

void* n2k_logging ( void *  ptargs)

N2K logging (with pthread function signature)

Takes a n2k_params struct (passed via log_thread_args_t) messages from a device configured with n2k_setup() and pushes them to the message queue.

Exits thread on error or when shutdown is signalled.

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

Definition at line 62 of file LoggerN2K.c.

◆ n2k_parseConfig()

bool n2k_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 271 of file LoggerN2K.c.

◆ n2k_setup()

void* n2k_setup ( void *  ptargs)

N2K Setup.

Set up connection to an N2K serial gateway device.

No other steps required.

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

Definition at line 36 of file LoggerN2K.c.

◆ n2k_shutdown()

void* n2k_shutdown ( void *  ptargs)

N2K Shutdown.

Calls n2k_closeConnection(), which will do any cleanup required.

Parameters
[in]ptargsPointer to log_thread_args_t
Returns
NULL

Definition at line 181 of file LoggerN2K.c.