TelnetServer.h
Go to the documentation of this file.
1 /****
2  * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
3  * Created 2015 by Skurydin Alexey
4  * http://github.com/SmingHub/Sming
5  * All files of the Sming Core are provided under the LGPL v3 license.
6  *
7  * TelnetServer.h
8  *
9  * Created on: 18 apr. 2015
10  * Author: Herman
11  *
12  ****/
13 
20 #pragma once
21 
22 #include "TcpClient.h"
23 #include "TcpServer.h"
24 #include "SystemClock.h"
26 
27 #ifndef TELNETSERVER_MAX_COMMANDSIZE
28 #define TELNETSERVER_MAX_COMMANDSIZE 64
29 #endif
30 
32 
33 class TelnetServer : public TcpServer
34 {
35 public:
36  void enableDebug(bool reqStatus);
37  void enableCommand(bool reqStatus);
38 
39 private:
40  void onClient(TcpClient* client) override;
41  bool onClientReceive(TcpClient& client, char* data, int size) override;
42  void onClientComplete(TcpClient& client, bool successful) override;
43 
44  void wrchar(char c);
45 
46 private:
47  TcpClient* curClient = nullptr;
48  CommandExecutor* commandExecutor = nullptr;
49  bool telnetDebug = true;
50  bool telnetCommand = true;
51 };
52 
void enableCommand(bool reqStatus)
Definition: TcpClient.h:46
Definition: Delegate.h:20
Definition: CommandExecutor.h:21
Definition: TelnetServer.h:33
Definition: TcpServer.h:30
void enableDebug(bool reqStatus)