mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 12:13:35 +08:00
Fix a corner case that prevented mavlink config streams from being indexed appropriately when USB is not connected at boot.
Break out Mavlink class constructor logic into set_instance() and set_channel() methods. and add const specifiers and default arguments to Mavlink::mavlink_open_uart().
This commit is contained in:
@@ -83,6 +83,7 @@
|
||||
#include "mavlink_shell.h"
|
||||
#include "mavlink_ulog.h"
|
||||
|
||||
#define DEFAULT_BAUD_RATE 57600
|
||||
#define DEFAULT_REMOTE_PORT_UDP 14550 ///< GCS port per MAVLink spec
|
||||
#define DEFAULT_DEVICE_NAME "/dev/ttyS1"
|
||||
#define HASH_PARAM "_HASH_CHECK"
|
||||
@@ -676,7 +677,9 @@ private:
|
||||
|
||||
void mavlink_update_parameters();
|
||||
|
||||
int mavlink_open_uart(int baudrate, const char *uart_name, bool force_flow_control);
|
||||
int mavlink_open_uart(const int baudrate = DEFAULT_BAUD_RATE,
|
||||
const char *uart_name = DEFAULT_DEVICE_NAME,
|
||||
const bool force_flow_control = false);
|
||||
|
||||
static constexpr unsigned RADIO_BUFFER_CRITICAL_LOW_PERCENTAGE = 25;
|
||||
static constexpr unsigned RADIO_BUFFER_LOW_PERCENTAGE = 35;
|
||||
@@ -731,10 +734,14 @@ private:
|
||||
|
||||
void init_udp();
|
||||
|
||||
void set_channel();
|
||||
|
||||
void set_instance_id();
|
||||
|
||||
/**
|
||||
* Main mavlink task.
|
||||
*/
|
||||
int task_main(int argc, char *argv[]);
|
||||
int task_main(int argc, char *argv[]);
|
||||
|
||||
// Disallow copy construction and move assignment.
|
||||
Mavlink(const Mavlink &) = delete;
|
||||
|
||||
Reference in New Issue
Block a user