-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSerialUSBcomms.h
More file actions
52 lines (38 loc) · 1.32 KB
/
SerialUSBcomms.h
File metadata and controls
52 lines (38 loc) · 1.32 KB
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
46
47
48
49
50
51
52
#ifndef SERIALUSBCOMMS_H
#define SERIALUSBCOMMS_H
#include <QObject>
#include "Defines.h"
#ifdef INCLUDE_SERIAL_USB
#include <QtSerialPort/QSerialPortInfo>
#include <QSerialPort>
#endif
class SerialUSBcomms : public QObject
{
Q_OBJECT
public:
explicit SerialUSBcomms(QObject *parent = nullptr);
//void readUSBdata();
void findSerialPort();
void setUpSerialPort();
void closeSerialPort();
bool getSerialCommsConnected() const;
void setSerialCommsConnected(bool value);
void initialiseUSBsignalsAndSlots();
bool getIsUSBinitialised() const;
void setIsUSBinitialised(bool value);
signals:
void SerialPortFound(QString portDetails);
void newSerialUSBdata(QByteArray dataReceived);
void AddToHostWindowListWidget(QString rhubarbRhubarb);
public slots:
void receivePacket();
void sendPacket(QByteArray packet);
private:
#ifdef INCLUDE_SERIAL_USB
QSerialPort *serialUSB;
#endif
bool serialCommsConnected; // is the serial port connected and working.
bool isUSBinitialised; // used to trigger a single instance of USB port connectSignals.
};
//extern SerialUSBcomms serialUSBcomms;
#endif // SERIALUSBCOMMS_H