mavsdk::ComponentInformationServer Class Reference
#include: component_information_server.h
Provide 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 ComponentInformationServer 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 | 
|---|---|---|
| ComponentInformationServer (std::shared_ptr< ServerComponent > server_component) | Constructor. Creates the plugin for a ServerComponent instance. | |
| ~ComponentInformationServer () override | Destructor (internal use only). | |
| ComponentInformationServer (const ComponentInformationServer & other) | Copy constructor. | |
| Result | provide_float_param (FloatParam param)const | Provide a param of type float. | 
| FloatParamHandle | subscribe_float_param (const FloatParamCallback & callback) | Subscribe to float param updates. | 
| void | unsubscribe_float_param (FloatParamHandle handle) | Unsubscribe from subscribe_float_param. | 
| const ComponentInformationServer & | operator= (const ComponentInformationServer &)=delete | Equality operator (object is not copyable). | 
Constructor & Destructor Documentation
ComponentInformationServer()
mavsdk::ComponentInformationServer::ComponentInformationServer(std::shared_ptr< ServerComponent > server_component)
Constructor. Creates the plugin for a ServerComponent instance.
The plugin is typically created as shown below:
auto component_information_server = ComponentInformationServer(server_component);
Parameters
- std::shared_ptr< ServerComponent > server_component - The ServerComponent instance associated with this server plugin.
 
~ComponentInformationServer()
mavsdk::ComponentInformationServer::~ComponentInformationServer() override
Destructor (internal use only).
ComponentInformationServer()
mavsdk::ComponentInformationServer::ComponentInformationServer(const ComponentInformationServer &other)
Copy constructor.
Parameters
- const ComponentInformationServer& other -
 
Member Typdef Documentation
typedef ResultCallback
using mavsdk::ComponentInformationServer::ResultCallback =  std::function<void(Result)>
Callback type for asynchronous ComponentInformationServer calls.
typedef FloatParamCallback
using mavsdk::ComponentInformationServer::FloatParamCallback =  std::function<void(FloatParamUpdate)>
Callback type for subscribe_float_param.
typedef FloatParamHandle
using mavsdk::ComponentInformationServer::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. | 
 DuplicateParam | 
Duplicate param. | 
 InvalidParamStartValue | 
Invalid start param value. | 
 InvalidParamDefaultValue | 
Invalid default param value. | 
 InvalidParamName | 
Invalid param name. | 
 NoSystem | 
No system is connected. | 
Member Function Documentation
provide_float_param()
Result mavsdk::ComponentInformationServer::provide_float_param(FloatParam param) const
Provide a param of type float.
This function is blocking.
Parameters
- FloatParam param -
 
Returns
Result - Result of request.
subscribe_float_param()
FloatParamHandle mavsdk::ComponentInformationServer::subscribe_float_param(const FloatParamCallback &callback)
Subscribe to float param updates.
Parameters
- const FloatParamCallback& callback -
 
Returns
unsubscribe_float_param()
void mavsdk::ComponentInformationServer::unsubscribe_float_param(FloatParamHandle handle)
Unsubscribe from subscribe_float_param.
Parameters
- FloatParamHandle handle -
 
operator=()
const ComponentInformationServer& mavsdk::ComponentInformationServer::operator=(const ComponentInformationServer &)=delete
Equality operator (object is not copyable).
Parameters
- const ComponentInformationServer& -
 
Returns
const ComponentInformationServer & -