-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsystem.cpp
53 lines (41 loc) · 1.2 KB
/
system.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "system.h"
#include "global_include.h"
#include "mavsdk_impl.h"
#include "mavlink_include.h"
#include "system_impl.h"
#include "plugin_impl_base.h"
#include <functional>
#include <algorithm>
// Set to 1 to log incoming/outgoing mavlink messages.
#define MESSAGE_DEBUGGING 0
namespace mavsdk {
using namespace std::placeholders; // for `_1`
System::System(MavsdkImpl& parent, uint8_t system_id, uint8_t component_id, bool connected) :
_system_impl(std::make_shared<SystemImpl>(parent, system_id, component_id, connected))
{}
System::~System() {}
bool System::is_connected() const
{
return _system_impl->is_connected();
}
uint8_t System::get_system_id() const
{
return _system_impl->get_target_system_id();
}
uint8_t System::get_component_id() const
{
return _system_impl->get_target_component_id();
}
void System::subscribe_is_connected(IsConnectedCallback callback)
{
return _system_impl->subscribe_is_connected(callback);
}
void System::register_component_discovered_callback(discover_callback_t callback) const
{
return _system_impl->register_component_discovered_callback(callback);
}
void System::enable_timesync()
{
_system_impl->enable_timesync();
}
} // namespace mavsdk