Skip to content

Commit

Permalink
mavlink_receiver: simplify and fix statustext.severity handling
Browse files Browse the repository at this point in the history
  • Loading branch information
okalachev committed Nov 12, 2019
1 parent cdcbe66 commit 3ceccfc
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions src/modules/mavlink/mavlink_receiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 3ceccfc

Please sign in to comment.