• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mavlink / MAVSDK / 24114167644

08 Apr 2026 02:17AM UTC coverage: 50.468% (+0.003%) from 50.465%
24114167644

push

github

web-flow
core: hide symbols by default, export only public API (#2855)

* core: hide symbols by default, export only public API

Backport of #2824 to v3. Fixes segfault when MAVSDK is used alongside
ROS2 (or any library sharing bundled dependencies like OpenSSL/tinyxml2)
due to symbol conflicts from leaked third-party symbols.

- Add mavsdk_export.h with MAVSDK_PUBLIC, MAVSDK_TEST_EXPORT, and
  MAVSDK_TEMPL_INST macros
- Set CXX_VISIBILITY_PRESET=hidden and VISIBILITY_INLINES_HIDDEN=ON
- MAVSDK_SHARED compile definition gates dllexport/dllimport so that
  static builds on Windows are unaffected
- Annotate all public classes, free functions, operator overloads,
  and explicit template instantiations
- Update jinja2 templates to emit MAVSDK_PUBLIC on generated
  operator== and operator<< definitions
- Disable MSVC C4251 warning for DLL interface on STL members

Fixes #2852

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: remove stale asio includes from mission transfer client header

The backport patch incorrectly added asio includes that don't exist on
v3 (they were added on main after v3 branched).

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

15 of 379 new or added lines in 39 files covered. (3.96%)

4 existing lines in 3 files now uncovered.

19248 of 38139 relevant lines covered (50.47%)

672.95 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

25.26
/src/mavsdk/plugins/ftp/ftp.cpp
1
// WARNING: THIS FILE IS AUTOGENERATED! As such, it should not be edited.
2
// Edits need to be made to the proto files
3
// (see https://github.com/mavlink/MAVSDK-Proto/blob/master/protos/ftp/ftp.proto)
4

5
#include <iomanip>
6

7
#include "ftp_impl.h"
8
#include "plugins/ftp/ftp.h"
9

10
namespace mavsdk {
11

12
using ListDirectoryData = Ftp::ListDirectoryData;
13
using ProgressData = Ftp::ProgressData;
14

15
Ftp::Ftp(System& system) : PluginBase(), _impl{std::make_unique<FtpImpl>(system)} {}
×
16

17
Ftp::Ftp(std::shared_ptr<System> system) : PluginBase(), _impl{std::make_unique<FtpImpl>(system)} {}
24✔
18

19
Ftp::~Ftp() {}
24✔
20

21
void Ftp::download_async(
14✔
22
    std::string remote_file_path,
23
    std::string local_dir,
24
    bool use_burst,
25
    const DownloadCallback& callback)
26
{
27
    _impl->download_async(remote_file_path, local_dir, use_burst, callback);
14✔
28
}
14✔
29

30
void Ftp::upload_async(
7✔
31
    std::string local_file_path, std::string remote_dir, const UploadCallback& callback)
32
{
33
    _impl->upload_async(local_file_path, remote_dir, callback);
7✔
34
}
7✔
35

36
void Ftp::list_directory_async(std::string remote_dir, const ListDirectoryCallback callback)
×
37
{
38
    _impl->list_directory_async(remote_dir, callback);
×
39
}
×
40

41
std::pair<Ftp::Result, Ftp::ListDirectoryData> Ftp::list_directory(std::string remote_dir) const
2✔
42
{
43
    return _impl->list_directory(remote_dir);
2✔
44
}
45

46
void Ftp::create_directory_async(std::string remote_dir, const ResultCallback callback)
×
47
{
48
    _impl->create_directory_async(remote_dir, callback);
×
49
}
×
50

51
Ftp::Result Ftp::create_directory(std::string remote_dir) const
3✔
52
{
53
    return _impl->create_directory(remote_dir);
3✔
54
}
55

56
void Ftp::remove_directory_async(std::string remote_dir, const ResultCallback callback)
×
57
{
58
    _impl->remove_directory_async(remote_dir, callback);
×
59
}
×
60

61
Ftp::Result Ftp::remove_directory(std::string remote_dir) const
2✔
62
{
63
    return _impl->remove_directory(remote_dir);
2✔
64
}
65

66
void Ftp::remove_file_async(std::string remote_file_path, const ResultCallback callback)
×
67
{
68
    _impl->remove_file_async(remote_file_path, callback);
×
69
}
×
70

71
Ftp::Result Ftp::remove_file(std::string remote_file_path) const
4✔
72
{
73
    return _impl->remove_file(remote_file_path);
4✔
74
}
75

76
void Ftp::rename_async(
×
77
    std::string remote_from_path, std::string remote_to_path, const ResultCallback callback)
78
{
79
    _impl->rename_async(remote_from_path, remote_to_path, callback);
×
80
}
×
81

82
Ftp::Result Ftp::rename(std::string remote_from_path, std::string remote_to_path) const
2✔
83
{
84
    return _impl->rename(remote_from_path, remote_to_path);
2✔
85
}
86

87
void Ftp::are_files_identical_async(
×
88
    std::string local_file_path,
89
    std::string remote_file_path,
90
    const AreFilesIdenticalCallback callback)
91
{
92
    _impl->are_files_identical_async(local_file_path, remote_file_path, callback);
×
93
}
×
94

95
std::pair<Ftp::Result, bool>
96
Ftp::are_files_identical(std::string local_file_path, std::string remote_file_path) const
3✔
97
{
98
    return _impl->are_files_identical(local_file_path, remote_file_path);
3✔
99
}
100

101
Ftp::Result Ftp::set_target_compid(uint32_t compid) const
×
102
{
103
    return _impl->set_target_compid(compid);
×
104
}
105

NEW
106
MAVSDK_PUBLIC bool operator==(const Ftp::ListDirectoryData& lhs, const Ftp::ListDirectoryData& rhs)
×
107
{
108
    return (rhs.dirs == lhs.dirs) && (rhs.files == lhs.files);
×
109
}
110

111
MAVSDK_PUBLIC std::ostream&
NEW
112
operator<<(std::ostream& str, Ftp::ListDirectoryData const& list_directory_data)
×
113
{
114
    str << std::setprecision(15);
×
115
    str << "list_directory_data:" << '\n' << "{\n";
×
116
    str << "    dirs: [";
×
117
    for (auto it = list_directory_data.dirs.begin(); it != list_directory_data.dirs.end(); ++it) {
×
118
        str << *it;
×
119
        str << (it + 1 != list_directory_data.dirs.end() ? ", " : "]\n");
×
120
    }
121
    str << "    files: [";
×
122
    for (auto it = list_directory_data.files.begin(); it != list_directory_data.files.end(); ++it) {
×
123
        str << *it;
×
124
        str << (it + 1 != list_directory_data.files.end() ? ", " : "]\n");
×
125
    }
126
    str << '}';
×
127
    return str;
×
128
}
129

NEW
130
MAVSDK_PUBLIC bool operator==(const Ftp::ProgressData& lhs, const Ftp::ProgressData& rhs)
×
131
{
132
    return (rhs.bytes_transferred == lhs.bytes_transferred) && (rhs.total_bytes == lhs.total_bytes);
×
133
}
134

NEW
135
MAVSDK_PUBLIC std::ostream& operator<<(std::ostream& str, Ftp::ProgressData const& progress_data)
×
136
{
137
    str << std::setprecision(15);
×
138
    str << "progress_data:" << '\n' << "{\n";
×
139
    str << "    bytes_transferred: " << progress_data.bytes_transferred << '\n';
×
140
    str << "    total_bytes: " << progress_data.total_bytes << '\n';
×
141
    str << '}';
×
142
    return str;
×
143
}
144

145
MAVSDK_PUBLIC std::ostream& operator<<(std::ostream& str, Ftp::Result const& result)
1✔
146
{
147
    switch (result) {
1✔
148
        case Ftp::Result::Unknown:
×
149
            return str << "Unknown";
×
150
        case Ftp::Result::Success:
×
151
            return str << "Success";
×
152
        case Ftp::Result::Next:
×
153
            return str << "Next";
×
154
        case Ftp::Result::Timeout:
1✔
155
            return str << "Timeout";
1✔
156
        case Ftp::Result::Busy:
×
157
            return str << "Busy";
×
158
        case Ftp::Result::FileIoError:
×
159
            return str << "File Io Error";
×
160
        case Ftp::Result::FileExists:
×
161
            return str << "File Exists";
×
162
        case Ftp::Result::FileDoesNotExist:
×
163
            return str << "File Does Not Exist";
×
164
        case Ftp::Result::FileProtected:
×
165
            return str << "File Protected";
×
166
        case Ftp::Result::InvalidParameter:
×
167
            return str << "Invalid Parameter";
×
168
        case Ftp::Result::Unsupported:
×
169
            return str << "Unsupported";
×
170
        case Ftp::Result::ProtocolError:
×
171
            return str << "Protocol Error";
×
172
        case Ftp::Result::NoSystem:
×
173
            return str << "No System";
×
174
        default:
×
175
            return str << "Unknown";
×
176
    }
177
}
178

179
} // namespace mavsdk
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc