Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of FTPClient by
Revision 3:4fd8e5cd6307, committed 2015-07-29
- Comitter:
- Ricky_Kwon
- Date:
- Wed Jul 29 00:03:21 2015 +0000
- Parent:
- 2:dbbe55b239d5
- Child:
- 4:8ecc32e7c69b
- Commit message:
- optimization
Changed in this revision
| FTPClient.cpp | Show annotated file Show diff for this revision Revisions of this file |
| FTPClient.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/FTPClient.cpp Tue Jul 28 23:33:09 2015 +0000
+++ b/FTPClient.cpp Wed Jul 29 00:03:21 2015 +0000
@@ -399,6 +399,9 @@
bquitflag = false;
blogin = false;
+ delete FTPClientControlSock;
+ delete FTPClientDataSock;
+
return 1;
}
else return 0;
@@ -439,4 +442,3 @@
-
--- a/FTPClient.h Tue Jul 28 23:33:09 2015 +0000
+++ b/FTPClient.h Wed Jul 29 00:03:21 2015 +0000
@@ -3,24 +3,97 @@
#include "mbed.h"
#include "SDFileSystem.h"
#define MAX_SS 256
+/** FTPClient class.
+ * Used file transfer with FTPServer like ALFTP(http://software.altools.co.kr/ko-kr/closed.html)
+ * This test was completed in ALFTP
+ */
class FTPClient{
public:
+ /** Create FTPClient instance */
FTPClient(PinName mosi, PinName miso, PinName sclk, PinName ssel, const char* root);
~FTPClient() {};
+ /** Connect to FTPServer
+ *
+ * @param FTPServer IP, FTPServer PORT, FTPServer login ID, FTPServer login PASS
+ * @returns
+ * 1 on success,
+ * 0 on open error
+ */
bool open(char* ip, int port, char* id, char* pass);
+
+ /** Get file from FTPServer
+ *
+ * @param My file name, FTPServer file name
+ * @returns
+ * 1 on success,
+ * 0 on getfile error
+ */
bool getfile(char* myfilename, char* filename);
+
+ /** Put file to FTPServer
+ *
+ * @param My file name, FTPServer file name
+ * @returns
+ * 1 on success,
+ * 0 on putfile error
+ */
bool putfile(char* myfilename, char* filename);
+
+ /** View FTPServer directory
+ *
+ * @param
+ * @returns
+ * 1 on success,
+ * 0 on dir error
+ */
bool dir();
+
+ /** View FTPServer directory
+ *
+ * @param
+ * @returns
+ * 1 on success,
+ * 0 on ls error
+ */
bool ls();
+
+ /** Delete FTPServer file
+ *
+ * @param FTPServer file name
+ * @returns
+ * 1 on success,
+ * 0 on delete error
+ */
bool fdelete(char* filename);
+
+ /** Make FTPServer directory
+ *
+ * @param FTPServer directory name
+ * @returns
+ * 1 on success,
+ * 0 on mkdir error
+ */
bool mkdir(char* dirname);
+
+ /** Change current FTPServer directory
+ *
+ * @param FTPServer directory name
+ * @returns
+ * 1 on success,
+ * 0 on mkdir error
+ */
bool cd(char* dirname);
+
+ /** Disconnect from FTPServer
+ *
+ * @param
+ * @returns
+ * 1 on success,
+ * 0 on Disconnect error
+ */
bool quit();
- int pportc(char * arg);
-
-
-
+
private:
TCPSocketConnection* FTPClientControlSock;
TCPSocketConnection* FTPClientDataSock;
@@ -50,5 +123,7 @@
int size;
FILE *fp;
SDFileSystem _SDFileSystem;
+
+ int pportc(char * arg);
};
#endif
\ No newline at end of file
