dronecode_sdk::LogFiles Class Reference

#include: log_files.h


The LogFiles class allows to download log files from the vehicle after a flight is completed.

Data Structures

struct Entry

Public Types

Type Description
enum Result Results for log file requests.
std::function< void(Result, std::vector< Entry >)> get_entries_callback_t Callback type for logging requests.
std::function< void(Result result, float progress)> download_log_file_callback_t Callback type for logging requests.

Public Member Functions

Type Name Description
  LogFiles (System & system) Constructor. Creates the plugin for a specific System.
  ~LogFiles () Destructor (internal use only).
  LogFiles (const LogFiles &)=delete Copy constructor (object is not copyable).
std::pair< Result, std::vector< Entry > > get_entries () Get list of log files (synchronous).
void get_entries_async (get_entries_callback_t callback) Get list of log files (asynchronous).
Result download_log_file (unsigned id, const std::string & file_path) Download log file (synchronous).
void download_log_file_async (unsigned id, const std::string & file_path, download_log_file_callback_t callback) Download log file (asynchronous).
const LogFiles & operator= (const LogFiles &)=delete Equality operator (object is not copyable).

Static Public Member Functions

Type Name Description
const char * result_str (Result result) Returns human-readable English string for LogFiles::Result.

Constructor & Destructor Documentation

LogFiles()

dronecode_sdk::LogFiles::LogFiles(System &system)

Constructor. Creates the plugin for a specific System.

The plugin is typically created as shown below:

auto log_files = std::make_shared<LogFiles>(system);

Parameters

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

~LogFiles()

dronecode_sdk::LogFiles::~LogFiles()

Destructor (internal use only).

LogFiles()

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

Copy constructor (object is not copyable).

Parameters

Member Typdef Documentation

typedef get_entries_callback_t

typedef std::function<void(Result, std::vector<Entry>)> dronecode_sdk::LogFiles::get_entries_callback_t

Callback type for logging requests.

typedef download_log_file_callback_t

typedef std::function<void(Result result, float progress)> dronecode_sdk::LogFiles::download_log_file_callback_t

Callback type for logging requests.

Member Enumeration Documentation

enum Result

Results for log file requests.

Value Description
SUCCESS Request succeeded.
NO_LOGFILES No logfiles found.
TOO_MANY_RETRIES Too many retries.
PROGRESS Progress update.
UNKNOWN Unknown error.

Member Function Documentation

get_entries()

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

Get list of log files (synchronous).

Returns

 std::pair< Result, std::vector< Entry > > - Pair of result and list of entries.

get_entries_async()

void dronecode_sdk::LogFiles::get_entries_async(get_entries_callback_t callback)

Get list of log files (asynchronous).

Parameters

download_log_file()

Result dronecode_sdk::LogFiles::download_log_file(unsigned id, const std::string &file_path)

Download log file (synchronous).

The synchronous method does only report progress through console logs.

Parameters

  • unsigned id - Entry id of log file to download.
  • const std::string& file_path - File path where to download file to.

Returns

Result - Result of request

download_log_file_async()

void dronecode_sdk::LogFiles::download_log_file_async(unsigned id, const std::string &file_path, download_log_file_callback_t callback)

Download log file (asynchronous).

Parameters

  • unsigned id - Entry id of log file to download.
  • const std::string& file_path - File path where to download file to.
  • download_log_file_callback_t callback - Callback to get result and progress.

operator=()

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

Equality operator (object is not copyable).

Parameters

Returns

 const LogFiles & -

result_str()

static const char* dronecode_sdk::LogFiles::result_str(Result result)

Returns human-readable English string for LogFiles::Result.

Parameters

  • Result result - Enum for which string is required.

Returns

 const char * - result Human-readable string for LogFiles::Result.

© Dronecode 2017. License: CC BY 4.0            Updated: 2018-10-08 10:59:36

results matching ""

    No results matching ""