2015-06-12 09:52:52 -03:00
|
|
|
#ifndef REPLAY_DATAFLASHREADER_H
|
|
|
|
#define REPLAY_DATAFLASHREADER_H
|
|
|
|
|
2015-08-11 03:28:41 -03:00
|
|
|
#include <DataFlash/DataFlash.h>
|
2015-06-12 09:52:52 -03:00
|
|
|
|
|
|
|
class DataFlashFileReader
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool open_log(const char *logfile);
|
|
|
|
bool update(char type[5]);
|
|
|
|
|
|
|
|
virtual bool handle_log_format_msg(const struct log_Format &f) = 0;
|
|
|
|
virtual bool handle_msg(const struct log_Format &f, uint8_t *msg) = 0;
|
|
|
|
|
|
|
|
protected:
|
2015-07-04 09:43:54 -03:00
|
|
|
int fd = -1;
|
|
|
|
bool done_format_msgs = false;
|
|
|
|
virtual void end_format_msgs(void) {}
|
2015-06-12 09:52:52 -03:00
|
|
|
|
|
|
|
#define LOGREADER_MAX_FORMATS 255 // must be >= highest MESSAGE
|
2015-07-04 09:43:54 -03:00
|
|
|
struct log_Format formats[LOGREADER_MAX_FORMATS] {};
|
2015-06-12 09:52:52 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|