mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 20:43:33 +08:00
mavlink: use reference instead of pointer to access the MAVLink instance from protocol classes
This commit is contained in:
@@ -77,7 +77,7 @@ MavlinkFtpTest::MavlinkFtpTest() :
|
||||
void MavlinkFtpTest::_init()
|
||||
{
|
||||
_expected_seq_number = 0;
|
||||
_ftp_server = new MavlinkFTP(nullptr);
|
||||
_ftp_server = new MavlinkFTP(_mavlink);
|
||||
_ftp_server->set_unittest_worker(MavlinkFtpTest::receive_message_handler_generic, this);
|
||||
|
||||
_create_test_files();
|
||||
|
||||
@@ -37,12 +37,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <unit_test.h>
|
||||
#ifndef MAVLINK_FTP_UNIT_TEST
|
||||
#include "../mavlink_bridge_header.h"
|
||||
#else
|
||||
#include <mavlink.h>
|
||||
#endif
|
||||
#include "../mavlink_ftp.h"
|
||||
#include "../mavlink_main.h"
|
||||
|
||||
class MavlinkFtpTest : public UnitTest
|
||||
{
|
||||
@@ -130,6 +127,7 @@ private:
|
||||
bool _receive_message_handler_burst(const mavlink_file_transfer_protocol_t *ftp_req, BurstInfo *burst_info);
|
||||
|
||||
MavlinkFTP *_ftp_server;
|
||||
Mavlink _mavlink;
|
||||
uint16_t _expected_seq_number;
|
||||
|
||||
mavlink_file_transfer_protocol_t _reply_msg;
|
||||
|
||||
Reference in New Issue
Block a user