diff options
author | daniel-Jones <daniel@danieljon.es> | 2017-07-06 19:04:48 +0930 |
---|---|---|
committer | daniel-Jones <daniel@danieljon.es> | 2017-07-06 19:04:48 +0930 |
commit | d3624454f67e3afc026d7e16546f5549e67f6102 (patch) | |
tree | e370fc7bd48c58f9d4a523d9eb7c554ebf6b461e /qt/console/main.cpp | |
parent | 9834782c287b1dc6df59a03e5992911d8fb70a83 (diff) | |
download | RGB-Controller-d3624454f67e3afc026d7e16546f5549e67f6102.tar.gz RGB-Controller-d3624454f67e3afc026d7e16546f5549e67f6102.zip |
Added console based server that allows clients to connect and send commands to the microcontroller, does not require X to use, includes the IRC bot. Also included my beginning works on a c ncurses based client.
Diffstat (limited to 'qt/console/main.cpp')
-rw-r--r-- | qt/console/main.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/qt/console/main.cpp b/qt/console/main.cpp index 4771303..90919ca 100644 --- a/qt/console/main.cpp +++ b/qt/console/main.cpp @@ -3,6 +3,7 @@ #include <QSerialPortInfo> #include <QSerialPort> #include <QTimer> +#include <QThread> void show_ports(); bool serial_connect(QString port); @@ -71,6 +72,8 @@ bool serial_connect(QString port) serial.setFlowControl(QSerialPort::NoFlowControl); serial.open(QIODevice::ReadWrite); serial.waitForBytesWritten(9000); + + QThread::sleep(1); if (serial.isWritable()) { return true; } @@ -93,7 +96,7 @@ void send(QString com) { data = ""; data.append(com + "\n"); - //qDebug() << "sending:" << data; + qDebug() << "sending:" << data; if (serial.isOpen()) { serial.write(data); |