From d3624454f67e3afc026d7e16546f5549e67f6102 Mon Sep 17 00:00:00 2001 From: daniel-Jones Date: Thu, 6 Jul 2017 19:04:48 +0930 Subject: 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. --- qt/console/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'qt/console/main.cpp') 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 #include #include +#include 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); -- cgit v1.2.3