CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
candeviceinterface.h
Go to the documentation of this file.
1#ifndef CANDEVICEINTERFACE_H_DNXOI7PW
2#define CANDEVICEINTERFACE_H_DNXOI7PW
3
4#include <QtCore/QtGlobal>
5#include <QtSerialBus/QCanBusFrame>
6#include <functional>
7
9 virtual ~CanDeviceInterface() {}
10
11 typedef std::function<void(qint64)> framesWritten_t;
12 typedef std::function<void()> framesReceived_t;
13 typedef std::function<void(int)> errorOccurred_t;
14
15 virtual void setFramesWrittenCbk(const framesWritten_t& cb) = 0;
16 virtual void setFramesReceivedCbk(const framesReceived_t& cb) = 0;
17 virtual void setErrorOccurredCbk(const errorOccurred_t& cb) = 0;
18
19 virtual bool init(const QString& backend, const QString& iface) = 0;
20 virtual bool writeFrame(const QCanBusFrame& frame) = 0;
21 virtual bool connectDevice() = 0;
22 virtual void disconnectDevice() = 0;
23 virtual qint64 framesAvailable() = 0;
24 virtual void clearCallbacks() = 0;
25 virtual void setConfigurationParameter(int key, const QVariant& value) = 0;
26
27 virtual QCanBusFrame readFrame() = 0;
28 virtual void setParent(QObject* parent) = 0;
29};
30
31#endif /* end of include guard: CANDEVICEINTERFACE_H_DNXOI7PW */
Definition candeviceinterface.h:8
virtual void setParent(QObject *parent)=0
std::function< void()> framesReceived_t
Definition candeviceinterface.h:12
virtual qint64 framesAvailable()=0
virtual void clearCallbacks()=0
std::function< void(int)> errorOccurred_t
Definition candeviceinterface.h:13
virtual void setErrorOccurredCbk(const errorOccurred_t &cb)=0
std::function< void(qint64)> framesWritten_t
Definition candeviceinterface.h:11
virtual void disconnectDevice()=0
virtual void setFramesWrittenCbk(const framesWritten_t &cb)=0
virtual QCanBusFrame readFrame()=0
virtual void setFramesReceivedCbk(const framesReceived_t &cb)=0
virtual void setConfigurationParameter(int key, const QVariant &value)=0
virtual ~CanDeviceInterface()
Definition candeviceinterface.h:9
virtual bool init(const QString &backend, const QString &iface)=0
virtual bool connectDevice()=0
virtual bool writeFrame(const QCanBusFrame &frame)=0