From 3ceccfc6a24de60ee371cd265119e851954d8e1c Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Tue, 12 Nov 2019 04:48:40 +0300 Subject: [PATCH] mavlink_receiver: simplify and fix statustext.severity handling --- src/modules/mavlink/mavlink_receiver.cpp | 25 +----------------------- 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/modules/mavlink/mavlink_receiver.cpp b/src/modules/mavlink/mavlink_receiver.cpp index 299a883e6bec..cd27a6909003 100644 --- a/src/modules/mavlink/mavlink_receiver.cpp +++ b/src/modules/mavlink/mavlink_receiver.cpp @@ -2481,30 +2481,7 @@ void MavlinkReceiver::handle_message_statustext(mavlink_message_t *msg) struct log_message_s log_message; - switch (statustext.severity) { - case MAV_SEVERITY_EMERGENCY: - case MAV_SEVERITY_ALERT: - case MAV_SEVERITY_CRITICAL: - log_message.severity = 0; - break; - - case MAV_SEVERITY_ERROR: - log_message.severity = 3; - break; - - case MAV_SEVERITY_WARNING: - log_message.severity = 4; - break; - - case MAV_SEVERITY_NOTICE: - case MAV_SEVERITY_INFO: - log_message.severity = 6; - break; - - default: - return; - } - + log_message.severity = statustext.severity; log_message.timestamp = hrt_absolute_time(); snprintf((char *)log_message.text, sizeof(log_message.text),