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

mavlink / MAVSDK / 7317183253

24 Dec 2023 10:25PM UTC coverage: 36.26% (-0.6%) from 36.89%
7317183253

push

github

web-flow
Merge pull request #2088 from tbago/add_more_camera_function

More camera server functionality

28 of 718 new or added lines in 12 files covered. (3.9%)

20 existing lines in 6 files now uncovered.

10035 of 27675 relevant lines covered (36.26%)

127.93 hits per line

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

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

5
#include <iomanip>
6

7
#include "param_server_impl.h"
8
#include "plugins/param_server/param_server.h"
9

10
namespace mavsdk {
11

12
using IntParam = ParamServer::IntParam;
13
using FloatParam = ParamServer::FloatParam;
14
using CustomParam = ParamServer::CustomParam;
15
using AllParams = ParamServer::AllParams;
16

17
ParamServer::ParamServer(std::shared_ptr<ServerComponent> server_component) :
6✔
18
    ServerPluginBase(),
19
    _impl{std::make_unique<ParamServerImpl>(server_component)}
6✔
20
{}
6✔
21

22
ParamServer::~ParamServer() {}
6✔
23

24
std::pair<ParamServer::Result, int32_t> ParamServer::retrieve_param_int(std::string name) const
2✔
25
{
26
    return _impl->retrieve_param_int(name);
2✔
27
}
28

29
ParamServer::Result ParamServer::provide_param_int(std::string name, int32_t value) const
8✔
30
{
31
    return _impl->provide_param_int(name, value);
8✔
32
}
33

34
std::pair<ParamServer::Result, float> ParamServer::retrieve_param_float(std::string name) const
2✔
35
{
36
    return _impl->retrieve_param_float(name);
2✔
37
}
38

39
ParamServer::Result ParamServer::provide_param_float(std::string name, float value) const
8✔
40
{
41
    return _impl->provide_param_float(name, value);
8✔
42
}
43

44
std::pair<ParamServer::Result, std::string>
45
ParamServer::retrieve_param_custom(std::string name) const
2✔
46
{
47
    return _impl->retrieve_param_custom(name);
2✔
48
}
49

50
ParamServer::Result ParamServer::provide_param_custom(std::string name, std::string value) const
8✔
51
{
52
    return _impl->provide_param_custom(name, value);
8✔
53
}
54

55
ParamServer::AllParams ParamServer::retrieve_all_params() const
2✔
56
{
57
    return _impl->retrieve_all_params();
2✔
58
}
59

60
ParamServer::ChangedParamIntHandle
NEW
61
ParamServer::subscribe_changed_param_int(const ChangedParamIntCallback& callback)
×
62
{
NEW
63
    return _impl->subscribe_changed_param_int(callback);
×
64
}
65

NEW
66
void ParamServer::unsubscribe_changed_param_int(ChangedParamIntHandle handle)
×
67
{
NEW
68
    _impl->unsubscribe_changed_param_int(handle);
×
NEW
69
}
×
70

71
ParamServer::ChangedParamFloatHandle
NEW
72
ParamServer::subscribe_changed_param_float(const ChangedParamFloatCallback& callback)
×
73
{
NEW
74
    return _impl->subscribe_changed_param_float(callback);
×
75
}
76

NEW
77
void ParamServer::unsubscribe_changed_param_float(ChangedParamFloatHandle handle)
×
78
{
NEW
79
    _impl->unsubscribe_changed_param_float(handle);
×
NEW
80
}
×
81

82
ParamServer::ChangedParamCustomHandle
NEW
83
ParamServer::subscribe_changed_param_custom(const ChangedParamCustomCallback& callback)
×
84
{
NEW
85
    return _impl->subscribe_changed_param_custom(callback);
×
86
}
87

NEW
88
void ParamServer::unsubscribe_changed_param_custom(ChangedParamCustomHandle handle)
×
89
{
NEW
90
    _impl->unsubscribe_changed_param_custom(handle);
×
NEW
91
}
×
92

UNCOV
93
bool operator==(const ParamServer::IntParam& lhs, const ParamServer::IntParam& rhs)
×
94
{
95
    return (rhs.name == lhs.name) && (rhs.value == lhs.value);
×
96
}
97

98
std::ostream& operator<<(std::ostream& str, ParamServer::IntParam const& int_param)
×
99
{
100
    str << std::setprecision(15);
×
101
    str << "int_param:" << '\n' << "{\n";
×
102
    str << "    name: " << int_param.name << '\n';
×
103
    str << "    value: " << int_param.value << '\n';
×
104
    str << '}';
×
105
    return str;
×
106
}
107

108
bool operator==(const ParamServer::FloatParam& lhs, const ParamServer::FloatParam& rhs)
×
109
{
110
    return (rhs.name == lhs.name) &&
×
111
           ((std::isnan(rhs.value) && std::isnan(lhs.value)) || rhs.value == lhs.value);
×
112
}
113

114
std::ostream& operator<<(std::ostream& str, ParamServer::FloatParam const& float_param)
×
115
{
116
    str << std::setprecision(15);
×
117
    str << "float_param:" << '\n' << "{\n";
×
118
    str << "    name: " << float_param.name << '\n';
×
119
    str << "    value: " << float_param.value << '\n';
×
120
    str << '}';
×
121
    return str;
×
122
}
123

124
bool operator==(const ParamServer::CustomParam& lhs, const ParamServer::CustomParam& rhs)
×
125
{
126
    return (rhs.name == lhs.name) && (rhs.value == lhs.value);
×
127
}
128

129
std::ostream& operator<<(std::ostream& str, ParamServer::CustomParam const& custom_param)
×
130
{
131
    str << std::setprecision(15);
×
132
    str << "custom_param:" << '\n' << "{\n";
×
133
    str << "    name: " << custom_param.name << '\n';
×
134
    str << "    value: " << custom_param.value << '\n';
×
135
    str << '}';
×
136
    return str;
×
137
}
138

139
bool operator==(const ParamServer::AllParams& lhs, const ParamServer::AllParams& rhs)
×
140
{
141
    return (rhs.int_params == lhs.int_params) && (rhs.float_params == lhs.float_params) &&
×
142
           (rhs.custom_params == lhs.custom_params);
×
143
}
144

145
std::ostream& operator<<(std::ostream& str, ParamServer::AllParams const& all_params)
×
146
{
147
    str << std::setprecision(15);
×
148
    str << "all_params:" << '\n' << "{\n";
×
149
    str << "    int_params: [";
×
150
    for (auto it = all_params.int_params.begin(); it != all_params.int_params.end(); ++it) {
×
151
        str << *it;
×
152
        str << (it + 1 != all_params.int_params.end() ? ", " : "]\n");
×
153
    }
154
    str << "    float_params: [";
×
155
    for (auto it = all_params.float_params.begin(); it != all_params.float_params.end(); ++it) {
×
156
        str << *it;
×
157
        str << (it + 1 != all_params.float_params.end() ? ", " : "]\n");
×
158
    }
159
    str << "    custom_params: [";
×
160
    for (auto it = all_params.custom_params.begin(); it != all_params.custom_params.end(); ++it) {
×
161
        str << *it;
×
162
        str << (it + 1 != all_params.custom_params.end() ? ", " : "]\n");
×
163
    }
164
    str << '}';
×
165
    return str;
×
166
}
167

168
std::ostream& operator<<(std::ostream& str, ParamServer::Result const& result)
×
169
{
170
    switch (result) {
×
171
        case ParamServer::Result::Unknown:
×
172
            return str << "Unknown";
×
173
        case ParamServer::Result::Success:
×
174
            return str << "Success";
×
175
        case ParamServer::Result::NotFound:
×
176
            return str << "Not Found";
×
177
        case ParamServer::Result::WrongType:
×
178
            return str << "Wrong Type";
×
179
        case ParamServer::Result::ParamNameTooLong:
×
180
            return str << "Param Name Too Long";
×
181
        case ParamServer::Result::NoSystem:
×
182
            return str << "No System";
×
183
        case ParamServer::Result::ParamValueTooLong:
×
184
            return str << "Param Value Too Long";
×
185
        default:
×
186
            return str << "Unknown";
×
187
    }
188
}
189

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