mavsdk::Info Class Reference
#include: info.h
The Info class provides basic infomation about the hardware and/or software of a system.
Data Structures
struct Identification
struct Product
struct Version
Public Types
Type | Description |
---|---|
enum Result | Possible results returned for requests. |
Public Member Functions
Type | Name | Description |
---|---|---|
Info (System & system) | Constructor. Creates the plugin for a specific System. | |
~Info () | Destructor (internal use only). | |
Info (const Info &)=delete | Copy Constructor (object is not copyable). | |
std::pair< Result, Identification > | get_identification () const | Gets the identification of the system. |
std::pair< Result, Version > | get_version () const | Get system version information. |
std::pair< Result, Product > | get_product () const | Get system product information. |
const Info & | operator= (const Info &)=delete | Equality operator (object is not copyable). |
Static Public Attributes
static const unsigned GIT_HASH_STR_LEN = 17 - Length of git hash strings.
Static Public Member Functions
Type | Name | Description |
---|---|---|
std::string | result_str (Result result) | Returns a human-readable English string for an Result. |
Constructor & Destructor Documentation
Info()
mavsdk::Info::Info(System &system)
Constructor. Creates the plugin for a specific System.
The plugin is typically created as shown below:
auto info = std::make_shared<Info>(system);
Parameters
- System& system - The specific system associated with this plugin.
~Info()
mavsdk::Info::~Info()
Destructor (internal use only).
Info()
mavsdk::Info::Info(const Info &)=delete
Copy Constructor (object is not copyable).
Parameters
- const Info& -
Member Enumeration Documentation
enum Result
Possible results returned for requests.
Mavsdk does not throw exceptions. Instead a result of this type will be returned.
Value | Description |
---|---|
UNKNOWN |
Unspecified error. |
SUCCESS |
The request was successful. |
INFORMATION_NOT_RECEIVED_YET |
The information has not been received yet. |
Member Function Documentation
get_identification()
std::pair<Result, Identification> mavsdk::Info::get_identification() const
Gets the identification of the system.
If possible this will be a unique identifier provided by hardware.
Returns
std::pair< Result, Identification > - a pair containing the result of the request and if successful, the identification information of the system.
get_version()
std::pair<Result, Version> mavsdk::Info::get_version() const
Get system version information.
Returns
std::pair< Result, Version > - a pair containing the result of the request and if successful, the version information about the system.
get_product()
std::pair<Result, Product> mavsdk::Info::get_product() const
Get system product information.
Returns
std::pair< Result, Product > - a pair containing the result of the request and if successful, the product information about the system.
operator=()
const Info& mavsdk::Info::operator=(const Info &)=delete
Equality operator (object is not copyable).
Parameters
- const Info& -
Returns
const Info & -
result_str()
static std::string mavsdk::Info::result_str(Result result)
Returns a human-readable English string for an Result.
Parameters
- Result result - The enum value for which a human readable string is required.
Returns
std::string - Human readable string for the Result.
Field Documentation
GIT_HASH_STR_LEN
const unsigned mavsdk::Info::GIT_HASH_STR_LEN = 17
Length of git hash strings.
Length is 16 chars + null termination.