summaryrefslogtreecommitdiff
path: root/qt/consoleserver/main.cpp
diff options
context:
space:
mode:
authordaniel-Jones <daniel@danieljon.es>2017-07-06 19:04:48 +0930
committerdaniel-Jones <daniel@danieljon.es>2017-07-06 19:04:48 +0930
commitd3624454f67e3afc026d7e16546f5549e67f6102 (patch)
treee370fc7bd48c58f9d4a523d9eb7c554ebf6b461e /qt/consoleserver/main.cpp
parent9834782c287b1dc6df59a03e5992911d8fb70a83 (diff)
downloadRGB-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/consoleserver/main.cpp')
-rw-r--r--qt/consoleserver/main.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/qt/consoleserver/main.cpp b/qt/consoleserver/main.cpp
new file mode 100644
index 0000000..c944e38
--- /dev/null
+++ b/qt/consoleserver/main.cpp
@@ -0,0 +1,30 @@
+#include <QCoreApplication>
+#include <QObject>
+#include "serial.h"
+#include "server.h"
+#include "irc.h"
+
+void worker(QString arg1);
+
+serial ser;
+server srv;
+irc ircbot;
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication a(argc, argv);
+ if (argc > 1)
+ worker(argv[1]);
+ else
+ worker("none");
+ return a.exec();
+}
+
+void worker(QString arg1)
+{
+ srv.server_start();
+ ser.start(arg1);
+ ircbot.setup("irc.danieljon.es", 6667, "#csgo", "LightBot");
+ QObject::connect(&srv, SIGNAL(sendcmd(QString)), &ser, SLOT(send(QString)));
+ QObject::connect(&ircbot, SIGNAL(sendcmd(QString)), &ser, SLOT(send(QString)));
+}