diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-01-12 22:54:13 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-01-12 22:54:13 -0600 |
commit | dc91899c25b1c87bfd33531715c8ca3498044a43 (patch) | |
tree | baf1460c1f9e87a2c4eb04e3e1b9498cdb979eed /servers/logic_analyzer_server_lin/src/logic_analyzer_server.h | |
parent | 061289c61346568047e75a15f4ab1b874e4654d1 (diff) | |
download | ulab-dc91899c25b1c87bfd33531715c8ca3498044a43.tar.gz ulab-dc91899c25b1c87bfd33531715c8ca3498044a43.zip |
Add initial version of a logic analyzer server
Diffstat (limited to 'servers/logic_analyzer_server_lin/src/logic_analyzer_server.h')
-rw-r--r-- | servers/logic_analyzer_server_lin/src/logic_analyzer_server.h | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/servers/logic_analyzer_server_lin/src/logic_analyzer_server.h b/servers/logic_analyzer_server_lin/src/logic_analyzer_server.h new file mode 100644 index 0000000..431eea8 --- /dev/null +++ b/servers/logic_analyzer_server_lin/src/logic_analyzer_server.h @@ -0,0 +1,98 @@ +/* + * Remote Laboratory Logic Analyzer Server + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (c) 2012-2014 Timothy Pearson + * Raptor Engineering + * http://www.raptorengineeringinc.com + */ + +#include <tqsocket.h> +#include <tqserversocket.h> +#include <tqapplication.h> +#include <tqvbox.h> +#include <tqtextview.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqtextstream.h> + +#include <ksimpleconfig.h> + +#include <tdekrbserversocket.h> + +#include <tqtrla.h> + +#define MAGIC_NUMBER 1 +#define PROTOCOL_VERSION 1 + +class LogicAnalyzerSocket : public TDEKerberosServerSocket +{ + Q_OBJECT + + public: + LogicAnalyzerSocket(int sock, TQObject *parent=0, const char *name=0); + ~LogicAnalyzerSocket(); + + public: + void close(); + void initiateKerberosHandshake(); + int enterCommandLoop(); + + private slots: + void finishKerberosHandshake(); + void connectionClosedHandler(); + int setupGPMC(); + void commandLoop(); + + private: + int line; + int m_criticalSection; + int m_pollInterval; + bool enableDebug; + TQString m_remoteHost; + int m_fd_tty; + + TQTimer* m_kerberosInitTimer; + TQTimer* m_loopTimer; + + KSimpleConfig* m_config; + + friend class LogicAnalyzerServer; +}; + +class LogicAnalyzerServer : public TQServerSocket +{ + Q_OBJECT + + public: + LogicAnalyzerServer(TQObject* parent=0, int port=0, KSimpleConfig* config=0); + ~LogicAnalyzerServer(); + + void newConnection(int socket); + + private slots: + void remoteConnectionClosed(); + + signals: + void newConnect(LogicAnalyzerSocket*); + + private: + KSimpleConfig* m_config; + int m_numberOfConnections; + + friend class LogicAnalyzerSocket; + +};
\ No newline at end of file |