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

~ComponentInformationServer()

mavsdk::ComponentInformationServer::~ComponentInformationServer() override

Destructor (internal use only).

ComponentInformationServer()

mavsdk::ComponentInformationServer::ComponentInformationServer(const ComponentInformationServer &other)

Copy constructor.

Parameters

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

Returns

Result - Result of request.

subscribe_float_param()

FloatParamHandle mavsdk::ComponentInformationServer::subscribe_float_param(const FloatParamCallback &callback)

Subscribe to float param updates.

Parameters

Returns

FloatParamHandle -

unsubscribe_float_param()

void mavsdk::ComponentInformationServer::unsubscribe_float_param(FloatParamHandle handle)

Unsubscribe from subscribe_float_param.

Parameters

operator=()

const ComponentInformationServer& mavsdk::ComponentInformationServer::operator=(const ComponentInformationServer &)=delete

Equality operator (object is not copyable).

Parameters

Returns

 const ComponentInformationServer & -

© MAVSDK Development Team 2017-2023. License: CC BY 4.0            Updated: 2023-12-27 03:10:20

results matching ""

    No results matching ""