dronecode_sdk::ParamsRaw Class Reference

#include: params_raw.h


The ParamsRaw class provides raw access to get and set parameters.

Public Types

Type Description
enum Result Possible results returned for params_raw requests.

Public Member Functions

Type Name Description
  ParamsRaw (System & system) Constructor. Creates the plugin for a specific System.
  ~ParamsRaw () Destructor (internal use only).
  ParamsRaw (const ParamsRaw &)=delete Copy Constructor (object is not copyable).
std::string result_str (Result result) Returns a human-readable English string for ParamsRaw::Result.
std::pair< Result, int32_t > get_param_int (const std::string & name) Get an int parameter.
Result set_param_int (const std::string & name, int32_t value) Set an int parameter.
std::pair< Result, float > get_param_float (const std::string & name) Get a float parameter.
Result set_param_float (const std::string & name, float value) Set a float parameter.
const ParamsRaw & operator= (const ParamsRaw &)=delete Equality operator (object is not copyable).

Constructor & Destructor Documentation

ParamsRaw()

dronecode_sdk::ParamsRaw::ParamsRaw(System &system)

Constructor. Creates the plugin for a specific System.

The plugin is typically created as shown below:

auto info = std::make_shared<ParamsRaw>(system);

Parameters

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

~ParamsRaw()

dronecode_sdk::ParamsRaw::~ParamsRaw()

Destructor (internal use only).

ParamsRaw()

dronecode_sdk::ParamsRaw::ParamsRaw(const ParamsRaw &)=delete

Copy Constructor (object is not copyable).

Parameters

Member Enumeration Documentation

enum Result

Possible results returned for params_raw requests.

Value Description
UNKNOWN Unknown error.
SUCCESS Request succeeded.
TIMEOUT Request timed out.
CONNECTION_ERROR Connection error.
WRONG_TYPE Error.
PARAM_NAME_TOO_LONG Parameter name too long (> 16).

Member Function Documentation

result_str()

std::string dronecode_sdk::ParamsRaw::result_str(Result result)

Returns a human-readable English string for ParamsRaw::Result.

Parameters

  • Result result - The enum value for which a human readable string is required.

Returns

 std::string - Human readable string for the ParamsRaw::Result.

get_param_int()

std::pair<Result, int32_t> dronecode_sdk::ParamsRaw::get_param_int(const std::string &name)

Get an int parameter.

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

Parameters

  • const std::string& name -

Returns

 std::pair< Result, int32_t > - a pair of the result of the request and the param (if successful).

set_param_int()

Result dronecode_sdk::ParamsRaw::set_param_int(const std::string &name, int32_t value)

Set an int parameter.

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

Parameters

  • const std::string& name -
  • int32_t value -

Returns

Result - result of the request.

get_param_float()

std::pair<Result, float> dronecode_sdk::ParamsRaw::get_param_float(const std::string &name)

Get a float parameter.

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

Parameters

  • const std::string& name -

Returns

 std::pair< Result, float > - a pair of the result of the request and the param (if successful).

set_param_float()

Result dronecode_sdk::ParamsRaw::set_param_float(const std::string &name, float value)

Set a float parameter.

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

Parameters

  • const std::string& name -
  • float value -

Returns

Result - result of the request.

operator=()

const ParamsRaw& dronecode_sdk::ParamsRaw::operator=(const ParamsRaw &)=delete

Equality operator (object is not copyable).

Parameters

Returns

 const ParamsRaw & -

© Dronecode 2017. License: CC BY 4.0            Updated: 2018-11-27 05:36:17

results matching ""

    No results matching ""