Introduction
The tcFtpd class is used to launch a simple FTP server. A configuration structure of type tcFtpdConfig, is passed in to configure the server. The root directory, username/password, priority of the client and server threads, and the number of simultaneous clients are all configurable.
Only the rudimentary FTP commands are supported, including: "CWD", "DELE", "LIST", "MKD", "XMKD", "NLST", "NOOP", "PASS", "PASV", "PORT", "PWD", "XPWD", "QUIT", "RETR", "RMD", "XRMD", "RNFR", "RNTO", "STOR", "SYST", "TYPE", "USER"
- Note:
- A FAT filesystem, based upon the MityDSP fatfs.lib, and a network interface, based upon the MityDSP lwIP port, are prerequisites for using this class.
- See also:
- tcFtpd Class Reference
-
tcFtpdConfig Class Reference
Example
This is a simple example of tcFtpd creation and usage:
{
static char root[] = "C:";
static char user[] = "Fred";
static char pass[] = "flintstone";
...
buffer[0] = 'C';
buffer[1] = 0;
rv = RegisterFATDriver((RAWREAD)tcDspStorageBase::readDispatch,
(RAWWRITE)tcDspStorageBase::writeDispatch,
(GETTIME)TimeCallback, &device, buffer, (void *)mpDevice);
lwip_stack_init();
mpFtpServer =
new tcFtpd(&ftpConfig);
...
}