• 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

0.0
/src/mavsdk/plugins/info/info.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/info/info.proto)
4

5
#include <iomanip>
6

7
#include "info_impl.h"
8
#include "plugins/info/info.h"
9

10
namespace mavsdk {
11

12
using FlightInfo = Info::FlightInfo;
13
using Identification = Info::Identification;
14
using Product = Info::Product;
15
using Version = Info::Version;
16

17
Info::Info(System& system) : PluginBase(), _impl{std::make_unique<InfoImpl>(system)} {}
×
18

19
Info::Info(std::shared_ptr<System> system) : PluginBase(), _impl{std::make_unique<InfoImpl>(system)}
×
20
{}
×
21

22
Info::~Info() {}
×
23

24
std::pair<Info::Result, Info::FlightInfo> Info::get_flight_information() const
×
25
{
26
    return _impl->get_flight_information();
×
27
}
28

29
std::pair<Info::Result, Info::Identification> Info::get_identification() const
×
30
{
31
    return _impl->get_identification();
×
32
}
33

34
std::pair<Info::Result, Info::Product> Info::get_product() const
×
35
{
36
    return _impl->get_product();
×
37
}
38

39
std::pair<Info::Result, Info::Version> Info::get_version() const
×
40
{
41
    return _impl->get_version();
×
42
}
43

44
std::pair<Info::Result, double> Info::get_speed_factor() const
×
45
{
46
    return _impl->get_speed_factor();
×
47
}
48

49
Info::FlightInformationHandle
50
Info::subscribe_flight_information(const FlightInformationCallback& callback)
×
51
{
52
    return _impl->subscribe_flight_information(callback);
×
53
}
54

55
void Info::unsubscribe_flight_information(FlightInformationHandle handle)
×
56
{
57
    _impl->unsubscribe_flight_information(handle);
×
58
}
×
59

NEW
60
MAVSDK_PUBLIC bool operator==(const Info::FlightInfo& lhs, const Info::FlightInfo& rhs)
×
61
{
62
    return (rhs.time_boot_ms == lhs.time_boot_ms) && (rhs.flight_uid == lhs.flight_uid) &&
×
63
           (rhs.duration_since_arming_ms == lhs.duration_since_arming_ms) &&
×
64
           (rhs.duration_since_takeoff_ms == lhs.duration_since_takeoff_ms);
×
65
}
66

NEW
67
MAVSDK_PUBLIC std::ostream& operator<<(std::ostream& str, Info::FlightInfo const& flight_info)
×
68
{
69
    str << std::setprecision(15);
×
70
    str << "flight_info:" << '\n' << "{\n";
×
71
    str << "    time_boot_ms: " << flight_info.time_boot_ms << '\n';
×
72
    str << "    flight_uid: " << flight_info.flight_uid << '\n';
×
73
    str << "    duration_since_arming_ms: " << flight_info.duration_since_arming_ms << '\n';
×
74
    str << "    duration_since_takeoff_ms: " << flight_info.duration_since_takeoff_ms << '\n';
×
75
    str << '}';
×
76
    return str;
×
77
}
78

NEW
79
MAVSDK_PUBLIC bool operator==(const Info::Identification& lhs, const Info::Identification& rhs)
×
80
{
81
    return (rhs.hardware_uid == lhs.hardware_uid) && (rhs.legacy_uid == lhs.legacy_uid);
×
82
}
83

84
MAVSDK_PUBLIC std::ostream&
NEW
85
operator<<(std::ostream& str, Info::Identification const& identification)
×
86
{
87
    str << std::setprecision(15);
×
88
    str << "identification:" << '\n' << "{\n";
×
89
    str << "    hardware_uid: " << identification.hardware_uid << '\n';
×
90
    str << "    legacy_uid: " << identification.legacy_uid << '\n';
×
91
    str << '}';
×
92
    return str;
×
93
}
94

NEW
95
MAVSDK_PUBLIC bool operator==(const Info::Product& lhs, const Info::Product& rhs)
×
96
{
97
    return (rhs.vendor_id == lhs.vendor_id) && (rhs.vendor_name == lhs.vendor_name) &&
×
98
           (rhs.product_id == lhs.product_id) && (rhs.product_name == lhs.product_name);
×
99
}
100

NEW
101
MAVSDK_PUBLIC std::ostream& operator<<(std::ostream& str, Info::Product const& product)
×
102
{
103
    str << std::setprecision(15);
×
104
    str << "product:" << '\n' << "{\n";
×
105
    str << "    vendor_id: " << product.vendor_id << '\n';
×
106
    str << "    vendor_name: " << product.vendor_name << '\n';
×
107
    str << "    product_id: " << product.product_id << '\n';
×
108
    str << "    product_name: " << product.product_name << '\n';
×
109
    str << '}';
×
110
    return str;
×
111
}
112

NEW
113
MAVSDK_PUBLIC std::ostream& operator<<(
×
114
    std::ostream& str, Info::Version::FlightSoftwareVersionType const& flight_software_version_type)
115
{
116
    switch (flight_software_version_type) {
×
117
        case Info::Version::FlightSoftwareVersionType::Unknown:
×
118
            return str << "Unknown";
×
119
        case Info::Version::FlightSoftwareVersionType::Dev:
×
120
            return str << "Dev";
×
121
        case Info::Version::FlightSoftwareVersionType::Alpha:
×
122
            return str << "Alpha";
×
123
        case Info::Version::FlightSoftwareVersionType::Beta:
×
124
            return str << "Beta";
×
125
        case Info::Version::FlightSoftwareVersionType::Rc:
×
126
            return str << "Rc";
×
127
        case Info::Version::FlightSoftwareVersionType::Release:
×
128
            return str << "Release";
×
129
        default:
×
130
            return str << "Unknown";
×
131
    }
132
}
NEW
133
MAVSDK_PUBLIC bool operator==(const Info::Version& lhs, const Info::Version& rhs)
×
134
{
135
    return (rhs.flight_sw_major == lhs.flight_sw_major) &&
×
136
           (rhs.flight_sw_minor == lhs.flight_sw_minor) &&
×
137
           (rhs.flight_sw_patch == lhs.flight_sw_patch) &&
×
138
           (rhs.flight_sw_vendor_major == lhs.flight_sw_vendor_major) &&
×
139
           (rhs.flight_sw_vendor_minor == lhs.flight_sw_vendor_minor) &&
×
140
           (rhs.flight_sw_vendor_patch == lhs.flight_sw_vendor_patch) &&
×
141
           (rhs.os_sw_major == lhs.os_sw_major) && (rhs.os_sw_minor == lhs.os_sw_minor) &&
×
142
           (rhs.os_sw_patch == lhs.os_sw_patch) &&
×
143
           (rhs.flight_sw_git_hash == lhs.flight_sw_git_hash) &&
×
144
           (rhs.os_sw_git_hash == lhs.os_sw_git_hash) &&
×
145
           (rhs.flight_sw_version_type == lhs.flight_sw_version_type);
×
146
}
147

NEW
148
MAVSDK_PUBLIC std::ostream& operator<<(std::ostream& str, Info::Version const& version)
×
149
{
150
    str << std::setprecision(15);
×
151
    str << "version:" << '\n' << "{\n";
×
152
    str << "    flight_sw_major: " << version.flight_sw_major << '\n';
×
153
    str << "    flight_sw_minor: " << version.flight_sw_minor << '\n';
×
154
    str << "    flight_sw_patch: " << version.flight_sw_patch << '\n';
×
155
    str << "    flight_sw_vendor_major: " << version.flight_sw_vendor_major << '\n';
×
156
    str << "    flight_sw_vendor_minor: " << version.flight_sw_vendor_minor << '\n';
×
157
    str << "    flight_sw_vendor_patch: " << version.flight_sw_vendor_patch << '\n';
×
158
    str << "    os_sw_major: " << version.os_sw_major << '\n';
×
159
    str << "    os_sw_minor: " << version.os_sw_minor << '\n';
×
160
    str << "    os_sw_patch: " << version.os_sw_patch << '\n';
×
161
    str << "    flight_sw_git_hash: " << version.flight_sw_git_hash << '\n';
×
162
    str << "    os_sw_git_hash: " << version.os_sw_git_hash << '\n';
×
163
    str << "    flight_sw_version_type: " << version.flight_sw_version_type << '\n';
×
164
    str << '}';
×
165
    return str;
×
166
}
167

NEW
168
MAVSDK_PUBLIC std::ostream& operator<<(std::ostream& str, Info::Result const& result)
×
169
{
170
    switch (result) {
×
171
        case Info::Result::Unknown:
×
172
            return str << "Unknown";
×
173
        case Info::Result::Success:
×
174
            return str << "Success";
×
175
        case Info::Result::InformationNotReceivedYet:
×
176
            return str << "Information Not Received Yet";
×
177
        case Info::Result::NoSystem:
×
178
            return str << "No System";
×
179
        default:
×
180
            return str << "Unknown";
×
181
    }
182
}
183

184
} // 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