-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathanalyzing_dataflash_message_handler.h
48 lines (36 loc) · 1.26 KB
/
analyzing_dataflash_message_handler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef ANALYZING_DATAFLASH_MESSAGE_HANDLER_H
#define ANALYZING_DATAFLASH_MESSAGE_HANDLER_H
/*
* dataflash_message_handler
*
* A base class for objects which process dataflash messages and
* possibly send responses
*
*/
#include <stdint.h>
#include "INIReader.h"
#include "dataflash_message_handler.h"
#include "LA_MsgHandler.h"
#include "analyze.h"
class Analyzing_DataFlash_Message_Handler : public DataFlash_Message_Handler {
public:
Analyzing_DataFlash_Message_Handler(Analyze *analyze,
AnalyzerVehicle::Base *&vehicle) :
DataFlash_Message_Handler(),
_analyze(analyze),
_vehicle(vehicle) { }
void handle_format_message_received(const char *name, const struct log_Format &format, const char *msg) override;
void handle_message_received(const struct log_Format &format, const uint8_t *msg) override;
void end_of_log(uint32_t packet_count, uint64_t bytes_dropped = 0) override;
protected:
private:
Analyze *_analyze;
AnalyzerVehicle::Base *&_vehicle;
#define MAX_FORMATS 256
class LA_MsgHandler *handlers[MAX_FORMATS] = { };
// FIXME: find a general way to do this:
bool have_pos = false;
bool have_orgn = false;
LA_MsgHandler_AHR2 *ahr2_handler = NULL;
};
#endif