FTPClient

Fork of FTPClient by Ricky Kwon

Committer:
Ricky_Kwon
Date:
Tue Jul 28 00:04:52 2015 +0000
Revision:
0:61da21bfd120
Child:
1:2630b5456598
FTPClient

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Ricky_Kwon 0:61da21bfd120 1 #ifndef FTP_CLIENT_H
Ricky_Kwon 0:61da21bfd120 2 #define FTP_CLIENT_H
Ricky_Kwon 0:61da21bfd120 3 #include "mbed.h"
Ricky_Kwon 0:61da21bfd120 4 #include "SDFileSystem.h"
Ricky_Kwon 0:61da21bfd120 5 #define MAX_SS 256
Ricky_Kwon 0:61da21bfd120 6 class FTPClient{
Ricky_Kwon 0:61da21bfd120 7 public:
Ricky_Kwon 0:61da21bfd120 8 FTPClient(PinName mosi, PinName miso, PinName sclk, PinName ssel, const char* root);
Ricky_Kwon 0:61da21bfd120 9 ~FTPClient() {};
Ricky_Kwon 0:61da21bfd120 10
Ricky_Kwon 0:61da21bfd120 11 bool open(char* ip, int port, char* id, char* pass);
Ricky_Kwon 0:61da21bfd120 12 bool getfile(char* myfilename, char* filename);
Ricky_Kwon 0:61da21bfd120 13 bool putfile(char* myfilename, char* filename);
Ricky_Kwon 0:61da21bfd120 14 bool dir();
Ricky_Kwon 0:61da21bfd120 15 bool ls();
Ricky_Kwon 0:61da21bfd120 16 bool fdelete(char* filename);
Ricky_Kwon 0:61da21bfd120 17 bool mkdir(char* dirname);
Ricky_Kwon 0:61da21bfd120 18 bool cd(char* dirname);
Ricky_Kwon 0:61da21bfd120 19 int pportc(char * arg);
Ricky_Kwon 0:61da21bfd120 20
Ricky_Kwon 0:61da21bfd120 21 TCPSocketConnection* FTPClientControlSock;
Ricky_Kwon 0:61da21bfd120 22 TCPSocketConnection* FTPClientDataSock;
Ricky_Kwon 0:61da21bfd120 23
Ricky_Kwon 0:61da21bfd120 24 bool blogin;
Ricky_Kwon 0:61da21bfd120 25 bool bopenflag;
Ricky_Kwon 0:61da21bfd120 26 bool brfileflag;
Ricky_Kwon 0:61da21bfd120 27 bool bsfileflag;
Ricky_Kwon 0:61da21bfd120 28 bool bdirflag;
Ricky_Kwon 0:61da21bfd120 29 bool blsflag;
Ricky_Kwon 0:61da21bfd120 30 bool bfdeleteflag;
Ricky_Kwon 0:61da21bfd120 31 bool bmkdirflag;
Ricky_Kwon 0:61da21bfd120 32 bool bcdflag;
Ricky_Kwon 0:61da21bfd120 33
Ricky_Kwon 0:61da21bfd120 34 char ftpServer_data_ip_addr[4];
Ricky_Kwon 0:61da21bfd120 35 char ftpServer_data_ip_addr_str[20];
Ricky_Kwon 0:61da21bfd120 36 int remote_port;
Ricky_Kwon 0:61da21bfd120 37
Ricky_Kwon 0:61da21bfd120 38 char rbuf[256];
Ricky_Kwon 0:61da21bfd120 39 char sbuf[256];
Ricky_Kwon 0:61da21bfd120 40
Ricky_Kwon 0:61da21bfd120 41 int remain_datasize;
Ricky_Kwon 0:61da21bfd120 42 int i;
Ricky_Kwon 0:61da21bfd120 43 int remain_filesize;
Ricky_Kwon 0:61da21bfd120 44 int send_byte;
Ricky_Kwon 0:61da21bfd120 45 int size;
Ricky_Kwon 0:61da21bfd120 46
Ricky_Kwon 0:61da21bfd120 47 private:
Ricky_Kwon 0:61da21bfd120 48 FILE *fp;
Ricky_Kwon 0:61da21bfd120 49 SDFileSystem _SDFileSystem;
Ricky_Kwon 0:61da21bfd120 50 };
Ricky_Kwon 0:61da21bfd120 51 #endif