mavsdk::LogFiles Class Reference

#include: log_files.h


Allow to download log files from the vehicle after a flight is complete. For log streaming during flight check the logging plugin.

Data Structures

struct Entry

struct ProgressData

Public Types

Type Description
enum Result Possible results returned for calibration commands.
std::function< void(Result)> ResultCallback Callback type for asynchronous LogFiles calls.
std::function< void(Result, std::vector< Entry >)> GetEntriesCallback Callback type for get_entries_async.
std::function< void(Result, ProgressData)> DownloadLogFileCallback Callback type for download_log_file_async.

Public Member Functions

Type Name Description
  LogFiles (System & system) Constructor. Creates the plugin for a specific System.
  LogFiles (std::shared_ptr< System > system) Constructor. Creates the plugin for a specific System.
  ~LogFiles () override Destructor (internal use only).
  LogFiles (const LogFiles & other) Copy constructor.
void get_entries_async (const GetEntriesCallback callback) Get List of log files.
std::pair< Result, std::vector< LogFiles::Entry > > get_entries () const Get List of log files.
void download_log_file_async (Entry entry, std::string path, const DownloadLogFileCallback & callback) Download log file.
Result erase_all_log_files () const Erase all log files.
const LogFiles & operator= (const LogFiles &)=delete Equality operator (object is not copyable).

Constructor & Destructor Documentation

LogFiles()

mavsdk::LogFiles::LogFiles(System &system)

Constructor. Creates the plugin for a specific System.

The plugin is typically created as shown below:

auto log_files = LogFiles(system);

Parameters

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

LogFiles()

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

Constructor. Creates the plugin for a specific System.

The plugin is typically created as shown below:

auto log_files = LogFiles(system);

Parameters

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

~LogFiles()

mavsdk::LogFiles::~LogFiles() override

Destructor (internal use only).

LogFiles()

mavsdk::LogFiles::LogFiles(const LogFiles &other)

Copy constructor.

Parameters

Member Typdef Documentation

typedef ResultCallback

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

Callback type for asynchronous LogFiles calls.

typedef GetEntriesCallback

using mavsdk::LogFiles::GetEntriesCallback =  std::function<void(Result, std::vector<Entry>)>

Callback type for get_entries_async.

typedef DownloadLogFileCallback

using mavsdk::LogFiles::DownloadLogFileCallback =  std::function<void(Result, ProgressData)>

Callback type for download_log_file_async.

Member Enumeration Documentation

enum Result

Possible results returned for calibration commands.

Value Description
Unknown Unknown result.
Success Request succeeded.
Next Progress update.
NoLogfiles No log files found.
Timeout A timeout happened.
InvalidArgument Invalid argument.
FileOpenFailed File open failed.
NoSystem No system is connected.

Member Function Documentation

get_entries_async()

void mavsdk::LogFiles::get_entries_async(const GetEntriesCallback callback)

Get List of log files.

This function is non-blocking. See 'get_entries' for the blocking counterpart.

Parameters

get_entries()

std::pair<Result, std::vector<LogFiles::Entry> > mavsdk::LogFiles::get_entries() const

Get List of log files.

This function is blocking. See 'get_entries_async' for the non-blocking counterpart.

Returns

 std::pair< Result, std::vector< LogFiles::Entry > > - Result of request.

download_log_file_async()

void mavsdk::LogFiles::download_log_file_async(Entry entry, std::string path, const DownloadLogFileCallback &callback)

Download log file.

Parameters

erase_all_log_files()

Result mavsdk::LogFiles::erase_all_log_files() const

Erase all log files.

This function is blocking.

Returns

Result - Result of request.

operator=()

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

Equality operator (object is not copyable).

Parameters

Returns

 const LogFiles & -

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

results matching ""

    No results matching ""