CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/Tools/Replay/DataFlashFileReader.h
Views: 1798
1
#pragma once
2
3
#include <AP_Logger/AP_Logger.h>
4
5
#define LOGREADER_MAX_FORMATS 255 // must be >= highest MESSAGE
6
7
class AP_LoggerFileReader
8
{
9
public:
10
11
AP_LoggerFileReader();
12
~AP_LoggerFileReader();
13
14
bool open_log(const char *logfile);
15
bool update();
16
17
virtual bool handle_log_format_msg(const struct log_Format &f) = 0;
18
virtual bool handle_msg(const struct log_Format &f, uint8_t *msg) = 0;
19
20
void format_type(uint16_t type, char dest[5]);
21
void get_packet_counts(uint64_t dest[]);
22
23
protected:
24
int fd = -1;
25
26
struct log_Format formats[LOGREADER_MAX_FORMATS] {};
27
28
private:
29
ssize_t read_input(void *buf, size_t count);
30
31
uint64_t bytes_read = 0;
32
uint32_t message_count = 0;
33
uint64_t start_micros;
34
35
uint64_t packet_counts[LOGREADER_MAX_FORMATS] = {};
36
};
37
38