|
Arduino TinyFTP
|
FTPSession An FTPBasicAPI which owns its command and data connections. More...
#include <FTPSession.h>
Public Member Functions | |
| bool | begin (IPAddress &address, int port, const char *username, const char *password) |
| Opens the command connection and logs in. | |
| void | end () |
| Closes the command and data connections. | |
| bool | connected () |
| Returns true if logged in and the command connection is still alive. | |
| operator bool () | |
| bool | begin (Client *cmdPar, Client *dataPar, IPAddress &address, int port, const char *username, const char *password) |
| bool | quit () |
| bool | passv () |
| bool | del (const char *file) |
| bool | mkdir (const char *dir) |
| bool | rmd (const char *dir) |
| size_t | size (const char *file) |
| ObjectType | objectType (const char *file) |
| bool | abort () |
| bool | binary () |
| bool | ascii () |
| bool | type (const char *txt) |
| Client * | read (const char *file_name) |
| Starts the download (if necessary): returns nullptr if it failed. | |
| Client * | write (const char *file_name, FileMode mode) |
| Starts the upload (if necessary): returns nullptr if it failed. | |
| Client * | ls (const char *file_name) |
| Starts the directory listing: returns nullptr if it failed. | |
| bool | dataConnected () |
| void | closeData () |
| bool | endTransfer (const char *tag) |
| uint32_t | reserve () |
| Reserves the session for a new transfer: returns its id. | |
| uint32_t | transferId () |
| Id of the current (or last) transfer. | |
| bool | isTransfer (uint32_t id) |
| Returns true if the transfer with the indicated id is still active. | |
| void | addHandle (uint32_t id) |
| void | releaseHandle (uint32_t id) |
| Unregisters a handle: the transfer ends when the last handle is gone. | |
| void | setCurrentOperation (CurrentOperation op) |
| CurrentOperation | currentOperation () |
| void | flush () |
| bool | checkResult (const char *expected[], const char *command, bool wait_for_data=true) |
| bool | cmd (const char *command, const char *par, const char *expected, bool wait_for_data=true) |
| bool | cmd (const char *command_str, const char *par, const char *expected[], bool wait_for_data=true) |
| void | setUseTypeCommand (bool useType) |
Protected Member Functions | |
| void | resetTransfer () |
| Forgets the current transfer: e.g. when the connection was closed. | |
| void | skipReplies (unsigned long ms) |
| Consumes all replies which arrive within the indicated time. | |
| bool | connect (IPAddress adr, int port, Client *client_ptr, bool doCheckResult=false) |
| bool | isExpected (const char *reply, const char *expected[]) |
| bool | readReply (char *reply, int maxLen) |
| bool | readReplyLine (char *str, int maxLen) |
Protected Attributes | |
| ClientType | command_client |
| ClientType | data_client |
| CurrentOperation | current_operation = NOP |
| Client * | command_ptr = nullptr |
| Client * | data_ptr = nullptr |
| IPAddress | remote_address |
| bool | is_open = false |
| bool | use_type = false |
| char | result_reply [100] = {0} |
| uint32_t | transfer_id = 0 |
| int | handles = 0 |
FTPSession An FTPBasicAPI which owns its command and data connections.
| ClientType | The type of client to use for command and data connections. It should be a class that implements the Client interface. |
Registers an additional handle (FTPFile or FTPFileIterator copy) of the transfer
|
inlineinherited |
Returns true while the server keeps the data connection open (or there is still unread data)
Ends the current transfer: closes the data connection, consumes the final status of the transfer (if one was started) and releases the session
|
inlineprotectedinherited |
Returns true if the reply starts with one of the expected codes (or if no codes are expected)
Reads a complete (potentially multi-line) reply from the command connection. The first line (which contains the reply code) is returned.
Reads a single line (w/o trailing \r
) from the command connection with timeout. Lines longer then the buffer are truncated.