MityDSP Documentation Index

tcFtpd

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";
     tcFtpd *MyClass::mpFtpServer;
     tcFtpdConfig ftpConfig;

     ...

     // create FAT filesystem C partition
     buffer[0] = 'C';
     buffer[1] = 0;

     rv = RegisterFATDriver((RAWREAD)tcDspStorageBase::readDispatch,
                            (RAWWRITE)tcDspStorageBase::writeDispatch,
                            (GETTIME)TimeCallback, &device, buffer, (void *)mpDevice);

     // start network
     lwip_stack_init();

     // configure server
     ftpConfig.mpRootDir    = root;
     ftpConfig.mpUsername   = user;
     ftpConfig.mpPassword   = pass;
     ftpConfig.mnMaxClients = 1;

     // launch server
     mpFtpServer = new tcFtpd(&ftpConfig);

     ...
 } 

  
Generated on Fri Sep 23 16:34:01 2011 for MityDSP Net by  Doxygen Version 1.6.1
Copyright © 2009, Critical Link LLC, All rights reserved.