summaryrefslogtreecommitdiff
path: root/qt/RGBController/old_src/serial.h
blob: 6403887943741edbddc9abe9a1eb6488f3bea349 (plain)
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
#ifndef SERIAL_H
#define SERIAL_H

#include <QObject>
#include <QSerialPort>
#include <QSerialPortInfo>
#include <QDebug>

class serial : public QObject
{
	Q_OBJECT
	public:
		explicit serial(QObject *parent = 0);


		/* function declares */
		bool serial_connect(QString port);
		bool serial_disconnect();
		void rgb_change(int r, int g, int b);
		void send(QString com);
		void parse(QString message);
		/* variables */
		QString port_name;
		//QSerialPort ser;
		QSerialPort *ser;
		QByteArray data;
		QByteArray serdata;
	private slots:
		void read();
};

#endif // SERIAL_H