mavsdk::Shell Class Reference

#include: shell.h


This class allow users to communicate with vehicle's system shell.

Data Structures

struct ShellMessage

Public Types

Type Description
enum Result Shell Result Code enum.
std::function< void(Result result, ShellMessage response)> result_callback_t Callback type for shell requests.

Public Member Functions

Type Name Description
  Shell (System & system) Constructor. Creates the plugin for a specific System.
  ~Shell () Destructor (internal use only).
  Shell (const Shell &)=delete Copy constructor (object is not copyable).
Shell::Result shell_command (ShellMessage shell_message) Send the shell message.
Shell::Result shell_command_response_async (result_callback_t callback) Set Shell message Response callback (asynchronous).
const Shell & operator= (const Shell &)=delete Equality operator (object is not copyable).

Static Public Member Functions

Type Name Description
const char * result_code_str (Result result) Get human-readable English string for Shell::Result::ResultCode.

Constructor & Destructor Documentation

Shell()

mavsdk::Shell::Shell(System &system)

Constructor. Creates the plugin for a specific System.

The plugin is typically created as shown below:

auto shell = std::make_shared<Shell>(system);

Parameters

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

~Shell()

mavsdk::Shell::~Shell()

Destructor (internal use only).

Shell()

mavsdk::Shell::Shell(const Shell &)=delete

Copy constructor (object is not copyable).

Parameters

Member Typdef Documentation

typedef result_callback_t

typedef std::function<void(Result result, ShellMessage response)> mavsdk::Shell::result_callback_t

Callback type for shell requests.

Member Enumeration Documentation

enum Result

Shell Result Code enum.

Value Description
UNKNOWN Unknown error.
SUCCESS Request succeeded.
NO_SYSTEM No system connected.
CONNECTION_ERROR Connection error.
NO_RESPONSE Response does not received.
BUSY Shell busy (transfer in progress)

Member Function Documentation

shell_command()

Shell::Result mavsdk::Shell::shell_command(ShellMessage shell_message)

Send the shell message.

Parameters

Returns

Shell::Result -

shell_command_response_async()

Shell::Result mavsdk::Shell::shell_command_response_async(result_callback_t callback)

Set Shell message Response callback (asynchronous).

Parameters

Returns

Shell::Result -

operator=()

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

Equality operator (object is not copyable).

Parameters

Returns

 const Shell & -

result_code_str()

static const char* mavsdk::Shell::result_code_str(Result result)

Get human-readable English string for Shell::Result::ResultCode.

Parameters

  • Result result - The enum value for which string is needed.

Returns

 const char * - Human readable string for the Shell::Result::ResultCode.

© Dronecode 2017-2019. License: CC BY 4.0            Updated: 2019-11-05 22:27:07

results matching ""

    No results matching ""