mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-19 00:19:05 +08:00
Iridiumsbd driver: Publish log message when TX buffer is deleted
This commit is contained in:
parent
47567c5c24
commit
44937c3a99
@ -47,6 +47,7 @@
|
||||
#include <systemlib/err.h>
|
||||
#include <systemlib/systemlib.h>
|
||||
#include <systemlib/param/param.h>
|
||||
#include <systemlib/mavlink_log.h>
|
||||
|
||||
#include "drivers/drv_iridiumsbd.h"
|
||||
|
||||
@ -590,7 +591,7 @@ ssize_t IridiumSBD::write(struct file *filp, const char *buffer, size_t buflen)
|
||||
if (*buffer == MAVLINK_PACKAGE_START) {
|
||||
if (SATCOM_TX_BUF_LEN - tx_buf_write_idx - SATCOM_MIN_TX_BUF_SPACE - (*(buffer + 1) + 8) < 0) {
|
||||
tx_buf_write_idx = 0;
|
||||
PX4_INFO("Deleting full TX buffer before writing new message");
|
||||
mavlink_log_critical(&_mavlink_log_pub, "Deleting full TX buffer before writing new message");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -598,7 +599,7 @@ ssize_t IridiumSBD::write(struct file *filp, const char *buffer, size_t buflen)
|
||||
// check and reset the remaining buffer space for any non mavlink messages
|
||||
if (SATCOM_TX_BUF_LEN - tx_buf_write_idx - SATCOM_MIN_TX_BUF_SPACE < 0) {
|
||||
tx_buf_write_idx = 0;
|
||||
PX4_INFO("Deleting full TX buffer");
|
||||
mavlink_log_critical(&_mavlink_log_pub, "Deleting full TX buffer");
|
||||
}
|
||||
|
||||
VERBOSE_INFO("WRITE: LEN %d, TX WRITTEN: %d", buflen, tx_buf_write_idx);
|
||||
|
||||
@ -304,4 +304,6 @@ private:
|
||||
|
||||
pthread_mutex_t tx_buf_mutex = pthread_mutex_t();
|
||||
bool verbose = false;
|
||||
|
||||
orb_advert_t _mavlink_log_pub{nullptr};
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user