|
Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
|
Data Structures | |
| struct | ftp_client |
| FTP client context. More... | |
Typedefs | |
| typedef void(* | ftp_client_callback_t) (const uint8_t *msg, uint16_t len) |
| FTP asynchronous callback function. | |
Functions | |
| int | ftp_init (struct ftp_client *client, ftp_client_callback_t ctrl_callback, ftp_client_callback_t data_callback) |
| Initialize the FTP client context. | |
| int | ftp_uninit (struct ftp_client *client) |
| Uninitialize the FTP client context. | |
| int | ftp_open (struct ftp_client *client, const char *hostname, uint16_t port, int sec_tag) |
| Open FTP connection. | |
| int | ftp_login (struct ftp_client *client, const char *username, const char *password) |
| FTP server login. | |
| int | ftp_close (struct ftp_client *client) |
| Close FTP connection. | |
| int | ftp_status (struct ftp_client *client) |
| Get FTP server and connection status Also returns server system type. | |
| int | ftp_type (struct ftp_client *client, enum ftp_transfer_type type) |
| Set FTP transfer type. | |
| int | ftp_pwd (struct ftp_client *client) |
| Print working directory. | |
| int | ftp_list (struct ftp_client *client, const char *options, const char *target) |
| List information of folder or file. | |
| int | ftp_cwd (struct ftp_client *client, const char *folder) |
| Change working directory. | |
| int | ftp_mkd (struct ftp_client *client, const char *folder) |
| Make directory. | |
| int | ftp_rmd (struct ftp_client *client, const char *folder) |
| Remove directory. | |
| int | ftp_rename (struct ftp_client *client, const char *old_name, const char *new_name) |
| Rename a file. | |
| int | ftp_delete (struct ftp_client *client, const char *file) |
| Delete a file. | |
| int | ftp_get (struct ftp_client *client, const char *file) |
| Get a file. | |
| int | ftp_put (struct ftp_client *client, 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_keepalive (struct ftp_client *client) |
| Exchange keep-alive commands with the server. | |
#include <zephyr/net/ftp_client.h>
FTP asynchronous callback function.
| msg | FTP client data received, or local message |
| len | length of message |
| enum ftp_put_type |
#include <zephyr/net/ftp_client.h>
FTP file write mode.
| Enumerator | |
|---|---|
| FTP_PUT_NORMAL | Overwrite a file. |
| FTP_PUT_UNIQUE | Write to a file with a unique file name. |
| FTP_PUT_APPEND | Append a file. |
| enum ftp_reply_code |
#include <zephyr/net/ftp_client.h>
List of FTP server reply codes Reference RFC959 FTP Transfer Protocol.
| enum ftp_transfer_type |
#include <zephyr/net/ftp_client.h>
FTP transfer mode.
| Enumerator | |
|---|---|
| FTP_TYPE_ASCII | ASCII transfer. |
| FTP_TYPE_BINARY | Binary transfer. |
| int ftp_close | ( | struct ftp_client * | client | ) |
#include <zephyr/net/ftp_client.h>
Close FTP connection.
| int ftp_cwd | ( | struct ftp_client * | client, |
| const char * | folder ) |
#include <zephyr/net/ftp_client.h>
Change working directory.
| client | FTP client context |
| folder | Target folder |
| int ftp_delete | ( | struct ftp_client * | client, |
| const char * | file ) |
#include <zephyr/net/ftp_client.h>
Delete a file.
| client | FTP client context |
| file | Target file name |
| int ftp_get | ( | struct ftp_client * | client, |
| const char * | file ) |
#include <zephyr/net/ftp_client.h>
Get a file.
| client | FTP client context |
| file | Target file name |
| int ftp_init | ( | struct ftp_client * | client, |
| ftp_client_callback_t | ctrl_callback, | ||
| ftp_client_callback_t | data_callback ) |
#include <zephyr/net/ftp_client.h>
Initialize the FTP client context.
| client | FTP client context |
| ctrl_callback | Callback for FTP command result. |
| data_callback | Callback for FTP received data. |
| int ftp_keepalive | ( | struct ftp_client * | client | ) |
#include <zephyr/net/ftp_client.h>
Exchange keep-alive commands with the server.
| client | FTP client context |
| int ftp_list | ( | struct ftp_client * | client, |
| const char * | options, | ||
| const char * | target ) |
#include <zephyr/net/ftp_client.h>
List information of folder or file.
| client | FTP client context |
| options | List options, refer to Linux "man ls" |
| target | file or directory to list. If not specified, list current folder |
| int ftp_login | ( | struct ftp_client * | client, |
| const char * | username, | ||
| const char * | password ) |
#include <zephyr/net/ftp_client.h>
FTP server login.
| client | FTP client context |
| username | user name |
| password | The password |
| int ftp_mkd | ( | struct ftp_client * | client, |
| const char * | folder ) |
#include <zephyr/net/ftp_client.h>
Make directory.
| client | FTP client context |
| folder | New folder name |
| int ftp_open | ( | struct ftp_client * | client, |
| const char * | hostname, | ||
| uint16_t | port, | ||
| int | sec_tag ) |
#include <zephyr/net/ftp_client.h>
Open FTP connection.
| client | FTP client context |
| hostname | FTP server name or IP address |
| port | FTP service port on server |
| sec_tag | If FTP over TLS is required (-1 means no TLS) |
| int ftp_put | ( | struct ftp_client * | client, |
| const char * | file, | ||
| const uint8_t * | data, | ||
| uint16_t | length, | ||
| int | type ) |
#include <zephyr/net/ftp_client.h>
Put data to a file If file does not exist, create the file.
| client | FTP client context |
| file | Target file name |
| data | Data to be stored |
| length | Length of data to be stored |
| type | specify FTP put types, see enum ftp_reply_code |
| int ftp_pwd | ( | struct ftp_client * | client | ) |
#include <zephyr/net/ftp_client.h>
Print working directory.
| client | FTP client context |
| int ftp_rename | ( | struct ftp_client * | client, |
| const char * | old_name, | ||
| const char * | new_name ) |
#include <zephyr/net/ftp_client.h>
Rename a file.
| client | FTP client context |
| old_name | Old file name |
| new_name | New file name |
| int ftp_rmd | ( | struct ftp_client * | client, |
| const char * | folder ) |
#include <zephyr/net/ftp_client.h>
Remove directory.
| client | FTP client context |
| folder | Target folder name |
| int ftp_status | ( | struct ftp_client * | client | ) |
#include <zephyr/net/ftp_client.h>
Get FTP server and connection status Also returns server system type.
| client | FTP client context |
| int ftp_type | ( | struct ftp_client * | client, |
| enum ftp_transfer_type | type ) |
#include <zephyr/net/ftp_client.h>
Set FTP transfer type.
| client | FTP client context |
| type | transfer type |
| int ftp_uninit | ( | struct ftp_client * | client | ) |
#include <zephyr/net/ftp_client.h>
Uninitialize the FTP client context.
| client | FTP client context |