nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
FTP client library

Library for FTP client. More...

Macros

#define FTP_PRELIMINARY_POS(code)   (code > 100 && code < 200)
 
#define FTP_COMPLETION_POS(code)   (code > 200 && code < 300)
 
#define FTP_INTERMEDIATE_POS(code)   (code > 300 && code < 400)
 
#define FTP_TRANSIENT_NEG(code)   (code > 400 && code < 500)
 
#define FTP_COMPLETION_NEG(code)   (code > 500 && code < 600)
 
#define FTP_PROTECTED(code)   (code > 600 && code < 700)
 
#define FTP_PROPRIETARY(code)   (code > 900 && code < 1000)
 
#define FTP_WINSOCK_ERR(code)   (code > 10000)
 

Typedefs

typedef void(* ftp_client_callback_t) (const uint8_t *msg, uint16_t len)
 FTP asynchronous callback function.
 

Enumerations

enum  ftp_reply_code {
  FTP_CODE_110 = 110 , FTP_CODE_120 = 120 , FTP_CODE_125 = 125 , FTP_CODE_150 = 150 ,
  FTP_CODE_200 = 200 , FTP_CODE_202 = 202 , FTP_CODE_211 = 211 , FTP_CODE_212 = 212 ,
  FTP_CODE_213 = 213 , FTP_CODE_214 = 214 , FTP_CODE_215 = 215 , FTP_CODE_220 = 220 ,
  FTP_CODE_221 = 221 , FTP_CODE_225 = 225 , FTP_CODE_226 = 226 , FTP_CODE_227 = 227 ,
  FTP_CODE_228 = 228 , FTP_CODE_229 = 229 , FTP_CODE_230 = 230 , FTP_CODE_231 = 231 ,
  FTP_CODE_233 = 233 , FTP_CODE_234 = 234 , FTP_CODE_250 = 250 , FTP_CODE_257 = 257 ,
  FTP_CODE_331 = 331 , FTP_CODE_332 = 332 , FTP_CODE_350 = 350 , FTP_CODE_421 = 421 ,
  FTP_CODE_425 = 425 , FTP_CODE_426 = 426 , FTP_CODE_430 = 430 , FTP_CODE_434 = 434 ,
  FTP_CODE_450 = 450 , FTP_CODE_451 = 451 , FTP_CODE_452 = 452 , FTP_CODE_500 = 500 ,
  FTP_CODE_501 = 501 , FTP_CODE_502 = 502 , FTP_CODE_503 = 503 , FTP_CODE_504 = 504 ,
  FTP_CODE_530 = 530 , FTP_CODE_532 = 532 , FTP_CODE_534 = 534 , FTP_CODE_550 = 550 ,
  FTP_CODE_551 = 551 , FTP_CODE_552 = 552 , FTP_CODE_553 = 553 , FTP_CODE_631 = 631 ,
  FTP_CODE_632 = 632 , FTP_CODE_633 = 633 , FTP_CODE_900 = 900 , FTP_CODE_901 = 901 ,
  FTP_CODE_902 = 902 , FTP_CODE_903 = 903 , FTP_CODE_904 = 904 , FTP_CODE_905 = 905 ,
  FTP_CODE_909 = 909 , FTP_CODE_910 = 910 , FTP_CODE_10054 = 10054 , FTP_CODE_10060 = 10060 ,
  FTP_CODE_10061 = 10061 , FTP_CODE_10066 = 10066 , FTP_CODE_10068 = 10068
}
 List of FTP server reply codes Reference RFC959 FTP Transfer Protocol. More...
 
enum  ftp_trasfer_type { FTP_TYPE_ASCII , FTP_TYPE_BINARY }
 
enum  ftp_put_type { FTP_PUT_NORMAL , FTP_PUT_UNIQUE , FTP_PUT_APPEND }
 

Functions

int ftp_init (ftp_client_callback_t ctrl_callback, ftp_client_callback_t data_callback)
 Initialize the FTP client library.
 
int ftp_uninit (void)
 Uninitialize the FTP client library.
 
int ftp_open (const char *hostname, uint16_t port, int sec_tag)
 Open FTP connection.
 
int ftp_login (const char *username, const char *password)
 FTP server login.
 
int ftp_close (void)
 Close FTP connection.
 
int ftp_status (void)
 Get FTP server and connection status Also returns server system type.
 
int ftp_type (enum ftp_trasfer_type type)
 Set FTP transfer type.
 
int ftp_pwd (void)
 Print working directory.
 
int ftp_list (const char *options, const char *target)
 List information of folder or file.
 
int ftp_cwd (const char *folder)
 Change working directory.
 
int ftp_mkd (const char *folder)
 Make directory.
 
int ftp_rmd (const char *folder)
 Remove directory.
 
int ftp_rename (const char *old_name, const char *new_name)
 Rename a file.
 
int ftp_delete (const char *file)
 Delete a file.
 
int ftp_get (const char *file)
 Get a file.
 
int ftp_put (const char *file, const uint8_t *data, uint16_t length, int type)
 Put data to a file If file does not exist, create the file.
 

Detailed Description

Library for FTP client.

Provide selected FTP client functionality