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