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 <user_config.h>
23 #include "TcpClient.h"
24 #include "TcpServer.h"
25 #include "SystemClock.h"
27 
28 #ifndef TELNETSERVER_MAX_COMMANDSIZE
29 #define TELNETSERVER_MAX_COMMANDSIZE 64
30 #endif
31 
33 
34 class TelnetServer : public TcpServer
35 {
36 public:
37  // void setCommandDelegate(TelnetServerCommandDelegate reqDelegate);
38  void enableDebug(bool reqStatus);
39  void enableCommand(bool reqStatus);
40 
41 private:
42  void onClient(TcpClient* client) override;
43  bool onClientReceive(TcpClient& client, char* data, int size) override;
44  void onClientComplete(TcpClient& client, bool successful) override;
45 
46  void wrchar(char c);
47 
48 private:
49  TcpClient* curClient = nullptr;
50  CommandExecutor* commandExecutor = nullptr;
51  bool telnetDebug = true;
52  bool telnetCommand = true;
53 };
54 
void enableCommand(bool reqStatus)
Definition: TcpClient.h:46
Definition: Delegate.h:20
Definition: CommandExecutor.h:20
Definition: TelnetServer.h:34
Definition: TcpServer.h:30
void enableDebug(bool reqStatus)