dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Logging Module

Files

file  logging.c
 Forward a set of UAVObjects when updated out a PIOS_COM port.
 

Macros

#define STACK_SIZE_BYTES   1200
 
#define TASK_PRIORITY   PIOS_THREAD_PRIO_LOW
 
#define LOGGING_PERIOD_MS   100
 

Functions

static void loggingTask (void *parameters)
 
static int32_t send_data (uint8_t *data, int32_t length)
 
static int32_t send_data_nonblock (void *ctx, uint8_t *data, int32_t length)
 
static uint16_t get_minimum_logging_period ()
 
static void unregister_object (UAVObjHandle obj)
 
static void register_object (UAVObjHandle obj)
 
static void register_default_profile ()
 
static void logAll (UAVObjHandle obj)
 
static void logSettings (UAVObjHandle obj)
 
static void writeHeader ()
 
static void updateSettings ()
 
int32_t LoggingInitialize (void)
 
int32_t LoggingStart (void)
 
 MODULE_INITCALL (LoggingInitialize, LoggingStart)
 
static void obj_updated_callback (const UAVObjEvent *ev, void *cb_ctx, void *uavo_data, int uavo_len)
 Callback for adding an object to the logging queue. More...
 

Variables

const char DIGITS [16] = "0123456789abcdef"
 
static UAVTalkConnection uavTalkCon
 
static struct pios_thread * loggingTaskHandle
 
static bool module_enabled
 
static volatile LoggingSettingsData settings
 
static LoggingStatsData loggingData
 
static uintptr_t logging_com_id
 
static uint32_t written_bytes
 
static bool destination_onboard_flash
 

Detailed Description

Macro Definition Documentation

#define LOGGING_PERIOD_MS   100

Definition at line 84 of file logging.c.

#define STACK_SIZE_BYTES   1200

Definition at line 80 of file logging.c.

#define TASK_PRIORITY   PIOS_THREAD_PRIO_LOW

Definition at line 81 of file logging.c.

Function Documentation

static uint16_t get_minimum_logging_period ( )
static

Get the minimum logging period in milliseconds

Definition at line 502 of file logging.c.

static void logAll ( UAVObjHandle  obj)
static

Log all objects' initial value.

Parameters
[in]objObject to log

Definition at line 435 of file logging.c.

int32_t LoggingInitialize ( void  )

Initialise the Logging module

Returns
-1 if initialisation failed
0 on success

Definition at line 126 of file logging.c.

int32_t LoggingStart ( void  )

Start the Logging module

Returns
-1 if initialisation failed
0 on success

Definition at line 202 of file logging.c.

static void loggingTask ( void *  parameters)
static

Definition at line 219 of file logging.c.

static void logSettings ( UAVObjHandle  obj)
static

Log all settings objects

Parameters
[in]objObject to log

Definition at line 444 of file logging.c.

MODULE_INITCALL ( LoggingInitialize  ,
LoggingStart   
)
static void obj_updated_callback ( const UAVObjEvent ev,
void *  cb_ctx,
void *  uavo_data,
int  uavo_len 
)
static

Callback for adding an object to the logging queue.

Parameters
evthe event

Definition at line 485 of file logging.c.

static void register_default_profile ( )
static

Register objects for the default logging profile

Definition at line 591 of file logging.c.

static void register_object ( UAVObjHandle  obj)
static

Register a new object: connect the update callback

Parameters
[in]objObject to connect

Definition at line 554 of file logging.c.

static int32_t send_data ( uint8_t *  data,
int32_t  length 
)
static

Definition at line 452 of file logging.c.

static int32_t send_data_nonblock ( void *  ctx,
uint8_t *  data,
int32_t  length 
)
static

Forward data from UAVTalk out the serial port

Parameters
[in]dataData buffer to send
[in]lengthLength of buffer
Returns
-1 on failure
number of bytes transmitted on success

Definition at line 469 of file logging.c.

static void unregister_object ( UAVObjHandle  obj)
static

Unregister an object

Parameters
[in]objObject to unregister

Definition at line 546 of file logging.c.

static void updateSettings ( )
static

Definition at line 716 of file logging.c.

static void writeHeader ( )
static

Write log file header see firmwareinfotemplate.c

Definition at line 666 of file logging.c.

Variable Documentation

bool destination_onboard_flash
static

Definition at line 111 of file logging.c.

const char DIGITS[16] = "0123456789abcdef"

Definition at line 82 of file logging.c.

uintptr_t logging_com_id
static

Definition at line 109 of file logging.c.

LoggingStatsData loggingData
static

Definition at line 93 of file logging.c.

struct pios_thread* loggingTaskHandle
static

Definition at line 90 of file logging.c.

bool module_enabled
static

Definition at line 91 of file logging.c.

volatile LoggingSettingsData settings
static

Definition at line 92 of file logging.c.

UAVTalkConnection uavTalkCon
static

Definition at line 89 of file logging.c.

uint32_t written_bytes
static

Definition at line 110 of file logging.c.