From 51c8f64e9832b81b46bd4f38b701eb8e2f6501e1 Mon Sep 17 00:00:00 2001 From: tumbili Date: Tue, 23 Jun 2015 23:43:24 +0200 Subject: [PATCH] improve mavlink verbosity --- src/modules/mavlink/mavlink_main.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/modules/mavlink/mavlink_main.cpp b/src/modules/mavlink/mavlink_main.cpp index 55aa2595f7..c8427592d8 100644 --- a/src/modules/mavlink/mavlink_main.cpp +++ b/src/modules/mavlink/mavlink_main.cpp @@ -1673,15 +1673,28 @@ Mavlink::task_main(int argc, char *argv[]) if (_subscribe_to_stream != nullptr) { if (OK == configure_stream(_subscribe_to_stream, _subscribe_to_stream_rate)) { if (_subscribe_to_stream_rate > 0.0f) { - warnx("stream %s on device %s enabled with rate %.1f Hz", _subscribe_to_stream, _device_name, - (double)_subscribe_to_stream_rate); + if ( get_protocol() == SERIAL ) { + warnx("stream %s on device %s enabled with rate %.1f Hz", _subscribe_to_stream, _device_name, + (double)_subscribe_to_stream_rate); + } else if ( get_protocol() == UDP ) { + warnx("stream %s on UDP port %d enabled with rate %.1f Hz", _subscribe_to_stream, _network_port, + (double)_subscribe_to_stream_rate); + } } else { - warnx("stream %s on device %s disabled", _subscribe_to_stream, _device_name); + if ( get_protocol() == SERIAL ) { + warnx("stream %s on device %s disabled", _subscribe_to_stream, _device_name); + } else if ( get_protocol() == UDP ) { + warnx("stream %s on UDP port %d disabled", _subscribe_to_stream, _network_port); + } } } else { - warnx("stream %s on device %s not found", _subscribe_to_stream, _device_name); + if ( get_protocol() == SERIAL ) { + warnx("stream %s on device %s not found", _subscribe_to_stream, _device_name); + } else if ( get_protocol() == UDP ) { + warnx("stream %s on UDP port %d not found", _subscribe_to_stream, _network_port); + } } _subscribe_to_stream = nullptr;