aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2015-01-05 10:02:07 +0100
committerThomas Gubler <thomasgubler@gmail.com>2015-01-05 10:02:07 +0100
commit16b9f666e790a2b939f7890b39cc6e4cf2552165 (patch)
treeee936b06d15e75e12b175f6786772781aff32cd8 /src/include
parente16c4ff76e7eff2da88bcbef5d05dd4ba11e7203 (diff)
parentc3ed35f5cc8e2617e61747e904dbaa652d1cc2c8 (diff)
downloadpx4-firmware-16b9f666e790a2b939f7890b39cc6e4cf2552165.tar.gz
px4-firmware-16b9f666e790a2b939f7890b39cc6e4cf2552165.tar.bz2
px4-firmware-16b9f666e790a2b939f7890b39cc6e4cf2552165.zip
Merge remote-tracking branch 'upstream/master' into dev_ros
Conflicts: src/lib/mathlib/math/Matrix.hpp src/modules/mc_att_control/mc_att_control_main.cpp src/modules/uORB/topics/vehicle_status.h src/platforms/px4_includes.h
Diffstat (limited to 'src/include')
-rw-r--r--src/include/mavlink/mavlink_log.h36
1 files changed, 34 insertions, 2 deletions
diff --git a/src/include/mavlink/mavlink_log.h b/src/include/mavlink/mavlink_log.h
index 6d56c546a..4962d029d 100644
--- a/src/include/mavlink/mavlink_log.h
+++ b/src/include/mavlink/mavlink_log.h
@@ -1,6 +1,6 @@
/****************************************************************************
*
- * Copyright (c) 2012-2014 PX4 Development Team. All rights reserved.
+ * Copyright (c) 2012-2015 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -35,7 +35,7 @@
* @file mavlink_log.h
* MAVLink text logging.
*
- * @author Lorenz Meier <lm@inf.ethz.ch>
+ * @author Lorenz Meier <lorenz@px4.io>
*/
#ifndef MAVLINK_LOG
@@ -99,6 +99,38 @@ __EXPORT void mavlink_vasprintf(int _fd, int severity, const char *fmt, ...);
*/
#define mavlink_log_info(_fd, _text, ...) mavlink_vasprintf(_fd, MAVLINK_IOC_SEND_TEXT_INFO, _text, ##__VA_ARGS__);
+/**
+ * Send a mavlink emergency message and print to console.
+ *
+ * @param _fd A file descriptor returned from open(MAVLINK_LOG_DEVICE, 0);
+ * @param _text The text to log;
+ */
+#define mavlink_and_console_log_emergency(_fd, _text, ...) mavlink_vasprintf(_fd, MAVLINK_IOC_SEND_TEXT_EMERGENCY, _text, ##__VA_ARGS__); \
+ fprintf(stderr, "telem> "); \
+ fprintf(stderr, _text, ##__VA_ARGS__); \
+ fprintf(stderr, "\n");
+
+/**
+ * Send a mavlink critical message and print to console.
+ *
+ * @param _fd A file descriptor returned from open(MAVLINK_LOG_DEVICE, 0);
+ * @param _text The text to log;
+ */
+#define mavlink_and_console_log_critical(_fd, _text, ...) mavlink_vasprintf(_fd, MAVLINK_IOC_SEND_TEXT_CRITICAL, _text, ##__VA_ARGS__); \
+ fprintf(stderr, "telem> "); \
+ fprintf(stderr, _text, ##__VA_ARGS__); \
+ fprintf(stderr, "\n");
+
+/**
+ * Send a mavlink emergency message and print to console.
+ *
+ * @param _fd A file descriptor returned from open(MAVLINK_LOG_DEVICE, 0);
+ * @param _text The text to log;
+ */
+#define mavlink_and_console_log_info(_fd, _text, ...) mavlink_vasprintf(_fd, MAVLINK_IOC_SEND_TEXT_INFO, _text, ##__VA_ARGS__); \
+ fprintf(stderr, "telem> "); \
+ fprintf(stderr, _text, ##__VA_ARGS__); \
+ fprintf(stderr, "\n");
struct mavlink_logmessage {
char text[MAVLINK_LOG_MAXLEN + 1];