mavsdk::Info Class Reference ​
#include: info.h
Provide information about the hardware and/or software of a system.
Data Structures ​
struct FlightInfo
struct Identification
struct Product
struct Version
Public Types ​
Type | Description |
---|---|
enum Result | Possible results returned for info requests. |
std::function< void(Result)> ResultCallback | Callback type for asynchronous Info calls. |
std::function< void(FlightInfo)> FlightInformationCallback | Callback type for subscribe_flight_information. |
Handle< FlightInfo > FlightInformationHandle | Handle type for subscribe_flight_information. |
Public Member Functions ​
Type | Name | Description |
---|---|---|
 | Info (System & system) | Constructor. Creates the plugin for a specific System. |
 | Info (std::shared_ptr< System > system) | Constructor. Creates the plugin for a specific System. |
 | ~Info () override | Destructor (internal use only). |
 | Info (const Info & other) | Copy constructor. |
std::pair< Result, Info::FlightInfo > | get_flight_information () const | Get flight information of the system. |
std::pair< Result, Info::Identification > | get_identification () const | Get the identification of the system. |
std::pair< Result, Info::Product > | get_product () const | Get product information of the system. |
std::pair< Result, Info::Version > | get_version () const | Get the version information of the system. |
std::pair< Result, double > | get_speed_factor () const | Get the speed factor of a simulation (with lockstep a simulation can run faster or slower than realtime). |
FlightInformationHandle | subscribe_flight_information (const FlightInformationCallback & callback) | Subscribe to 'flight information' updates. |
void | unsubscribe_flight_information (FlightInformationHandle handle) | Unsubscribe from subscribe_flight_information. |
const Info & | operator= (const Info &)=delete | Equality operator (object is not copyable). |
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 = Info(system);
Parameters
- System& system - The specific system associated with this plugin.
Info() ​
mavsdk::Info::Info(std::shared_ptr< System > system)
Constructor. Creates the plugin for a specific System.
The plugin is typically created as shown below:
auto info = Info(system);
Parameters
- std::shared_ptr< System > system - The specific system associated with this plugin.
~Info() ​
mavsdk::Info::~Info() override
Destructor (internal use only).
Info() ​
mavsdk::Info::Info(const Info &other)
Copy constructor.
Parameters
- const Info& other -
Member Typdef Documentation ​
typedef ResultCallback ​
using mavsdk::Info::ResultCallback = std::function<void(Result)>
Callback type for asynchronous Info calls.
typedef FlightInformationCallback ​
using mavsdk::Info::FlightInformationCallback = std::function<void(FlightInfo)>
Callback type for subscribe_flight_information.
typedef FlightInformationHandle ​
using mavsdk::Info::FlightInformationHandle = Handle<FlightInfo>
Handle type for subscribe_flight_information.
Member Enumeration Documentation ​
enum Result ​
Possible results returned for info requests.
Value | Description |
---|---|
Unknown | Unknown result. |
Success | Request succeeded. |
InformationNotReceivedYet | Information has not been received yet. |
NoSystem | No system is connected. |
Member Function Documentation ​
get_flight_information() ​
std::pair< Result, Info::FlightInfo > mavsdk::Info::get_flight_information() const
Get flight information of the system.
This function is blocking.
Returns
 std::pair< Result, Info::FlightInfo > - Result of request.
get_identification() ​
std::pair< Result, Info::Identification > mavsdk::Info::get_identification() const
Get the identification of the system.
This function is blocking.
Returns
 std::pair< Result, Info::Identification > - Result of request.
get_product() ​
std::pair< Result, Info::Product > mavsdk::Info::get_product() const
Get product information of the system.
This function is blocking.
Returns
 std::pair< Result, Info::Product > - Result of request.
get_version() ​
std::pair< Result, Info::Version > mavsdk::Info::get_version() const
Get the version information of the system.
This function is blocking.
Returns
 std::pair< Result, Info::Version > - Result of request.
get_speed_factor() ​
std::pair< Result, double > mavsdk::Info::get_speed_factor() const
Get the speed factor of a simulation (with lockstep a simulation can run faster or slower than realtime).
This function is blocking.
Returns
 std::pair< Result, double > - Result of request.
subscribe_flight_information() ​
FlightInformationHandle mavsdk::Info::subscribe_flight_information(const FlightInformationCallback &callback)
Subscribe to 'flight information' updates.
Parameters
- const FlightInformationCallback& callback -
Returns
unsubscribe_flight_information() ​
void mavsdk::Info::unsubscribe_flight_information(FlightInformationHandle handle)
Unsubscribe from subscribe_flight_information.
Parameters
- FlightInformationHandle handle -
operator=() ​
const Info & mavsdk::Info::operator=(const Info &)=delete
Equality operator (object is not copyable).
Parameters
- const Info& -
Returns
 const Info & -