#ifndef FTPCLIENT_H #define FTPCLIENT_H #include "TCPClient.h" #include "FTPServer.h" #include "Dictionary.h" class FTPClient : public TCPClient { template friend class FTPServer; public: FTPClient(WiFiClient client, uint8_t id, uint16_t clientCommandDataBufferSize = 255); virtual ~FTPClient(); protected: private: FTPClient(const FTPClient &Object) : TCPClient(Object){} void setDataClient(WiFiClient dataClient); //Also known as the data socket boolean parseCommandAndParameters(void); void setUsername(const char *username); void setCurrentDirectory(const char *dir); void setCurrentFile(const char *file); void startTimeout(); void closeDataConnection(); char _ftpCommand[5] = {'\0'}; Dictionary *_cmdParameters = NULL; boolean _loggedIn = false; char *_username = NULL; char *_currentDirectory = NULL; char *_currentFile = NULL; size_t _fileSentBytes = 0; size_t _fileRecvBytes = 0; boolean _waitingForDataConnection = false; boolean _fileIsBeeingReceived = false; uint64_t _actionTimeout = 0; boolean _dataClientConnected = false; FTPServer::FTPClientState _ftpClientState = FTPServer::FTPClientState::INIT; FTPServer::BinaryFlag _binaryFlag = FTPServer::BinaryFlag::OFF; FTPServer::FTPClientDataTransfer _dataTransferPending = FTPServer::FTPClientDataTransfer::NONE; WiFiClient _dataClient; //data socket }; #endif //FTPCLIENT_H