Fixes to log download (#5133)

* Fixes to log download

* Fixing indentation
This commit is contained in:
Gus Grubba
2016-07-25 08:15:23 -04:00
committed by GitHub
parent 50175ca7ea
commit c3b58822a8
2 changed files with 123 additions and 97 deletions
+30 -29
View File
@@ -54,11 +54,11 @@ public:
public:
static void delete_all(const char* dir);
public:
bool get_entry (int idx, uint32_t& size, uint32_t& date, char* filename = 0);
size_t get_log_data (uint8_t len, uint8_t* buffer);
bool get_entry (int idx, uint32_t& size, uint32_t& date, char* filename = 0);
size_t get_log_data (uint8_t len, uint8_t* buffer);
enum {
LOG_HANDLER_IDLE,
@@ -66,22 +66,22 @@ public:
LOG_HANDLER_SENDING_DATA
};
int next_entry;
int last_entry;
int log_count;
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;
char current_log_filename[128];
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;
char current_log_filename[128];
private:
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);
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);
};
// MAVLink LOG_* Message Handler
@@ -93,24 +93,25 @@ public:
static MavlinkLogHandler *new_instance(Mavlink *mavlink);
// Handle possible LOG message
void handle_message (const mavlink_message_t *msg);
void handle_message (const mavlink_message_t *msg);
// Overrides from MavlinkStream
const char* get_name (void) const;
uint8_t get_id (void);
unsigned get_size (void);
void send (const hrt_abstime t);
const char* get_name (void) const;
uint8_t get_id (void);
unsigned get_size (void);
void send (const hrt_abstime t);
private:
void _log_message (const mavlink_message_t *msg);
void _log_request_list (const mavlink_message_t *msg);
void _log_request_data (const mavlink_message_t *msg);
void _log_request_erase (const mavlink_message_t *msg);
void _log_request_end (const mavlink_message_t *msg);
void _log_send_listing ();
void _log_send_data ();
void _log_message (const mavlink_message_t *msg);
void _log_request_list (const mavlink_message_t *msg);
void _log_request_data (const mavlink_message_t *msg);
void _log_request_erase (const mavlink_message_t *msg);
void _log_request_end (const mavlink_message_t *msg);
size_t _log_send_listing();
size_t _log_send_data ();
private:
LogListHelper *_pLogHandlerHelper;
LogListHelper *_pLogHandlerHelper;
};