PX4 Firmware
PX4 Autopilot Software http://px4.io
LogListHelper Class Reference

#include <mavlink_log_handler.h>

Collaboration diagram for LogListHelper:

Public Types

enum  { LOG_HANDLER_IDLE, LOG_HANDLER_LISTING, LOG_HANDLER_SENDING_DATA }
 

Public Member Functions

 LogListHelper ()
 
 ~LogListHelper ()
 
bool get_entry (int idx, uint32_t &size, uint32_t &date, char *filename=0, int filename_len=0)
 
bool open_for_transmit ()
 
size_t get_log_data (uint8_t len, uint8_t *buffer)
 

Static Public Member Functions

static void delete_all (const char *dir)
 

Public Attributes

int next_entry
 
int last_entry
 
int log_count
 
int current_status
 
uint16_t current_log_index
 
uint32_t current_log_size
 
uint32_t current_log_data_offset
 
uint32_t current_log_data_remaining
 
FILE * current_log_filep
 
char current_log_filename [128]
 

Private Member Functions

void _init ()
 
bool _get_session_date (const char *path, const char *dir, time_t &date)
 
void _scan_logs (FILE *f, const char *dir, time_t &date)
 
bool _get_log_time_size (const char *path, const char *file, time_t &date, uint32_t &size)
 

Detailed Description

Definition at line 50 of file mavlink_log_handler.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
LOG_HANDLER_IDLE 
LOG_HANDLER_LISTING 
LOG_HANDLER_SENDING_DATA 

Definition at line 65 of file mavlink_log_handler.h.

Constructor & Destructor Documentation

◆ LogListHelper()

LogListHelper::LogListHelper ( )

Definition at line 335 of file mavlink_log_handler.cpp.

References _init().

Here is the call graph for this function:

◆ ~LogListHelper()

LogListHelper::~LogListHelper ( )

Definition at line 350 of file mavlink_log_handler.cpp.

References kLogData, and kTmpData.

Member Function Documentation

◆ _get_log_time_size()

bool LogListHelper::_get_log_time_size ( const char *  path,
const char *  file,
time_t &  date,
uint32_t &  size 
)
private

Definition at line 560 of file mavlink_log_handler.cpp.

References stat_file().

Referenced by _scan_logs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _get_session_date()

bool LogListHelper::_get_session_date ( const char *  path,
const char *  dir,
time_t &  date 
)
private

Definition at line 502 of file mavlink_log_handler.cpp.

References stat_file().

Referenced by _init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _init()

void LogListHelper::_init ( void  )
private

Definition at line 443 of file mavlink_log_handler.cpp.

References _get_session_date(), _scan_logs(), current_log_filename, f(), kLogData, kLogRoot, kTmpData, log_count, PX4LOG_DIRECTORY, and PX4LOG_WARN.

Referenced by LogListHelper().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _scan_logs()

void LogListHelper::_scan_logs ( FILE *  f,
const char *  dir,
time_t &  date 
)
private

Definition at line 529 of file mavlink_log_handler.cpp.

References _get_log_time_size(), log_count, and PX4LOG_REGULAR_FILE.

Referenced by _init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ delete_all()

void LogListHelper::delete_all ( const char *  dir)
static

Definition at line 592 of file mavlink_log_handler.cpp.

References PX4LOG_DIRECTORY, PX4LOG_REGULAR_FILE, and PX4LOG_WARN.

Referenced by MavlinkLogHandler::_log_request_erase().

Here is the caller graph for this function:

◆ get_entry()

bool LogListHelper::get_entry ( int  idx,
uint32_t &  size,
uint32_t &  date,
char *  filename = 0,
int  filename_len = 0 
)

Definition at line 359 of file mavlink_log_handler.cpp.

References f(), file, and kLogData.

Referenced by MavlinkLogHandler::_log_request_data(), and MavlinkLogHandler::_log_send_listing().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_log_data()

size_t LogListHelper::get_log_data ( uint8_t  len,
uint8_t *  buffer 
)

Definition at line 417 of file mavlink_log_handler.cpp.

References current_log_data_offset, current_log_filename, current_log_filep, and PX4LOG_WARN.

Referenced by MavlinkLogHandler::_log_send_data().

Here is the caller graph for this function:

◆ open_for_transmit()

bool LogListHelper::open_for_transmit ( )

Definition at line 398 of file mavlink_log_handler.cpp.

References current_log_filename, current_log_filep, and PX4LOG_WARN.

Referenced by MavlinkLogHandler::_log_request_data().

Here is the caller graph for this function:

Member Data Documentation

◆ current_log_data_offset

uint32_t LogListHelper::current_log_data_offset

◆ current_log_data_remaining

uint32_t LogListHelper::current_log_data_remaining

◆ current_log_filename

char LogListHelper::current_log_filename[128]

◆ current_log_filep

FILE* LogListHelper::current_log_filep

Definition at line 80 of file mavlink_log_handler.h.

Referenced by get_log_data(), and open_for_transmit().

◆ current_log_index

uint16_t LogListHelper::current_log_index

◆ current_log_size

uint32_t LogListHelper::current_log_size

Definition at line 77 of file mavlink_log_handler.h.

Referenced by MavlinkLogHandler::_log_request_data().

◆ current_status

◆ last_entry

int LogListHelper::last_entry

◆ log_count

◆ next_entry

int LogListHelper::next_entry

The documentation for this class was generated from the following files: