diff --git a/src/software_test/tcpServer_test/FTPClient.cpp b/src/software_test/tcpServer_test/FTPClient.cpp new file mode 100644 index 0000000..4c3b04d --- /dev/null +++ b/src/software_test/tcpServer_test/FTPClient.cpp @@ -0,0 +1 @@ +#include "FTPClient.h" diff --git a/src/software_test/tcpServer_test/FTPClient.h b/src/software_test/tcpServer_test/FTPClient.h new file mode 100644 index 0000000..9adda9e --- /dev/null +++ b/src/software_test/tcpServer_test/FTPClient.h @@ -0,0 +1,13 @@ +#ifndef FTPCLIENT_H +#define FTPCLIENT_H + +#include "TCPClient.h" + +class FTPClient +{ + public: + protected: + private: +}; + +#endif //FTPCLIENT_H diff --git a/src/software_test/tcpServer_test/FTPServer.h b/src/software_test/tcpServer_test/FTPServer.h new file mode 100644 index 0000000..cd35e91 --- /dev/null +++ b/src/software_test/tcpServer_test/FTPServer.h @@ -0,0 +1,32 @@ +#ifndef FTPSERVER_H +#define FTPSERVER_H + +#include "TCPServer.h" + +template +class FTPServer : public TCPServer +{ + public: + FTPServer(unsigned int port = 22, const char login = "", const char password = "", uint8_t maxClient = MAX_CLIENT, uint16_t clientCommandDataBufferSize = 255) : TCPServer(port, maxClient, clientCommandDataBufferSize), _login(NULL), _password(NULL) + { + _login = (char *)malloc((sizeof(char) * strlen(login)) + 1); + if(_login != NULL) + strcpy(_login, login); + + _password = (char *)malloc((sizeof(char) * strlen(password)) + 1); + if(_password != NULL) + strcpy(_password, password); + } + + virtual ~FTPServer() + { + free(_login);free(_password); + } + + protected: + private: + char *_login; + char *_password; +}; + +#endif //FTPSERVER_H diff --git a/src/software_test/tcpServer_test/WEBClient.h b/src/software_test/tcpServer_test/WEBClient.h index b49c25c..beff4f2 100644 --- a/src/software_test/tcpServer_test/WEBClient.h +++ b/src/software_test/tcpServer_test/WEBClient.h @@ -3,7 +3,6 @@ #include "WEBServer.h" #include "TCPClient.h" -#include "Dictionary.h" class WEBClient : public TCPClient { diff --git a/src/software_test/tcpServer_test/tcpServer_test.ino b/src/software_test/tcpServer_test/tcpServer_test.ino index a146d64..36eb800 100644 --- a/src/software_test/tcpServer_test/tcpServer_test.ino +++ b/src/software_test/tcpServer_test/tcpServer_test.ino @@ -7,12 +7,14 @@ #include "TCPServer.h" #include "WEBServer.h" #include "WEBClient.h" +#include "FTPServer.h" +#include "FTPClient.h" uint32_t lastFreeMem(0); uint16_t lastClientCount(0); -TCPServer server(80, MAX_CLIENT, 5); -WEBServer webServer(8080); +//TCPServer server(80, MAX_CLIENT, 5); +//WEBServer webServer(8080); WiFiEventHandler gotIpEventHandler, disconnectedEventHandler; @@ -39,17 +41,17 @@ void debugInfo() Serial.print("Heap Frag : ");Serial.println(frag); lastFreeMem = freeMem; } - if(lastClientCount != server.getConnectedClientsCount()) + /*if(lastClientCount != server.getConnectedClientsCount()) { lastClientCount = server.getConnectedClientsCount(); Serial.print("Connected client(s) : ");Serial.println(lastClientCount); - } + }*/ } void loop() { // put your main code here, to run repeatedly: - server.runServer(); - webServer.runServer(); + //server.runServer(); + //webServer.runServer(); debugInfo(); }