This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

FTP client creation

Hi,

I am confused about how to use the RL-ARM's TCPNet for creating an FTP Client.

Server:
My board isMCB4300. Keil_v5\ARM\Boards\Keil\MCB1800\RL\TCPnet has an FTP_demo application (it should probably be named FTP_Server_demo). It looks like only thing a server needs is to call Init_TCPNet() and main_TCPNet() and filling the file interfaces (ftp_fopen, ftp_fclose, ftp_fread, etc). From RL-ARM TCPNet user manual for ftp server (In order to use an Embedded FTP Server, you have to enable and configure it in the configuration file, and provide the File System Interface functions). So far so good.

Client:
There is no example for the client. According to the RL_ARM user manual "In order to use an Embedded FTP Client, you have to enable and configure it in the configuration file, and provide the File System Interface functions". Which I can do.

So how do I list directories, create a sub-directory and put/get a file?

RM-ARM says "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."

First of all, I need more than one command in my session. Say i divide my sessions into three. I m totally confused about the parameters of callback function. Some places it looks like

void (*cbfunc)(U8 event);

In other places it looks like this

U16 ftpc_cbfunc (
    U8   code,      /* Type of data requested by the FTP Client. */
    U8*  buf,       /* Location where to write the requested data. */
    U16  buflen );  /* Number of bytes in the output buffer. */


We should need both callbacks..

http://www.keil.com/support/man/docs/rlarm/rlarm_ftpc_connect.htm has an example of get command (FTPC_CMD_GET). How does the server know the path of the get?

http://www.keil.com/support/man/docs/rlarm/rlarm_ftpc_cbfunc.htm has another example which shows the callback function. How is that callback function ftpc_cbfunc used? Is ftp_connect using it? It needs more elaboration.

I am requesting for an example that shows the connect call, use of a command (like get) with all the parameters (like path and file name) and events (like success, failure).

Please help.

0