forked from icecube45/Dash_InfinitiG37
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bmw_f10_idrive.hpp
61 lines (50 loc) · 1.66 KB
/
bmw_f10_idrive.hpp
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
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <QString>
#include <iostream>
#include <stdlib.h>
#include <QByteArray>
#include <boost/log/trivial.hpp>
#include "plugins/vehicle_plugin.hpp"
#include "app/arbiter.hpp"
#include "openauto/Service/InputService.hpp"
#include "AAHandler.hpp"
#define F10_LOG(severity) BOOST_LOG_TRIVIAL(severity) << "[F10VehiclePlugin] "
class DebugWindow : public QWidget {
Q_OBJECT
public:
DebugWindow(Arbiter &arbiter, QWidget *parent = nullptr);
QLabel* inReverse;
QLabel* rpm;
QLabel* rotaryPos;
QLabel* msgCounter;
QLabel* lastKey;
};
class BmwF10 : public QObject, VehiclePlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID VehiclePlugin_iid)
Q_INTERFACES(VehiclePlugin)
public:
BmwF10() {};
~BmwF10();
bool init(ICANBus* canbus) override;
private:
QList<QWidget *> widgets() override;
ICANBus* canbus;
bool cic_fullscreen = false;
bool inReverse = false;
int rotaryPrevPos = -1;
int rotaryPos = -1;
unsigned short int msgCounter = 0;
aasdk::proto::enums::ButtonCode::Enum lastKey = aasdk::proto::enums::ButtonCode::NONE;
void monitorIdriveRotaryStatus(QByteArray payload);
void monitorIdriveButtonStatus(QByteArray payload);
void monitorGearStatus(QByteArray payload);
void monitorEngineRPM(QByteArray payload);
void monitorVehicleSpeed(QByteArray payload);
void monitorCicStatus(QByteArray payload);
void injectFrame(QByteArray payload);
void switchTVInput();
// QString toDebug(const QByteArray & line);
AAHandler *aa_handler;
DebugWindow *debug;
};