QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
MAVLinkStreamConfig.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QList>
7
9{
10public:
11 using SetMessageIntervalCb = std::function<void(int messageId, int rate)>;
12
13 MAVLinkStreamConfig(const SetMessageIntervalCb &messageIntervalCb);
15
19
20 void restoreDefaults();
21
23private:
24 enum class State {
25 Idle,
26 RestoringDefaults,
27 Configuring
28 };
29
30 struct DesiredStreamRate {
31 const int messageId = 0;
32 const int rate = 0;
33 };
34
35 void restoreNextDefault();
36 void nextDesiredRate();
37 void setNextState(State state);
38
39 State _state{State::Idle};
40 QList<DesiredStreamRate> _desiredRates;
41 QList<int> _changedIds;
42
43 State _nextState{State::Idle};
44 QList<DesiredStreamRate> _nextDesiredRates;
45
46 const SetMessageIntervalCb _messageIntervalCb;
47};
Allows to configure a set of mavlink streams to a specific rate, and restore back to default.
std::function< void(int messageId, int rate)> SetMessageIntervalCb