You can use eDlib APIs to perform FTP. In case, you do not want to use eDlib APIs, you have to code the complete TCP/IP stack on the top of which your FTP protocol will work. Hence, it is better to use eDlib APIs.
The process to perform FTP is as follows:
- Connect to the service provider by calling ed_DialupConnectionStart () API. I assume that you know the steps to perform before calling this API. This will give you the IP address for your module.
- Set FTP parameters (i.e. FTP server name, FTP port, type etc) by calling ed_FTPSetConfig () API.
- If you want to retrieve some file from FTP, use ed_FTPGetFileSetConfig () API to set the file parameters. In case, you want to upload a file to FTP use, ed_FTPPutFileSetConfig () API to set the file parameters (like file name and file path).
- For getting a file from FTP, use ed_FTPGet () API. To upload a file, use ed_FTPPut () API.
- In case of getting a file (downloading), the data will be received in the data handler that you provide in the ed_FTPGet () API. Similarly, while uploading a file, you will automatically get a call to FTP data request function when the connection to the server is made. From here, you can send data to the FTP server. Please note that you have to use ed_SendData () API to send the data to the server. To close the connection when all the data has been sent, use ed_SendData () API to close the connection by setting the third paramter (bEnd) as TRUE.
All the FTP related events will be received in the FTP control handler.
I hope this will clear some of the points that you have in your mind.