forked from demitov/dashApp
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserialport.h
More file actions
34 lines (25 loc) · 717 Bytes
/
serialport.h
File metadata and controls
34 lines (25 loc) · 717 Bytes
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
#ifndef SERIALPORT_H
#define SERIALPORT_H
#include <QObject>
#include <QSerialPort>
class SerialPort : public QObject
{
Q_OBJECT
Q_PROPERTY(QString serial_data READ get_serial_data WRITE set_serial_data NOTIFY serial_data_Changed)
public:
SerialPort(QObject *parent = 0);
~SerialPort();
QString get_serial_data() const;
void set_serial_data(QString newValue);
public slots:
void onReadData();
signals:
void serial_data_Changed(QString newValue);
private:
QSerialPort *arduino;
// static const quint16 arduino_uno_vendor_id = 0x2341;
// static const quint16 arduino_uno_product_id = 0x0001;
QString mSerial_data;
void openDefault();
};
#endif // SERIALPORT_H