FTP Client on MCF52259 Demo board, MQX 3.0

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FTP Client on MCF52259 Demo board, MQX 3.0

Jump to solution
1,342 Views
appooz
Contributor I

Hi,

I am using MQX 3.0 on MCF52259 Demo board.

I cant find out how to use the board as an FTP client. I could use it as a server though.

 

I can see the ftpclient.c source in the RTCS source. However I cant find, from where it is called. I also see some references to an RTCS shell, which i cannot open.

 

I am using the shell on the serial interface. The "help" command does not show any commands for starting an FTP client.

 

Please help me out!

 

 

Labels (1)
Tags (1)
0 Kudos
1 Solution
409 Views
PetrM
Senior Contributor I

Hello,

 

you should be able to define following FTP client commands in your application and call the FTP_client("192.168.1.1") function (located in ftpc.c):


const FTPc_COMMAND_STRUCT FTPc_commands[] = {
   { "ascii",        FTPc_ascii       },
   { "binary",       FTPc_binary      },
   { "bye",          FTPc_bye         },
   { "cd",           FTPc_cd          },
   { "close",        FTPc_close       },
   { "delete",       FTPc_delete      },
   { "get",          FTPc_get         },
   { "help",         FTPc_help        },
   { "ls",           FTPc_ls          },
   { "mkdir",        FTPc_mkdir       },
   { "open",         FTPc_open        },
   { "pass",         FTPc_pass        },
   { "put",          FTPc_put         },
   { "pwd",          FTPc_pwd         },
   { "remotehelp",   FTPc_remotehelp  },
   { "rename",       FTPc_rename      },
   { "rmdir",        FTPc_rmdir       },
   { "user",         FTPc_user        },
   { NULL,   NULL }
};

If you want to use it as shell command, you should add this line to the Shell_commands array:

 

    { "ftp",       Shell_FTP_client },    // located in sh_ftpc.c

But I'm suggesting to upgrade to later MQX versions, because of bugfixed code and working RTCS shell example...

 

PetrM

 

View solution in original post

0 Kudos
1 Reply
410 Views
PetrM
Senior Contributor I

Hello,

 

you should be able to define following FTP client commands in your application and call the FTP_client("192.168.1.1") function (located in ftpc.c):


const FTPc_COMMAND_STRUCT FTPc_commands[] = {
   { "ascii",        FTPc_ascii       },
   { "binary",       FTPc_binary      },
   { "bye",          FTPc_bye         },
   { "cd",           FTPc_cd          },
   { "close",        FTPc_close       },
   { "delete",       FTPc_delete      },
   { "get",          FTPc_get         },
   { "help",         FTPc_help        },
   { "ls",           FTPc_ls          },
   { "mkdir",        FTPc_mkdir       },
   { "open",         FTPc_open        },
   { "pass",         FTPc_pass        },
   { "put",          FTPc_put         },
   { "pwd",          FTPc_pwd         },
   { "remotehelp",   FTPc_remotehelp  },
   { "rename",       FTPc_rename      },
   { "rmdir",        FTPc_rmdir       },
   { "user",         FTPc_user        },
   { NULL,   NULL }
};

If you want to use it as shell command, you should add this line to the Shell_commands array:

 

    { "ftp",       Shell_FTP_client },    // located in sh_ftpc.c

But I'm suggesting to upgrade to later MQX versions, because of bugfixed code and working RTCS shell example...

 

PetrM

 

0 Kudos