mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 02:36:37 +08:00
mavlink_log: support telem printfs on QURT
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
*
|
*
|
||||||
* Copyright (c) 2012-2015 PX4 Development Team. All rights reserved.
|
* Copyright (c) 2012-2016 PX4 Development Team. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -107,9 +107,9 @@ __EXPORT void mavlink_vasprintf(int _fd, int severity, const char *fmt, ...);
|
|||||||
* @param _text The text to log;
|
* @param _text The text to log;
|
||||||
*/
|
*/
|
||||||
#define mavlink_and_console_log_emergency(_fd, _text, ...) do { mavlink_vasprintf(_fd, MAVLINK_IOC_SEND_TEXT_EMERGENCY, _text, ##__VA_ARGS__); \
|
#define mavlink_and_console_log_emergency(_fd, _text, ...) do { mavlink_vasprintf(_fd, MAVLINK_IOC_SEND_TEXT_EMERGENCY, _text, ##__VA_ARGS__); \
|
||||||
fprintf(stderr, "telem> "); \
|
PX4_ERR("telem> "); \
|
||||||
fprintf(stderr, _text, ##__VA_ARGS__); \
|
PX4_ERR(_text, ##__VA_ARGS__); \
|
||||||
fprintf(stderr, "\n"); } while(0);
|
PX4_ERR("\n"); } while(0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a mavlink critical message and print to console.
|
* Send a mavlink critical message and print to console.
|
||||||
@@ -118,9 +118,9 @@ __EXPORT void mavlink_vasprintf(int _fd, int severity, const char *fmt, ...);
|
|||||||
* @param _text The text to log;
|
* @param _text The text to log;
|
||||||
*/
|
*/
|
||||||
#define mavlink_and_console_log_critical(_fd, _text, ...) do { mavlink_vasprintf(_fd, MAVLINK_IOC_SEND_TEXT_CRITICAL, _text, ##__VA_ARGS__); \
|
#define mavlink_and_console_log_critical(_fd, _text, ...) do { mavlink_vasprintf(_fd, MAVLINK_IOC_SEND_TEXT_CRITICAL, _text, ##__VA_ARGS__); \
|
||||||
fprintf(stderr, "telem> "); \
|
PX4_WARN("telem> "); \
|
||||||
fprintf(stderr, _text, ##__VA_ARGS__); \
|
PX4_WARN(_text, ##__VA_ARGS__); \
|
||||||
fprintf(stderr, "\n"); } while(0);
|
PX4_WARN("\n"); } while(0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a mavlink emergency message and print to console.
|
* Send a mavlink emergency message and print to console.
|
||||||
@@ -129,9 +129,9 @@ __EXPORT void mavlink_vasprintf(int _fd, int severity, const char *fmt, ...);
|
|||||||
* @param _text The text to log;
|
* @param _text The text to log;
|
||||||
*/
|
*/
|
||||||
#define mavlink_and_console_log_info(_fd, _text, ...) do { mavlink_vasprintf(_fd, MAVLINK_IOC_SEND_TEXT_INFO, _text, ##__VA_ARGS__); \
|
#define mavlink_and_console_log_info(_fd, _text, ...) do { mavlink_vasprintf(_fd, MAVLINK_IOC_SEND_TEXT_INFO, _text, ##__VA_ARGS__); \
|
||||||
fprintf(stderr, "telem> "); \
|
PX4_INFO("telem> "); \
|
||||||
fprintf(stderr, _text, ##__VA_ARGS__); \
|
PX4_INFO(_text, ##__VA_ARGS__); \
|
||||||
fprintf(stderr, "\n"); } while(0);
|
PX4_INFO("\n"); } while(0);
|
||||||
|
|
||||||
struct mavlink_logmessage {
|
struct mavlink_logmessage {
|
||||||
char text[MAVLINK_LOG_MAXLEN + 1];
|
char text[MAVLINK_LOG_MAXLEN + 1];
|
||||||
|
|||||||
Reference in New Issue
Block a user