#include <rtl.h>
BOOL ftpc_connect (
U8* ipadr, /* IP address of the FTP server. */
U16 port, /* Port number of FTP server. */
U8 command, /* FTP command to perform on connect. */
void (*cbfunc)(U8 event) ); /* Function to call when the session ends. */
Description
The ftpc_connect function starts the FTP client on the
TCPnet system. This causes the FTP client to then start a FTP session
by connecting to a FTP server on the TCP port specified in the
function argument. If the port is not specified, that is the
argument port has a value of 0, the system uses a standard FTP
server port to connect to.
The argument ipadr points to an array of 4 bytes containing
the dotted-decimal notation of the IP address of the FTP server to
connect to.
The argument command spedifies a command to preform, when
FTP client connects to FTP server. The following commands are
supported:
Command
Description
FTPC_CMD_PUT
Puts a local file from local system to FTP server.
FTPC_CMD_GET
Retrieves a file from FTP server to a local file.
FTPC_CMD_APPEND
Appends a local file to an existing file on FTP server.
FTPC_CMD_DELETE
Deletes a file from FTP server.
FTPC_CMD_LIST
Lists files located on FTP server (detail information).
FTPC_CMD_RENAME
Renames a file or directory on FTP server.
FTPC_CMD_MKDIR
Creates a new directory on FTP server.
FTPC_CMD_RMDIR
Deletes an empty directory on FTP server.
FTPC_CMD_NLIST
Lists file names located on FTP server (names only).
The argument cbfunc points to a function that the FTP
client running on TCPnet calls when the FTP session ends. The
cbfunc is an event callback function that uses the
event argument of the cbfunc function to signal one of
the following FTP events:
Event
Description
FTPC_EVT_SUCCESS
The file operation completed successfully.
FTPC_EVT_TIMEOUT
FTP Server response has timed out, and hence the FTP client
has aborted the operation.
FTPC_EVT_LOGINFAIL
The FTP client failed to logon to FTP server.
FTPC_EVT_NOACCESS
The file access to a specified file is not allowed.
FTPC_EVT_NOTFOUND
The requested file was not found on FTP server.
FTPC_EVT_NOPATH
Working directory path not found on FTP server.
FTPC_EVT_ERRLOCAL
File open or file write error on local system.
FTPC_EVT_ERROR
An error encountered during the file operation.
The ftpc_connect function is in the RL-TCPnet library. The
prototype is defined in rtl.h.
note
The standard FTP server port is TCP port 21.
Your application, running on TCPnet, can call the
ftpc_connect function to connect to a FTP server to manage
files.
Return Value
The ftpc_connect function returns __TRUE if the FTP client
has been successfully started. Otherwise it returns __FALSE.
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.