mavsdk::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()
mavsdk::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()
mavsdk::LogFiles::~LogFiles()
Destructor (internal use only).
LogFiles()
mavsdk::LogFiles::LogFiles(const LogFiles &)=delete
Copy constructor (object is not copyable).
Parameters
- const LogFiles& -
Member Typdef Documentation
typedef get_entries_callback_t
typedef std::function<void(Result, std::vector<Entry>)> mavsdk::LogFiles::get_entries_callback_t
Callback type for logging requests.
typedef download_log_file_callback_t
typedef std::function<void(Result result, float progress)> mavsdk::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> > mavsdk::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 mavsdk::LogFiles::get_entries_async(get_entries_callback_t callback)
Get list of log files (asynchronous).
Parameters
- get_entries_callback_t callback - Callback to get result from.
download_log_file()
Result mavsdk::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 mavsdk::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& mavsdk::LogFiles::operator=(const LogFiles &)=delete
Equality operator (object is not copyable).
Parameters
- const LogFiles& -
Returns
const LogFiles & -
result_str()
static const char* mavsdk::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.