mavsdk::ComponentInformation Class Reference
#include: component_information.h
Access component information such as parameters.
Data Structures
struct FloatParam
struct FloatParamUpdate
Public Types
Type | Description |
---|---|
enum Result | Possible results returned for param requests. |
std::function< void(Result)> ResultCallback | Callback type for asynchronous ComponentInformation calls. |
std::function< void(FloatParamUpdate)> FloatParamCallback | Callback type for subscribe_float_param. |
Handle< FloatParamUpdate > FloatParamHandle | Handle type for subscribe_float_param. |
Public Member Functions
Type | Name | Description |
---|---|---|
ComponentInformation (System & system) | Constructor. Creates the plugin for a specific System. | |
ComponentInformation (std::shared_ptr< System > system) | Constructor. Creates the plugin for a specific System. | |
~ComponentInformation () override | Destructor (internal use only). | |
ComponentInformation (const ComponentInformation & other) | Copy constructor. | |
std::pair< Result, std::vector< ComponentInformation::FloatParam > > | access_float_params () const | List available float params. |
FloatParamHandle | subscribe_float_param (const FloatParamCallback & callback) | Subscribe to float param changes/updates. |
void | unsubscribe_float_param (FloatParamHandle handle) | Unsubscribe from subscribe_float_param. |
const ComponentInformation & | operator= (const ComponentInformation &)=delete | Equality operator (object is not copyable). |
Constructor & Destructor Documentation
ComponentInformation()
mavsdk::ComponentInformation::ComponentInformation(System &system)
Constructor. Creates the plugin for a specific System.
The plugin is typically created as shown below:
auto component_information = ComponentInformation(system);
Parameters
- System& system - The specific system associated with this plugin.
ComponentInformation()
mavsdk::ComponentInformation::ComponentInformation(std::shared_ptr< System > system)
Constructor. Creates the plugin for a specific System.
The plugin is typically created as shown below:
auto component_information = ComponentInformation(system);
Parameters
- std::shared_ptr< System > system - The specific system associated with this plugin.
~ComponentInformation()
mavsdk::ComponentInformation::~ComponentInformation() override
Destructor (internal use only).
ComponentInformation()
mavsdk::ComponentInformation::ComponentInformation(const ComponentInformation &other)
Copy constructor.
Parameters
- const ComponentInformation& other -
Member Typdef Documentation
typedef ResultCallback
using mavsdk::ComponentInformation::ResultCallback = std::function<void(Result)>
Callback type for asynchronous ComponentInformation calls.
typedef FloatParamCallback
using mavsdk::ComponentInformation::FloatParamCallback = std::function<void(FloatParamUpdate)>
Callback type for subscribe_float_param.
typedef FloatParamHandle
using mavsdk::ComponentInformation::FloatParamHandle = Handle<FloatParamUpdate>
Handle type for subscribe_float_param.
Member Enumeration Documentation
enum Result
Possible results returned for param requests.
Value | Description |
---|---|
Unknown |
Unknown result. |
Success |
Request succeeded. |
NoSystem |
No system is connected. |
Member Function Documentation
access_float_params()
std::pair<Result, std::vector<ComponentInformation::FloatParam> > mavsdk::ComponentInformation::access_float_params() const
List available float params.
This function is blocking.
Returns
std::pair< Result, std::vector< ComponentInformation::FloatParam > > - Result of request.
subscribe_float_param()
FloatParamHandle mavsdk::ComponentInformation::subscribe_float_param(const FloatParamCallback &callback)
Subscribe to float param changes/updates.
Parameters
- const FloatParamCallback& callback -
Returns
unsubscribe_float_param()
void mavsdk::ComponentInformation::unsubscribe_float_param(FloatParamHandle handle)
Unsubscribe from subscribe_float_param.
Parameters
- FloatParamHandle handle -
operator=()
const ComponentInformation& mavsdk::ComponentInformation::operator=(const ComponentInformation &)=delete
Equality operator (object is not copyable).
Parameters
- const ComponentInformation& -
Returns
const ComponentInformation & -