code upload

This commit is contained in:
e2002
2022-02-04 17:30:12 +03:00
parent fe3f0a261e
commit 3565d2fa17
44 changed files with 25103 additions and 1 deletions

33
yoRadio/telnet.h Normal file
View File

@@ -0,0 +1,33 @@
#ifndef telnet_h
#define telnet_h
#include <WiFi.h>
#define MAX_TLN_CLIENTS 5
#define MAX_PRINTF_LEN BUFLEN+50
class Telnet {
public:
Telnet() {};
bool begin();
void loop();
void stop();
void print(byte id, const char *buf);
void print(const char *buf);
void printf(byte id, const char *format, ...);
void printf(const char *format, ...);
void cleanupClients();
void info();
protected:
WiFiServer server = WiFiServer(23);
WiFiClient clients[MAX_TLN_CLIENTS];
void emptyClientStream(WiFiClient client);
void on_connect(const char* str, byte clientId);
void on_input(const char* str, byte clientId);
private:
bool _isIPSet(IPAddress ip);
};
extern Telnet telnet;
#endif