FTPClient

Dependencies:   FTPClient SDFileSystem WIZnetInterface_Ricky mbed

Files at this revision

API Documentation at this revision

Comitter:
Ricky_Kwon
Date:
Thu Jul 30 00:28:06 2015 +0000
Commit message:
FTPClient example

Changed in this revision

FTPClient.lib Show annotated file Show diff for this revision Revisions of this file
SDFileSystem.lib Show annotated file Show diff for this revision Revisions of this file
WIZnetInterface.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 7655e62e5624 FTPClient.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/FTPClient.lib	Thu Jul 30 00:28:06 2015 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/Ricky_Kwon/code/FTPClient/#4fd8e5cd6307
diff -r 000000000000 -r 7655e62e5624 SDFileSystem.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SDFileSystem.lib	Thu Jul 30 00:28:06 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/mbed_official/code/SDFileSystem/#7b35d1709458
diff -r 000000000000 -r 7655e62e5624 WIZnetInterface.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/WIZnetInterface.lib	Thu Jul 30 00:28:06 2015 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/teams/WIZnet/code/WIZnetInterface_Ricky/#5a1969320666
diff -r 000000000000 -r 7655e62e5624 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Jul 30 00:28:06 2015 +0000
@@ -0,0 +1,61 @@
+#include "mbed.h"
+#include "EthernetInterface.h"
+#include "FTPClient.h"
+
+uint8_t mac_addr[6] = {0x00, 0x08, 0xdc, 0x12, 0x34, 0x45};
+const char ip_addr[] = "192.168.0.123"; 
+const char mask_addr[] = "255.255.255.0"; 
+const char gateway_addr[] = "192.168.0.1"; 
+
+FTPClient ftp(PB_3, PB_2, PB_1, PB_0, "ftp");
+
+int main (void) 
+{
+    int n;
+    EthernetInterface eth;
+    eth.init(mac_addr, ip_addr, mask_addr, gateway_addr); //Use Static
+    eth.connect();
+    
+    n = ftp.open("192.168.0.2", 21, "abc", "123");
+    if(n>1){
+        printf("Connect Success to FTPServer\r\n");
+    }
+    printf("FTPServer dir...\r\n");
+    ftp.dir();
+    printf("FTPServer ls...\r\n");
+    ftp.ls();
+    
+    ftp.getfile("/ftp/1.jpg", "1.jpg");
+    ftp.getfile("/ftp/2.jpg", "2.jpg");
+    ftp.getfile("/ftp/3.jpg", "3.jpg");
+    ftp.getfile("/ftp/4.jpg", "4.jpg");
+    
+    ftp.mkdir("FTP Test");
+    
+    ftp.cd("FTP Test");
+    
+    ftp.putfile("/ftp/1.jpg", "1.jpg");
+    ftp.putfile("/ftp/2.jpg", "2.jpg");
+    ftp.putfile("/ftp/3.jpg", "3.jpg");
+    ftp.putfile("/ftp/4.jpg", "4.jpg");
+    
+    printf("FTPServer dir...\r\n");
+    ftp.dir();
+    printf("FTPServer ls...\r\n");
+    ftp.ls();
+    
+    ftp.cd("/");
+    
+    printf("FTPServer dir...\r\n");
+    ftp.dir();
+    printf("FTPServer ls...\r\n");
+    ftp.ls(); 
+    
+    ftp.quit(); 
+}
+
+
+
+
+
+
diff -r 000000000000 -r 7655e62e5624 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Jul 30 00:28:06 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/bad568076d81
\ No newline at end of file