source: pacpussensors/trunk/TelnetClient/TelnetClient.h@ 67

Last change on this file since 67 was 54, checked in by DHERBOMEZ Gérald, 10 years ago

add plugin that gives a telnet connection

File size: 2.0 KB
Line 
1/*********************************************************************
2// created: 2012/03/01 - 14:06
3// filename: TelnetClient.h
4//
5// author: Pierre Hudelaine
6// Copyright Heudiasyc UMR UTC/CNRS 7253
7//
8// version: $Id: $
9//
10// purpose: Create network socket if needed in Pacpus
11//
12*********************************************************************/
13
14#include <QTcpSocket>
15#include <QHostAddress>
16
17#include "Pacpus/kernel/Log.h"
18#include "Pacpus/kernel/ComponentBase.h"
19#include "Pacpus/kernel/ComponentFactory.h"
20
21// Export macro for TelnetClient DLL for Windows only
22#ifdef WIN32
23# ifdef TelnetClient_EXPORTS
24 // make DLL
25# define TelnetClient_API __declspec(dllexport)
26# else
27 // use DLL
28# define TelnetClient_API __declspec(dllimport)
29# endif
30#else
31 // On other platforms, simply ignore this
32# define TelnetClient_API
33#endif
34
35class QByteArray;
36
37namespace pacpus {
38
39
40class TelnetClient_API TelnetClient
41 : public QObject
42 , public ComponentBase
43{
44 Q_OBJECT
45
46public:
47 /// Constructor
48 TelnetClient(QString name);
49
50 /// Destructor
51 ~TelnetClient();
52 TelnetClient * getSocket() {return this;}
53
54public Q_SLOTS:
55 /// Slot de lecture des paquets envoys pour tests
56 void readPendingDatagrams();
57
58 /// Slot d'envoie des paquets
59 //void sendDatagrams(QString frame);
60 //void sendDatagrams(QByteArray frame);
61
62Q_SIGNALS:
63 void newDatagram(QByteArray datagram);
64 void newQString(QString string);
65
66public slots:
67 void ConnectionMessage();
68
69protected:
70 // The 3 virtual methods relative to the ComponentBase inheritance
71 virtual void startActivity();
72 virtual void stopActivity();
73 virtual COMPONENT_CONFIGURATION configureComponent(XmlComponentConfig config);
74
75 QTcpSocket * socket_;
76
77 quint16 port_;
78 QHostAddress address_;
79
80};
81
82} // namespace pacpus
Note: See TracBrowser for help on using the repository browser.