mavsdk::ParamServer Class Reference

#include: param_server.h


Provide raw access to retrieve and provide server parameters.

Data Structures

struct AllParams

struct CustomParam

struct FloatParam

struct IntParam

Public Types

Type Description
enum Result Possible results returned for param requests.
std::function< void(Result)> ResultCallback Callback type for asynchronous ParamServer calls.

Public Member Functions

Type Name Description
  ParamServer (System & system) Constructor. Creates the plugin for a specific System.
  ParamServer (std::shared_ptr< System > system) Constructor. Creates the plugin for a specific System.
  ~ParamServer () Destructor (internal use only).
  ParamServer (const ParamServer & other) Copy constructor.
std::pair< Result, int32_t > retrieve_param_int (std::string name)const Retrieve an int parameter.
Result provide_param_int (std::string name, int32_t value)const Provide an int parameter.
std::pair< Result, float > retrieve_param_float (std::string name)const Retrieve a float parameter.
Result provide_param_float (std::string name, float value)const Provide a float parameter.
std::pair< Result, std::string > retrieve_param_custom (std::string name)const Retrieve a custom parameter.
Result provide_param_custom (std::string name, std::string value)const Provide a custom parameter.
ParamServer::AllParams retrieve_all_params () const Retrieve all parameters.
const ParamServer & operator= (const ParamServer &)=delete Equality operator (object is not copyable).

Constructor & Destructor Documentation

ParamServer()

mavsdk::ParamServer::ParamServer(System &system)

Constructor. Creates the plugin for a specific System.

The plugin is typically created as shown below:

auto param_server = ParamServer(system);

Parameters

  • System& system - The specific system associated with this plugin.

ParamServer()

mavsdk::ParamServer::ParamServer(std::shared_ptr< System > system)

Constructor. Creates the plugin for a specific System.

The plugin is typically created as shown below:

auto param_server = ParamServer(system);

Parameters

  • std::shared_ptr< System > system - The specific system associated with this plugin.

~ParamServer()

mavsdk::ParamServer::~ParamServer()

Destructor (internal use only).

ParamServer()

mavsdk::ParamServer::ParamServer(const ParamServer &other)

Copy constructor.

Parameters

Member Typdef Documentation

typedef ResultCallback

using mavsdk::ParamServer::ResultCallback =  std::function<void(Result)>

Callback type for asynchronous ParamServer calls.

Member Enumeration Documentation

enum Result

Possible results returned for param requests.

Value Description
Unknown Unknown result.
Success Request succeeded.
NotFound Not Found.
WrongType Wrong type.
ParamNameTooLong Parameter name too long (> 16).
NoSystem No system available.
ParamValueTooLong Parameter name too long (> 128).

Member Function Documentation

retrieve_param_int()

std::pair<Result, int32_t> mavsdk::ParamServer::retrieve_param_int(std::string name) const

Retrieve an int parameter.

If the type is wrong, the result will be WRONG_TYPE.

This function is blocking.

Parameters

  • std::string name -

Returns

 std::pair< Result, int32_t > - Result of request.

provide_param_int()

Result mavsdk::ParamServer::provide_param_int(std::string name, int32_t value) const

Provide an int parameter.

If the type is wrong, the result will be WRONG_TYPE.

This function is blocking.

Parameters

  • std::string name -
  • int32_t value -

Returns

Result - Result of request.

retrieve_param_float()

std::pair<Result, float> mavsdk::ParamServer::retrieve_param_float(std::string name) const

Retrieve a float parameter.

If the type is wrong, the result will be WRONG_TYPE.

This function is blocking.

Parameters

  • std::string name -

Returns

 std::pair< Result, float > - Result of request.

provide_param_float()

Result mavsdk::ParamServer::provide_param_float(std::string name, float value) const

Provide a float parameter.

If the type is wrong, the result will be WRONG_TYPE.

This function is blocking.

Parameters

  • std::string name -
  • float value -

Returns

Result - Result of request.

retrieve_param_custom()

std::pair<Result, std::string> mavsdk::ParamServer::retrieve_param_custom(std::string name) const

Retrieve a custom parameter.

If the type is wrong, the result will be WRONG_TYPE.

This function is blocking.

Parameters

  • std::string name -

Returns

 std::pair< Result, std::string > - Result of request.

provide_param_custom()

Result mavsdk::ParamServer::provide_param_custom(std::string name, std::string value) const

Provide a custom parameter.

If the type is wrong, the result will be WRONG_TYPE.

This function is blocking.

Parameters

  • std::string name -
  • std::string value -

Returns

Result - Result of request.

retrieve_all_params()

ParamServer::AllParams mavsdk::ParamServer::retrieve_all_params() const

Retrieve all parameters.

This function is blocking.

Returns

ParamServer::AllParams - Result of request.

operator=()

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

Equality operator (object is not copyable).

Parameters

Returns

 const ParamServer & -

© Dronecode 2017-2020. License: CC BY 4.0            Updated: 2022-05-26 19:56:18

results matching ""

    No results matching ""