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

mavlink / MAVSDK / 11452150858

22 Oct 2024 02:32AM CUT coverage: 37.403% (+0.02%) from 37.381%
11452150858

push

github

web-flow
camera_server: prevent double ack+message (#2430)

It turns out we were sending the ack and message for storage information
as well as capture status twice, once directly in the request handler
callback, and once the MAVSDK user would call the respond function.

We should only call it in the respond function, not in the callback.

11105 of 29690 relevant lines covered (37.4%)

255.6 hits per line

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

0.0
/src/mavsdk/plugins/arm_authorizer_server/arm_authorizer_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/arm_authorizer_server/arm_authorizer_server.proto)
5

6
#include <iomanip>
7

8
#include "arm_authorizer_server_impl.h"
9
#include "plugins/arm_authorizer_server/arm_authorizer_server.h"
10

11
namespace mavsdk {
12

13
ArmAuthorizerServer::ArmAuthorizerServer(std::shared_ptr<ServerComponent> server_component) :
×
14
    ServerPluginBase(),
15
    _impl{std::make_unique<ArmAuthorizerServerImpl>(server_component)}
×
16
{}
×
17

18
ArmAuthorizerServer::~ArmAuthorizerServer() {}
×
19

20
ArmAuthorizerServer::ArmAuthorizationHandle
21
ArmAuthorizerServer::subscribe_arm_authorization(const ArmAuthorizationCallback& callback)
×
22
{
23
    return _impl->subscribe_arm_authorization(callback);
×
24
}
25

26
void ArmAuthorizerServer::unsubscribe_arm_authorization(ArmAuthorizationHandle handle)
×
27
{
28
    _impl->unsubscribe_arm_authorization(handle);
×
29
}
×
30

31
ArmAuthorizerServer::Result
32
ArmAuthorizerServer::accept_arm_authorization(int32_t valid_time_s) const
×
33
{
34
    return _impl->accept_arm_authorization(valid_time_s);
×
35
}
36

37
ArmAuthorizerServer::Result ArmAuthorizerServer::reject_arm_authorization(
×
38
    bool temporarily, RejectionReason reason, int32_t extra_info) const
39
{
40
    return _impl->reject_arm_authorization(temporarily, reason, extra_info);
×
41
}
42

43
std::ostream& operator<<(std::ostream& str, ArmAuthorizerServer::Result const& result)
×
44
{
45
    switch (result) {
×
46
        case ArmAuthorizerServer::Result::Unknown:
×
47
            return str << "Unknown";
×
48
        case ArmAuthorizerServer::Result::Success:
×
49
            return str << "Success";
×
50
        case ArmAuthorizerServer::Result::Failed:
×
51
            return str << "Failed";
×
52
        default:
×
53
            return str << "Unknown";
×
54
    }
55
}
56

57
std::ostream&
58
operator<<(std::ostream& str, ArmAuthorizerServer::RejectionReason const& rejection_reason)
×
59
{
60
    switch (rejection_reason) {
×
61
        case ArmAuthorizerServer::RejectionReason::Generic:
×
62
            return str << "Generic";
×
63
        case ArmAuthorizerServer::RejectionReason::None:
×
64
            return str << "None";
×
65
        case ArmAuthorizerServer::RejectionReason::InvalidWaypoint:
×
66
            return str << "Invalid Waypoint";
×
67
        case ArmAuthorizerServer::RejectionReason::Timeout:
×
68
            return str << "Timeout";
×
69
        case ArmAuthorizerServer::RejectionReason::AirspaceInUse:
×
70
            return str << "Airspace In Use";
×
71
        case ArmAuthorizerServer::RejectionReason::BadWeather:
×
72
            return str << "Bad Weather";
×
73
        default:
×
74
            return str << "Unknown";
×
75
    }
76
}
77

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

© 2025 Coveralls, Inc