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

Problem receiving file from FTP Server in RAW

Hello,

I am working on getting data from a file from a FTP Server using the FTP Client provided with the MDK5.
Everything works fine as long as the file goes to a file system, in my case a SD Card. Now I would like to get rid of the SD Card and receive the raw data directly in a buffer, for that the only option I found is modifying the file provided by the library module FTP_Client_FS.c. Seems to work fine but my concern is that editing a library file may have some issues in future and therefore I would like to find a more suitable way. I found this in the documentation "The function interfaces to the File System Component and will be called by the Network Component automatically. If another file system will be used, refer to the reference implementation in the FTP_Client_FS.c module" but I have no clue on how to implement this module as a part of my source code. Any suggestions?

Thanks!

  • Seems like a simple abstraction layer, designed specifically to contain your implementation specific solution.

    Wouldn't you simply allocate yourself a memory buffer at open, and copy in/out data based on the read/write requests? Keep track of a virtual "file offset pointer", and advance as required, throw an error, or truncate a transfer, if your buffer size is exceeded.

    www.keil.com/.../_f_t_p___client___f_s_8c.html

  • Hello Pier,

    Thanks for your advice. Exactly, what I would like to do is an abstraction layer to allocate myself to handle all the data received.
    My problem though is I have not found the way to do it. When I add the FTP client to my project automatically FTP_Client_FS.c is added too, and implements all the methods that I would like to take care of. If I try to implement them by myself the compiler throws an error since those methods are duplicated. One solution could be editing the FTP_Client_FS.c but as I mentioned before, I would not want to modify any read-only file from the library. Then, my question would be, is there any way to avoid the compiler to call those methods and instead use the ones I implement in my own file?

    Thanks,