Functions

Functions

int32_t ftp_server_init (user_type *user, void *(*fat_init_ftp)(void), int32_t max_connections)
 Initialize FTP server. More...
 
void ftp_server_timeout (uint32_t timeout)
 Set a FTP server timeout for inactive connection. More...
 
ftp_return_typeftp_server (void)
 The main polling function for concurrent FTP server. More...
 
uint32_t ftp_is_server_connected (void)
 Test if clients are connected. More...
 
void ftp_set_passive_mode (uint16_t mode)
 Activate passive mode for FTP server. More...
 

Detailed Description

FTP Server

Function Documentation

int32_t ftp_server_init ( user_type user,
void *(*)(void)  fat_init_ftp,
int32_t  max_connections 
)
Parameters
*user- pointer to user list
*fat_init_ftp- pointer to mmc initialize function
max_connections- connection limitation
Returns
  • TRUE - success
  • FALSE - out of memory
Library:
ftp.lib
Prototype:
ftplib.h
Examples:
FTPServer.c.
void ftp_server_timeout ( uint32_t  timeout)
Parameters
timeout- timeout after FTP connection is closed
Returns
nothing
Library:
ftp.lib
Prototype:
ftplib.h
Note
Zero defines no timeout
Examples:
FTPServer.c.
ftp_return_type* ftp_server ( void  )
Note
Must be called with net_isq() in the main loop.
Parameters
-
Returns
  • (-1) Server out of memory
  • ( 0) Normal return
  • (>0) After successful STOR command
Library:
ftp.lib
Prototype:
ftplib.h
Recognized commands:

             USER    PORT    STOR    NLST    CDUP    PASS
             RETR    ABOR    TYPE    SYST    CWD     REIN
             HELP    PWD     QUIT    LIST    XPWD    REST
             ABOR    DELE    NOOP    RNFR    RNTO    BOOT
             PASV
Examples:
FTPServer.c.
uint32_t ftp_is_server_connected ( void  )
Parameters
-
Returns
  • >0 - server connected
  • 0 - server not connected
Library:
ftp.lib
Prototype:
ftplib.h
Examples:
FTPServer.c.
void ftp_set_passive_mode ( uint16_t  mode)
Parameters
mode= 0 - passive mode off
mode= 1 - passive mode on
Returns
-
Library:
ftp.lib
Prototype:
ftplib.h