forked from blacktigersoftware/ESP8266RFCTelnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSimpleTelnetServer.h
81 lines (59 loc) · 2.28 KB
/
SimpleTelnetServer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
Telnet support for the ESP8266 Wifi.
Copyright (c) 2016 Kenneth S. Davis, All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Extends supports of TelnetServer base class:
RFC 857 - TELNET ECHO OPTION
RFC 858 - TELNET SUPPRESS GO AHEAD OPTION
RFC 1079 - TELNET TERMINAL SPEED OPTION
*/
#ifndef _SIMPLETELNETSERVER_h
#define _SIMPLETELNETSERVER_h
#if defined(ARDUINO) && ARDUINO >= 100
#include "arduino.h"
#else
#include "WProgram.h"
#endif
#include "Telnet.h"
// telnet options
#define TELNET_OPTION_TERMINAL_SPEED 32
// Future work
//#define TELNET_OPTION_COM_PORT 44
/*
// Future work
#define TELNET_COM_PORT_OPTION_SIG
#define TELNET_COM_PORT_SET_BAUDRATE "1"
#define TELNET_COM_PORT_SET_DATASIZE "2"
#define TELNET_COM_PORT_SET_PARITY "3"
#define TELNET_COM_PORT_SET_STOPSIZE "4"
#define TELNET_COM_PORT_SET_CONTROL "5"
#define TELNET_COM_PORT_NOTFY_LINESTATE "6"
#define TELNET_COM_PORT_NOTFY_MODEMSTATE "7"
#define TELNET_COM_PORT_FLOW_SUSPEND "8"
#define TELNET_COM_PORT_FLOW_RESUME "9"
#define TELNET_COM_PORT_LINE_MASK "10"
#define TELNET_COM_PORT_MODEM_MASK "11"
#define TELNET_COM_PORT_PURGE "12"
*/
class SimpleTelnetServer : public TelnetServer
{
public:
SimpleTelnetServer();
virtual ~SimpleTelnetServer();
uint8_t recvBuffer[1024];
uint8_t recvBufLen;
protected:
virtual bool _processSubNegotiation(WiFiClient &client, struct ClientStruct &str);
virtual bool _processOption(WiFiClient &client, struct ClientStruct &str);
};
#endif