Browse Source

GCS_MAVLink: panic in SITL if we fail to write to uart

master
Peter Barker 6 years ago committed by Andrew Tridgell
parent
commit
4d46c801f2
  1. 9
      libraries/GCS_MAVLink/GCS_MAVLink.cpp

9
libraries/GCS_MAVLink/GCS_MAVLink.cpp

@ -145,7 +145,14 @@ void comm_send_buffer(mavlink_channel_t chan, const uint8_t *buf, uint8_t len) @@ -145,7 +145,14 @@ void comm_send_buffer(mavlink_channel_t chan, const uint8_t *buf, uint8_t len)
// an alternative protocol is active
return;
}
mavlink_comm_port[chan]->write(buf, len);
const size_t written = mavlink_comm_port[chan]->write(buf, len);
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
if (written < len) {
AP_HAL::panic("Short write on UART: %d < %u", written, len);
}
#else
(void)written;
#endif
}
/*

Loading…
Cancel
Save