mavlink: STATUSTEXT check TX buffer before sending

- Note the TX buffer size check is lazily ignoring the possibility of messages that span multiple Mavlink STATUSTEXT. This at least accommodates the calibration use case and it's no worse than before for longer messages.
This commit is contained in:
Daniel Agar
2020-11-13 09:52:05 -05:00
committed by GitHub
parent e399dbc440
commit 4a6c90b8ea
+2 -2
View File
@@ -508,9 +508,9 @@ protected:
bool send() override
{
if (!_mavlink->get_logbuffer()->empty() && _mavlink->is_connected()) {
if (!_mavlink->get_logbuffer()->empty() && _mavlink->is_connected() && _mavlink->get_free_tx_buf() >= get_size()) {
mavlink_log_s mavlink_log{};
mavlink_log_s mavlink_log;
if (_mavlink->get_logbuffer()->get(&mavlink_log)) {