1 #include "FTPBasicAPI.h"
16 template <
class ClientType>
19 FTPSession() { FTPLogger::writeLog(LOG_DEBUG,
"FTPSession"); }
22 FTPLogger::writeLog(LOG_DEBUG,
"~FTPSession");
27 bool begin(IPAddress &address,
int port,
const char *username,
28 const char *password) {
29 if (!is_valid)
return false;
30 return basic_api.begin(&command_client, &data_client, address, port,
35 if (!is_valid)
return;
36 FTPLogger::writeLog(LOG_DEBUG,
"FTPSession",
"end");
45 operator bool() {
return is_valid && command_client.connected(); }
48 void setValid(
bool valid) { is_valid = valid; }
51 ClientType command_client;
52 ClientType data_client;
57 FTPLogger::writeLog(LOG_DEBUG,
"FTPSession",
"endCommand");
58 command_client.stop();
62 FTPLogger::writeLog(LOG_DEBUG,
"FTPSession",
"endData");
FTPBasicAPI Implementation of Low Level FTP protocol. In order to simplify the logic we always use Pa...
Definition: FTPBasicAPI.h:17
FTPSession This class manages the FTP session, including command and data connections....
Definition: FTPSession.h:17
void setValid(bool valid)
Used to set as invalid for dummy error session.
Definition: FTPSession.h:48
FTPBasicAPI & api()
Returns the access to the basic API.
Definition: FTPSession.h:42
bool begin(IPAddress &address, int port, const char *username, const char *password)
Initializes the session with the command client.
Definition: FTPSession.h:27