forked from mavlink/MAVSDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinfo.h
104 lines (89 loc) · 2.98 KB
/
info.h
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#pragma once
#include <cstdint>
namespace dronecore {
class InfoImpl;
/**
* @brief The Info class provides basic infomation about the hardware and/or software of a device.
*/
class Info
{
public:
/**
* @brief Constructor (internal use only).
*/
explicit Info(InfoImpl *impl);
/**
* @brief Destructor (internal use only).
*/
~Info();
/**
* @brief Length of git hash strings.
*
* Length is 16 chars + null termination.
*/
static const unsigned GIT_HASH_STR_LEN = 17;
/**
* @brief Type containing device version information.
*/
struct Version {
int flight_sw_major; /**< @brief Flight software major version. */
int flight_sw_minor; /**< @brief Flight software minor version. */
int flight_sw_patch; /**< @brief Flight software patch version. */
int flight_sw_vendor_major; /**< @brief Flight software vendor major version. */
int flight_sw_vendor_minor; /**< @brief Flight software vendor minor version. */
int flight_sw_vendor_patch; /**< @brief Flight software vendor patch version. */
char flight_sw_git_hash[GIT_HASH_STR_LEN]; /**< @brief Flight software git hash as string. */
int os_sw_major; /**< @brief Operating system software major version. */
int os_sw_minor; /**< @brief Operating system software minor version. */
int os_sw_patch; /**< @brief Operating system software patch version. */
char os_sw_git_hash[GIT_HASH_STR_LEN];/**< @brief Operating system software git hash as string. */
};
/**
* @brief Type containing device product information.
*/
struct Product {
int vendor_id; /**< @brief ID of board vendor. */
char vendor_name[32]; /**< @brief Name of vendor. */
int product_id; /**< @brief ID of product. */
char product_name[32]; /**< @brief Name of product. */
};
/**
* @brief Gets the UUID of the device.
*
* If possible this will be a unique identifier provided by hardware.
*
* @return The UUID of the device.
*/
uint64_t uuid() const;
/**
* @brief Tests if the Version and Product objects are fully populated from hardware.
*
* @return `true` if Version and Product objects are fully populated from device.
*/
bool is_complete() const;
/**
* @brief Get device version information.
*
* @return The version object for the device.
*/
Version get_version() const;
/**
* @brief Get device product information.
*
* @return The product object for the device.
*/
Product get_product() const;
// Non-copyable
/**
* @brief Copy Constructor (object is not copyable).
*/
Info(const Info &) = delete;
/**
* @brief Equality operator (object is not copyable).
*/
const Info &operator=(const Info &) = delete;
private:
/** @private Underlying implementation, set at instantiation */
InfoImpl *_impl;
};
} // namespace dronecore