The ftp_return_type structure contains detailed information about the last performed DELE, STOR or BOOT command.
The structure is defined in ftplib.h.
typedef struct
{
#define FTP_PASS_CMD 2
#define FTP_DELE_CMD 6
#define FTP_STOR_CMD 10
#define FTP_BOOT_CMD 31
Member:
- reason => last performed FTP command
- error_code => file system error code
- offset => file offset
- fp => file pointer (refer EFS)
Example FTP server handling:
{
{
printf (" File upload... ");
break;
printf (" Boot command... ");
bootload (ftp_ret->offset);
break;
printf (" Delete command... ");
break;
printf (" new connection\r\n");
return;
}
{
printf (" Boot sector protection error\r\n");
break;
printf (" FTP checksum error\r\n");
break;
printf (" Intel Hex error\r\n");
break;
printf (" FLASH sector erase error\r\n");
break;
printf (" FLASH program error\r\n");
break;
printf (" Buffer under-run error\r\n");
break;
printf (" Out of memory error\r\n");
break;
printf (" Out of range error\r\n");
break;
default:
printf (" Unknown error\r\n");
break;
printf (" successful\r\n");
printf (
" offset: 0x%08lx\r\n", ftp_ret->
offset);
printf (
" file name: %s\r\n", ftp_ret->
fp -> name);
printf (
" file size: %ld words\r\n", ftp_ret->
fp -> size);
break;
}
}
- Examples:
- FTPServer.c.