aboutsummaryrefslogtreecommitdiff
path: root/apps/mavlink
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2013-03-07 20:51:33 +0100
committerLorenz Meier <lm@inf.ethz.ch>2013-03-07 20:51:33 +0100
commite8e52afcc426491f5959e6f879f26c9211a88d4c (patch)
treefe763c133488fb0070fe57c22250c6f28250f9ea /apps/mavlink
parentebac51cad8e144b64938e6726e26bdc23aaf45e5 (diff)
downloadpx4-firmware-e8e52afcc426491f5959e6f879f26c9211a88d4c.tar.gz
px4-firmware-e8e52afcc426491f5959e6f879f26c9211a88d4c.tar.bz2
px4-firmware-e8e52afcc426491f5959e6f879f26c9211a88d4c.zip
Added minimum set of IO MAVLink text messages, report critical errors such as in-air restarts
Diffstat (limited to 'apps/mavlink')
-rw-r--r--apps/mavlink/mavlink_log.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/mavlink/mavlink_log.h b/apps/mavlink/mavlink_log.h
index 62e6f7ca0..233a76cb3 100644
--- a/apps/mavlink/mavlink_log.h
+++ b/apps/mavlink/mavlink_log.h
@@ -63,7 +63,11 @@
* @param _fd A file descriptor returned from open(MAVLINK_LOG_DEVICE, 0);
* @param _text The text to log;
*/
+#ifdef __cplusplus
+#define mavlink_log_emergency(_fd, _text) ::ioctl(_fd, MAVLINK_IOC_SEND_TEXT_EMERGENCY, (unsigned long)_text);
+#else
#define mavlink_log_emergency(_fd, _text) ioctl(_fd, MAVLINK_IOC_SEND_TEXT_EMERGENCY, (unsigned long)_text);
+#endif
/**
* Send a mavlink critical message.
@@ -71,7 +75,11 @@
* @param _fd A file descriptor returned from open(MAVLINK_LOG_DEVICE, 0);
* @param _text The text to log;
*/
+#ifdef __cplusplus
+#define mavlink_log_critical(_fd, _text) ::ioctl(_fd, MAVLINK_IOC_SEND_TEXT_CRITICAL, (unsigned long)_text);
+#else
#define mavlink_log_critical(_fd, _text) ioctl(_fd, MAVLINK_IOC_SEND_TEXT_CRITICAL, (unsigned long)_text);
+#endif
/**
* Send a mavlink info message.
@@ -79,7 +87,11 @@
* @param _fd A file descriptor returned from open(MAVLINK_LOG_DEVICE, 0);
* @param _text The text to log;
*/
+#ifdef __cplusplus
+#define mavlink_log_info(_fd, _text) ::ioctl(_fd, MAVLINK_IOC_SEND_TEXT_INFO, (unsigned long)_text);
+#else
#define mavlink_log_info(_fd, _text) ioctl(_fd, MAVLINK_IOC_SEND_TEXT_INFO, (unsigned long)_text);
+#endif
struct mavlink_logmessage {
char text[51];