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

mavlink / MAVSDK / 21640460786

03 Feb 2026 05:24PM UTC coverage: 48.976% (-0.1%) from 49.079%
21640460786

Pull #2761

github

web-flow
Merge 7cfecc1f5 into 0bbbe3676
Pull Request #2761: Expanded capabilities for setting flight mode

1 of 91 new or added lines in 2 files covered. (1.1%)

5 existing lines in 3 files now uncovered.

18313 of 37392 relevant lines covered (48.98%)

663.35 hits per line

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

5.48
/src/mavsdk/plugins/action_server/action_server.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
4
// https://github.com/mavlink/MAVSDK-Proto/blob/master/protos/action_server/action_server.proto)
5

6
#include <iomanip>
7

8
#include "action_server_impl.h"
9
#include "plugins/action_server/action_server.h"
10

11
namespace mavsdk {
12

13
using AllowableFlightModes = ActionServer::AllowableFlightModes;
14
using ArmDisarm = ActionServer::ArmDisarm;
15

16
ActionServer::ActionServer(std::shared_ptr<ServerComponent> server_component) :
1✔
17
    ServerPluginBase(),
18
    _impl{std::make_unique<ActionServerImpl>(server_component)}
1✔
19
{}
1✔
20

21
ActionServer::~ActionServer() {}
1✔
22

23
ActionServer::ArmDisarmHandle ActionServer::subscribe_arm_disarm(const ArmDisarmCallback& callback)
×
24
{
25
    return _impl->subscribe_arm_disarm(callback);
×
26
}
27

28
void ActionServer::unsubscribe_arm_disarm(ArmDisarmHandle handle)
×
29
{
30
    _impl->unsubscribe_arm_disarm(handle);
×
31
}
×
32

33
ActionServer::FlightModeChangeHandle
34
ActionServer::subscribe_flight_mode_change(const FlightModeChangeCallback& callback)
×
35
{
36
    return _impl->subscribe_flight_mode_change(callback);
×
37
}
38

39
void ActionServer::unsubscribe_flight_mode_change(FlightModeChangeHandle handle)
×
40
{
41
    _impl->unsubscribe_flight_mode_change(handle);
×
42
}
×
43

44
ActionServer::TakeoffHandle ActionServer::subscribe_takeoff(const TakeoffCallback& callback)
×
45
{
46
    return _impl->subscribe_takeoff(callback);
×
47
}
48

49
void ActionServer::unsubscribe_takeoff(TakeoffHandle handle)
×
50
{
51
    _impl->unsubscribe_takeoff(handle);
×
52
}
×
53

54
ActionServer::LandHandle ActionServer::subscribe_land(const LandCallback& callback)
×
55
{
56
    return _impl->subscribe_land(callback);
×
57
}
58

59
void ActionServer::unsubscribe_land(LandHandle handle)
×
60
{
61
    _impl->unsubscribe_land(handle);
×
62
}
×
63

64
ActionServer::RebootHandle ActionServer::subscribe_reboot(const RebootCallback& callback)
×
65
{
66
    return _impl->subscribe_reboot(callback);
×
67
}
68

69
void ActionServer::unsubscribe_reboot(RebootHandle handle)
×
70
{
71
    _impl->unsubscribe_reboot(handle);
×
72
}
×
73

74
ActionServer::ShutdownHandle ActionServer::subscribe_shutdown(const ShutdownCallback& callback)
×
75
{
76
    return _impl->subscribe_shutdown(callback);
×
77
}
78

79
void ActionServer::unsubscribe_shutdown(ShutdownHandle handle)
×
80
{
81
    _impl->unsubscribe_shutdown(handle);
×
82
}
×
83

84
ActionServer::TerminateHandle ActionServer::subscribe_terminate(const TerminateCallback& callback)
×
85
{
86
    return _impl->subscribe_terminate(callback);
×
87
}
88

89
void ActionServer::unsubscribe_terminate(TerminateHandle handle)
×
90
{
91
    _impl->unsubscribe_terminate(handle);
×
92
}
×
93

94
ActionServer::Result ActionServer::set_allow_takeoff(bool allow_takeoff) const
×
95
{
96
    return _impl->set_allow_takeoff(allow_takeoff);
×
97
}
98

99
ActionServer::Result ActionServer::set_armable(bool armable, bool force_armable) const
1✔
100
{
101
    return _impl->set_armable(armable, force_armable);
1✔
102
}
103

104
ActionServer::Result ActionServer::set_disarmable(bool disarmable, bool force_disarmable) const
1✔
105
{
106
    return _impl->set_disarmable(disarmable, force_disarmable);
1✔
107
}
108

109
ActionServer::Result
110
ActionServer::set_allowable_flight_modes(AllowableFlightModes flight_modes) const
×
111
{
112
    return _impl->set_allowable_flight_modes(flight_modes);
×
113
}
114

115
ActionServer::AllowableFlightModes ActionServer::get_allowable_flight_modes() const
×
116
{
117
    return _impl->get_allowable_flight_modes();
×
118
}
119

120
ActionServer::Result ActionServer::set_armed_state(bool is_armed) const
×
121
{
122
    return _impl->set_armed_state(is_armed);
×
123
}
124

125
ActionServer::Result ActionServer::set_flight_mode(FlightMode flight_mode) const
×
126
{
127
    return _impl->set_flight_mode(flight_mode);
×
128
}
129

NEW
130
ActionServer::Result ActionServer::set_flight_mode_internal(FlightMode flight_mode) const
×
131
{
NEW
132
    return _impl->set_flight_mode_internal(flight_mode);
×
133
}
134

UNCOV
135
bool operator==(
×
136
    const ActionServer::AllowableFlightModes& lhs, const ActionServer::AllowableFlightModes& rhs)
137
{
138
    return (rhs.can_auto_mode == lhs.can_auto_mode) &&
×
139
           (rhs.can_guided_mode == lhs.can_guided_mode) &&
×
NEW
140
           (rhs.can_stabilize_mode == lhs.can_stabilize_mode) &&
×
NEW
141
           (rhs.can_auto_rtl_mode == lhs.can_auto_rtl_mode) &&
×
NEW
142
           (rhs.can_auto_takeoff_mode == lhs.can_auto_takeoff_mode) &&
×
NEW
143
           (rhs.can_auto_land_mode == lhs.can_auto_land_mode) &&
×
NEW
144
           (rhs.can_auto_loiter_mode == lhs.can_auto_loiter_mode);
×
145
}
146

147
std::ostream&
148
operator<<(std::ostream& str, ActionServer::AllowableFlightModes const& allowable_flight_modes)
×
149
{
150
    str << std::setprecision(15);
×
151
    str << "allowable_flight_modes:" << '\n' << "{\n";
×
152
    str << "    can_auto_mode: " << allowable_flight_modes.can_auto_mode << '\n';
×
153
    str << "    can_guided_mode: " << allowable_flight_modes.can_guided_mode << '\n';
×
154
    str << "    can_stabilize_mode: " << allowable_flight_modes.can_stabilize_mode << '\n';
×
NEW
155
    str << "    can_auto_rtl_mode: " << allowable_flight_modes.can_auto_rtl_mode << '\n';
×
NEW
156
    str << "    can_auto_takeoff_mode: " << allowable_flight_modes.can_auto_takeoff_mode << '\n';
×
NEW
157
    str << "    can_auto_land_mode: " << allowable_flight_modes.can_auto_land_mode << '\n';
×
NEW
158
    str << "    can_auto_loiter_mode: " << allowable_flight_modes.can_auto_loiter_mode << '\n';
×
159
    str << '}';
×
160
    return str;
×
161
}
162

163
bool operator==(const ActionServer::ArmDisarm& lhs, const ActionServer::ArmDisarm& rhs)
×
164
{
165
    return (rhs.arm == lhs.arm) && (rhs.force == lhs.force);
×
166
}
167

168
std::ostream& operator<<(std::ostream& str, ActionServer::ArmDisarm const& arm_disarm)
×
169
{
170
    str << std::setprecision(15);
×
171
    str << "arm_disarm:" << '\n' << "{\n";
×
172
    str << "    arm: " << arm_disarm.arm << '\n';
×
173
    str << "    force: " << arm_disarm.force << '\n';
×
174
    str << '}';
×
175
    return str;
×
176
}
177

178
std::ostream& operator<<(std::ostream& str, ActionServer::Result const& result)
×
179
{
180
    switch (result) {
×
181
        case ActionServer::Result::Unknown:
×
182
            return str << "Unknown";
×
183
        case ActionServer::Result::Success:
×
184
            return str << "Success";
×
185
        case ActionServer::Result::NoSystem:
×
186
            return str << "No System";
×
187
        case ActionServer::Result::ConnectionError:
×
188
            return str << "Connection Error";
×
189
        case ActionServer::Result::Busy:
×
190
            return str << "Busy";
×
191
        case ActionServer::Result::CommandDenied:
×
192
            return str << "Command Denied";
×
193
        case ActionServer::Result::CommandDeniedLandedStateUnknown:
×
194
            return str << "Command Denied Landed State Unknown";
×
195
        case ActionServer::Result::CommandDeniedNotLanded:
×
196
            return str << "Command Denied Not Landed";
×
197
        case ActionServer::Result::Timeout:
×
198
            return str << "Timeout";
×
199
        case ActionServer::Result::VtolTransitionSupportUnknown:
×
200
            return str << "Vtol Transition Support Unknown";
×
201
        case ActionServer::Result::NoVtolTransitionSupport:
×
202
            return str << "No Vtol Transition Support";
×
203
        case ActionServer::Result::ParameterError:
×
204
            return str << "Parameter Error";
×
205
        case ActionServer::Result::Next:
×
206
            return str << "Next";
×
207
        default:
×
208
            return str << "Unknown";
×
209
    }
210
}
211

212
std::ostream& operator<<(std::ostream& str, ActionServer::FlightMode const& flight_mode)
×
213
{
214
    switch (flight_mode) {
×
215
        case ActionServer::FlightMode::Unknown:
×
216
            return str << "Unknown";
×
217
        case ActionServer::FlightMode::Ready:
×
218
            return str << "Ready";
×
219
        case ActionServer::FlightMode::Takeoff:
×
220
            return str << "Takeoff";
×
221
        case ActionServer::FlightMode::Hold:
×
222
            return str << "Hold";
×
223
        case ActionServer::FlightMode::Mission:
×
224
            return str << "Mission";
×
225
        case ActionServer::FlightMode::ReturnToLaunch:
×
226
            return str << "Return To Launch";
×
227
        case ActionServer::FlightMode::Land:
×
228
            return str << "Land";
×
229
        case ActionServer::FlightMode::Offboard:
×
230
            return str << "Offboard";
×
231
        case ActionServer::FlightMode::FollowMe:
×
232
            return str << "Follow Me";
×
233
        case ActionServer::FlightMode::Manual:
×
234
            return str << "Manual";
×
235
        case ActionServer::FlightMode::Altctl:
×
236
            return str << "Altctl";
×
237
        case ActionServer::FlightMode::Posctl:
×
238
            return str << "Posctl";
×
239
        case ActionServer::FlightMode::Acro:
×
240
            return str << "Acro";
×
241
        case ActionServer::FlightMode::Stabilized:
×
242
            return str << "Stabilized";
×
243
        default:
×
244
            return str << "Unknown";
×
245
    }
246
}
247

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