Shell

class mavsdk.shell.Device(*values)

Bases: Enum

MAVLink SERIAL_CONTROL_DEV values used by the shell plugin.

Values

TELEM1

SERIAL_CONTROL_DEV_TELEM1

TELEM2

SERIAL_CONTROL_DEV_TELEM2

GPS1

SERIAL_CONTROL_DEV_GPS1

GPS2

SERIAL_CONTROL_DEV_GPS2

SHELL

SERIAL_CONTROL_DEV_SHELL (default)

SERIAL0

SERIAL_CONTROL_SERIAL0

SERIAL1

SERIAL_CONTROL_SERIAL1

SERIAL2

SERIAL_CONTROL_SERIAL2

SERIAL3

SERIAL_CONTROL_SERIAL3

SERIAL4

SERIAL_CONTROL_SERIAL4

SERIAL5

SERIAL_CONTROL_SERIAL5

SERIAL6

SERIAL_CONTROL_SERIAL6

SERIAL7

SERIAL_CONTROL_SERIAL7

SERIAL8

SERIAL_CONTROL_SERIAL8

SERIAL9

SERIAL_CONTROL_SERIAL9

GPS1 = 2
GPS2 = 3
SERIAL0 = 5
SERIAL1 = 6
SERIAL2 = 7
SERIAL3 = 8
SERIAL4 = 9
SERIAL5 = 10
SERIAL6 = 11
SERIAL7 = 12
SERIAL8 = 13
SERIAL9 = 14
SHELL = 4
TELEM1 = 0
TELEM2 = 1
class mavsdk.shell.Receive(data, device)

Bases: object

Received shell data and source device.

Parameters:
  • data (std::string) – Received data.

  • device (Device) – SERIAL_CONTROL device the data came from.

class mavsdk.shell.Shell(async_plugin_manager)

Bases: AsyncBase

Allow to communicate with the vehicle’s system shell.

Under the hood this uses MAVLink SERIAL_CONTROL. The default device is SERIAL_CONTROL_DEV_SHELL. Callers can pass another SERIAL_CONTROL_DEV on Send (and observe the device on Receive) when the same framing is used for non-nsh serial bridges (for example TELEM2).

Generated by dcsdkgen - MAVSDK Shell API

name = 'Shell'
async receive()

Receive feedback from a sent command line.

This subscription needs to be made before a command line is sent, otherwise, no response will be sent.

Yields:

receive (Receive) – Received data.

async send(command, device)

Send a command line.

Parameters:
  • command (std::string) – The command line to send

  • device (Device)

Raises:

ShellError – If the request fails. The error contains the reason for the failure.

exception mavsdk.shell.ShellError(result, origin, *params)

Bases: Exception

Raised when a ShellResult is a fail code

class mavsdk.shell.ShellResult(result, result_str)

Bases: object

Result type.

Parameters:
  • result (Result) – Result enum value

  • result_str (std::string) – Human-readable English string describing the result

class Result(*values)

Bases: Enum

Possible results returned for shell requests

Values

UNKNOWN

Unknown result

SUCCESS

Request succeeded

NO_SYSTEM

No system is connected

CONNECTION_ERROR

Connection error

NO_RESPONSE

Response was not received

BUSY

Shell busy (transfer in progress)

INVALID_ARGUMENT

Invalid device / argument

BUSY = 5
CONNECTION_ERROR = 3
INVALID_ARGUMENT = 6
NO_RESPONSE = 4
NO_SYSTEM = 2
SUCCESS = 1
UNKNOWN = 0