Firmware
Classes | Macros | Functions
mavlink_log.h File Reference

MAVLink text logging. More...

#include <uORB/uORB.h>

Go to the source code of this file.

Classes

struct  mavlink_logmessage
 
struct  mavlink_logbuffer
 

Macros

#define MAVLINK_LOG_MAXLEN   50
 The maximum string length supported.
 
#define _MSG_PRIO_DEBUG   7
 
#define _MSG_PRIO_INFO   6
 
#define _MSG_PRIO_NOTICE   5
 
#define _MSG_PRIO_WARNING   4
 
#define _MSG_PRIO_ERROR   3
 
#define _MSG_PRIO_CRITICAL   2
 
#define _MSG_PRIO_ALERT   1
 
#define _MSG_PRIO_EMERGENCY   0
 
#define mavlink_log_info(_pub, _text, ...)   mavlink_vasprintf(_MSG_PRIO_INFO, _pub, _text, ##__VA_ARGS__);
 Send a mavlink info message (not printed to console). More...
 
#define mavlink_log_warning(_pub, _text, ...)
 Send a mavlink warning message and print to console. More...
 
#define mavlink_log_emergency(_pub, _text, ...)
 Send a mavlink emergency message and print to console. More...
 
#define mavlink_log_critical(_pub, _text, ...)
 Send a mavlink critical message and print to console. More...
 
#define mavlink_and_console_log_info(_pub, _text, ...)
 Send a mavlink emergency message and print to console. More...
 

Functions

__EXPORT void mavlink_vasprintf (int severity, orb_advert_t *mavlink_log_pub, const char *fmt,...)
 

Detailed Description

MAVLink text logging.

Author
Lorenz Meier loren.nosp@m.z@px.nosp@m.4.io
Julian Oes julia.nosp@m.n@oe.nosp@m.s.ch

Macro Definition Documentation

§ mavlink_and_console_log_info

#define mavlink_and_console_log_info (   _pub,
  _text,
  ... 
)
Value:
do { \
mavlink_log_info(_pub, _text, ##__VA_ARGS__); \
PX4_INFO(_text, ##__VA_ARGS__); \
} while(0);

Send a mavlink emergency message and print to console.

Parameters
_pubPointer to the uORB advert;
_textThe text to log;

§ mavlink_log_critical

#define mavlink_log_critical (   _pub,
  _text,
  ... 
)
Value:
do { \
mavlink_vasprintf(_MSG_PRIO_CRITICAL, _pub, _text, ##__VA_ARGS__); \
PX4_WARN(_text, ##__VA_ARGS__); \
} while(0);

Send a mavlink critical message and print to console.

Parameters
_pubPointer to the uORB advert;
_textThe text to log;

§ mavlink_log_emergency

#define mavlink_log_emergency (   _pub,
  _text,
  ... 
)
Value:
do { \
mavlink_vasprintf(_MSG_PRIO_EMERGENCY, _pub, _text, ##__VA_ARGS__); \
PX4_ERR(_text, ##__VA_ARGS__); \
} while(0);

Send a mavlink emergency message and print to console.

Parameters
_pubPointer to the uORB advert;
_textThe text to log;

§ mavlink_log_info

#define mavlink_log_info (   _pub,
  _text,
  ... 
)    mavlink_vasprintf(_MSG_PRIO_INFO, _pub, _text, ##__VA_ARGS__);

Send a mavlink info message (not printed to console).

Parameters
_pubPointer to the uORB advert;
_textThe text to log;

§ mavlink_log_warning

#define mavlink_log_warning (   _pub,
  _text,
  ... 
)
Value:
do { \
mavlink_vasprintf(_MSG_PRIO_WARNING, _pub, _text, ##__VA_ARGS__); \
PX4_WARN(_text, ##__VA_ARGS__); \
} while(0);

Send a mavlink warning message and print to console.

Parameters
_pubPointer to the uORB advert;
_textThe text to log;