19#include <zephyr/kernel.h>
20#include <zephyr/types.h>
224#define FTP_PRELIMINARY_POS(code) (code > 100 && code < 200)
225#define FTP_COMPLETION_POS(code) (code > 200 && code < 300)
226#define FTP_INTERMEDIATE_POS(code) (code > 300 && code < 400)
227#define FTP_TRANSIENT_NEG(code) (code > 400 && code < 500)
228#define FTP_COMPLETION_NEG(code) (code > 500 && code < 600)
229#define FTP_PROTECTED(code) (code > 600 && code < 700)
230#define FTP_PROPRIETARY(code) (code > 900 && code < 1000)
231#define FTP_WINSOCK_ERR(code) (code > 10000)
277int ftp_open(
const char *hostname, uint16_t port,
int sec_tag);
286int ftp_login(
const char *username,
const char *password);
322int ftp_list(
const char *options,
const char *target);
383int ftp_put(
const char *file,
const uint8_t *data, uint16_t length,
int type);
ftp_reply_code
List of FTP server reply codes Reference RFC959 FTP Transfer Protocol.
Definition ftp_client.h:30
@ FTP_CODE_532
Definition ftp_client.h:156
@ FTP_CODE_332
Definition ftp_client.h:108
@ FTP_CODE_211
Definition ftp_client.h:55
@ FTP_CODE_909
Definition ftp_client.h:198
@ FTP_CODE_150
Definition ftp_client.h:46
@ FTP_CODE_910
Definition ftp_client.h:202
@ FTP_CODE_552
Definition ftp_client.h:168
@ FTP_CODE_331
Definition ftp_client.h:106
@ FTP_CODE_120
Definition ftp_client.h:42
@ FTP_CODE_226
Definition ftp_client.h:78
@ FTP_CODE_214
Definition ftp_client.h:64
@ FTP_CODE_900
Definition ftp_client.h:184
@ FTP_CODE_632
Definition ftp_client.h:177
@ FTP_CODE_550
Definition ftp_client.h:162
@ FTP_CODE_227
Definition ftp_client.h:80
@ FTP_CODE_220
Definition ftp_client.h:70
@ FTP_CODE_426
Definition ftp_client.h:124
@ FTP_CODE_10060
Definition ftp_client.h:213
@ FTP_CODE_503
Definition ftp_client.h:150
@ FTP_CODE_233
Definition ftp_client.h:90
@ FTP_CODE_110
Definition ftp_client.h:40
@ FTP_CODE_452
Definition ftp_client.h:136
@ FTP_CODE_633
Definition ftp_client.h:179
@ FTP_CODE_212
Definition ftp_client.h:57
@ FTP_CODE_430
Definition ftp_client.h:126
@ FTP_CODE_631
Definition ftp_client.h:175
@ FTP_CODE_504
Definition ftp_client.h:152
@ FTP_CODE_200
Definition ftp_client.h:51
@ FTP_CODE_350
Definition ftp_client.h:110
@ FTP_CODE_500
Definition ftp_client.h:144
@ FTP_CODE_229
Definition ftp_client.h:84
@ FTP_CODE_904
Definition ftp_client.h:194
@ FTP_CODE_10066
Definition ftp_client.h:219
@ FTP_CODE_902
Definition ftp_client.h:190
@ FTP_CODE_425
Definition ftp_client.h:122
@ FTP_CODE_551
Definition ftp_client.h:164
@ FTP_CODE_501
Definition ftp_client.h:146
@ FTP_CODE_502
Definition ftp_client.h:148
@ FTP_CODE_250
Definition ftp_client.h:97
@ FTP_CODE_553
Definition ftp_client.h:170
@ FTP_CODE_10054
Definition ftp_client.h:211
@ FTP_CODE_421
Definition ftp_client.h:120
@ FTP_CODE_225
Definition ftp_client.h:74
@ FTP_CODE_451
Definition ftp_client.h:132
@ FTP_CODE_231
Definition ftp_client.h:88
@ FTP_CODE_905
Definition ftp_client.h:196
@ FTP_CODE_221
Definition ftp_client.h:72
@ FTP_CODE_228
Definition ftp_client.h:82
@ FTP_CODE_202
Definition ftp_client.h:53
@ FTP_CODE_901
Definition ftp_client.h:188
@ FTP_CODE_10061
Definition ftp_client.h:217
@ FTP_CODE_213
Definition ftp_client.h:59
@ FTP_CODE_534
Definition ftp_client.h:158
@ FTP_CODE_903
Definition ftp_client.h:192
@ FTP_CODE_215
Definition ftp_client.h:68
@ FTP_CODE_257
Definition ftp_client.h:99
@ FTP_CODE_434
Definition ftp_client.h:128
@ FTP_CODE_230
Definition ftp_client.h:86
@ FTP_CODE_530
Definition ftp_client.h:154
@ FTP_CODE_10068
Definition ftp_client.h:221
@ FTP_CODE_234
Definition ftp_client.h:95
@ FTP_CODE_450
Definition ftp_client.h:130
@ FTP_CODE_125
Definition ftp_client.h:44
int ftp_status(void)
Get FTP server and connection status Also returns server system type.
ftp_trasfer_type
Definition ftp_client.h:233
@ FTP_TYPE_BINARY
Definition ftp_client.h:235
@ FTP_TYPE_ASCII
Definition ftp_client.h:234
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.
int ftp_close(void)
Close FTP connection.
void(* ftp_client_callback_t)(const uint8_t *msg, uint16_t len)
FTP asynchronous callback function.
Definition ftp_client.h:250
int ftp_rmd(const char *folder)
Remove directory.
int ftp_list(const char *options, const char *target)
List information of folder or file.
int ftp_mkd(const char *folder)
Make directory.
int ftp_rename(const char *old_name, const char *new_name)
Rename a file.
int ftp_pwd(void)
Print working directory.
int ftp_login(const char *username, const char *password)
FTP server login.
int ftp_get(const char *file)
Get a file.
int ftp_delete(const char *file)
Delete a file.
int ftp_type(enum ftp_trasfer_type type)
Set FTP transfer type.
int ftp_init(ftp_client_callback_t ctrl_callback, ftp_client_callback_t data_callback)
Initialize the FTP client library.
int ftp_cwd(const char *folder)
Change working directory.
int ftp_uninit(void)
Uninitialize the FTP client library.
ftp_put_type
Definition ftp_client.h:238
@ FTP_PUT_NORMAL
Definition ftp_client.h:239
@ FTP_PUT_APPEND
Definition ftp_client.h:241
@ FTP_PUT_UNIQUE
Definition ftp_client.h:240
int ftp_open(const char *hostname, uint16_t port, int sec_tag)
Open FTP connection.