forked from colinbourassa/memsgauge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
memsinterface.h
77 lines (64 loc) · 1.84 KB
/
memsinterface.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef MEMSINTERFACE_H
#define MEMSINTERFACE_H
#include <QObject>
#include <QString>
#include <QHash>
#include <QByteArray>
#include <QHash>
#include "rosco.h"
#include "commonunits.h"
class MEMSInterface : public QObject
{
Q_OBJECT
public:
explicit MEMSInterface(QString device, QObject *parent = 0);
~MEMSInterface();
void setSerialDevice(QString device) { m_deviceName = device; }
QString getSerialDevice() { return m_deviceName; }
int getIntervalMsecs();
bool isConnected();
void disconnectFromECU();
mems_data* getData() { return &m_data; }
librosco_version getVersion() { return mems_get_lib_version(); }
void cancelRead();
public slots:
void onParentThreadStarted();
void onFaultCodesClearRequested();
void onStartPollingRequest();
void onShutdownThreadRequest();
void onFuelPumpTest();
void onPTCRelayTest();
void onACRelayTest();
void onIgnitionCoilTest();
void onFuelInjectorTest();
void onIdleAirControlMovementRequest(int desiredPos);
signals:
void dataReady();
void connected();
void disconnected();
void readError();
void readSuccess();
void faultCodesClearSuccess();
void failedToConnect(QString dev);
void interfaceThreadReady();
void notConnected();
void gotEcuId(uint8_t* id_buffer);
void errorSendingCommand();
void fuelPumpTestComplete();
void ptcRelayTestComplete();
void acRelayTestComplete();
void moveIACComplete();
private:
mems_data m_data;
QString m_deviceName;
mems_info m_memsinfo;
bool m_stopPolling;
bool m_shutdownThread;
bool m_initComplete;
bool m_serviceLoopRunning;
uint8_t m_d0_response_buffer[4];
void runServiceLoop();
bool connectToECU();
bool actuatorOnOffDelayTest(actuator_cmd onCmd, actuator_cmd offCmd);
};
#endif // CUXINTERFACE_H