Update FTPClient
Dependents: Digital_Photo_Frame_with_FTP_SD_WIZwiki-W7500 FTP_Streaming_Music_Player_WIZwiki-W7500 GIF2015 MP3Decoding_VS1002_WIZwiki-W7500
Fork of FTPClient by
Diff: FTPClient.h
- Revision:
- 4:4bef734cc93e
- Parent:
- 3:4fd8e5cd6307
--- a/FTPClient.h Wed Jul 29 00:03:21 2015 +0000 +++ b/FTPClient.h Sat Aug 15 08:43:02 2015 +0000 @@ -2,7 +2,7 @@ #define FTP_CLIENT_H #include "mbed.h" #include "SDFileSystem.h" -#define MAX_SS 256 +#define MAX_SS 512 /** FTPClient class. * Used file transfer with FTPServer like ALFTP(http://software.altools.co.kr/ko-kr/closed.html) * This test was completed in ALFTP @@ -11,7 +11,8 @@ public: /** Create FTPClient instance */ FTPClient(PinName mosi, PinName miso, PinName sclk, PinName ssel, const char* root); - ~FTPClient() {}; + FTPClient(const char* root); + ~FTPClient(); /** Connect to FTPServer * @@ -24,21 +25,21 @@ /** Get file from FTPServer * - * @param My file name, FTPServer file name + * @param filename * @returns * 1 on success, * 0 on getfile error */ - bool getfile(char* myfilename, char* filename); + bool getfile(char* filename); /** Put file to FTPServer * - * @param My file name, FTPServer file name + * @param FTPServer file name * @returns * 1 on success, * 0 on putfile error */ - bool putfile(char* myfilename, char* filename); + bool putfile(char* filename); /** View FTPServer directory * @@ -47,7 +48,7 @@ * 1 on success, * 0 on dir error */ - bool dir(); + bool dir(char* liststr); /** View FTPServer directory * @@ -56,7 +57,7 @@ * 1 on success, * 0 on ls error */ - bool ls(); + bool ls(char* liststr); /** Delete FTPServer file * @@ -95,35 +96,21 @@ bool quit(); private: - TCPSocketConnection* FTPClientControlSock; - TCPSocketConnection* FTPClientDataSock; + TCPSocketConnection FTPClientControlSock; + TCPSocketConnection FTPClientDataSock; bool blogin; - bool bopenflag; - bool brfileflag; - bool bsfileflag; - bool bdirflag; - bool blsflag; - bool bfdeleteflag; - bool bmkdirflag; - bool bcdflag; - bool bquitflag; - char ftpServer_data_ip_addr[4]; char ftpServer_data_ip_addr_str[20]; int remote_port; - char rbuf[256]; - char sbuf[256]; + char ftpbuf[MAX_SS]; + - int remain_datasize; - int i; - int remain_filesize; - int send_byte; - int size; - FILE *fp; - SDFileSystem _SDFileSystem; + SDFileSystem* _SDFileSystem; int pportc(char * arg); + + char root[20]; }; #endif \ No newline at end of file