-
Notifications
You must be signed in to change notification settings - Fork 0
/
device.hpp
28 lines (22 loc) · 651 Bytes
/
device.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
#pragma once
#include <QtSerialBus/QCanBusDevice>
#include "devices.hpp"
class CandleApiListener;
class CandleApiDevice : public CandleApiDevices
{
public:
explicit CandleApiDevice(QString name);
virtual ~CandleApiDevice();
public:
bool open() override;
void close() override;
bool writeFrame(const QCanBusFrame &msg) override;
QString interpretErrorFrame(const QCanBusFrame &errorFrame) override;
bool setBitTiming(uint32_t bitrate, uint32_t samplePoint);
void readFrames();
private:
CandleApiListener *_lstn;
CandleApiInterface *_iface;
uint32_t _deviceTicksStart;
uint64_t _hostOffsetStart;
};