-
Notifications
You must be signed in to change notification settings - Fork 2
/
prop.h
45 lines (38 loc) · 977 Bytes
/
prop.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
// ******************************************************
// * copyright (C) 2017 by Reinhardt Behm/[email protected]
// * All Rights reserved
// * created 1/24/2017 by behm
// ******************************************************
#ifndef PROP_H
#define PROP_H
class IBSerialPort;
class Prop : public QObject
{
Q_OBJECT
public:
explicit Prop(const QString name, uint baud, QObject *parent = 0);
~Prop();
IBSerialPort *port() const { return m_port; }
QString device() const;
QString portName() const;
uint baud() const;
signals:
void byteRxd(char c);
void deviceChanged(const QString deviceBaud) const;
public slots:
void setDevice(const QString device, uint baud) const;
void send(const QByteArray ba);
void upload(const QByteArray ba);
void resetProp();
private slots:
void readyRead();
void timerTick();
protected:
private:
IBSerialPort *m_port;
bool m_lastWasSpace;
QByteArray m_uploadData;
int m_uploadIdx;
QTimer *m_timer;
};
#endif // PROP_H