File transfer protocol (FTP) library. More...
Modules | |
Types | |
Data types used by FTP library. | |
Functions | |
zos_result_t | ftp_async_upload (ftp_context_t **context_ptr, const ftp_upload_config_t *config) |
Beging asynchronous FTP file upload. More... | |
zos_result_t | ftp_async_upload_write (ftp_context_t *context, const void *data, uint16_t length) |
Write FTP data to upload to remote server. More... | |
void | ftp_async_upload_cleanup (ftp_context_t *context) |
Cleanup upload context allocated by ftp_async_upload() More... | |
const char * | ftp_get_state_str (ftp_state_t state) |
Return FTP state as string. More... | |
Detailed Description
File transfer protocol (FTP) library.
Function Documentation
zos_result_t ftp_async_upload | ( | ftp_context_t ** | context_ptr, |
const ftp_upload_config_t * | config |
||
) |
Beging asynchronous FTP file upload.
This begins a FTP file upload. The actual data upload begins when the ftp_state_t is FTP_STATE_DATA . In this state, ftp_async_upload_write() should be called as many times as needed to upload data to remote file on FTP server.
Once all data is written, call ftp_async_upload_write() one more times with a NULL buffer to complete the upload.
- Note
- ftp_async_upload_cleanup() should be called once upload is complete
- To view library debug messages, define FTP_DEBUG_ENABLED as a global variable.
- Parameters
-
context_ptr
Pointer to hold allocated ftp_context_t config
Configuration of upload, see ftp_upload_config_t
- Returns
- Result of call, see zos_result_t
void ftp_async_upload_cleanup | ( | ftp_context_t * | context | ) |
Cleanup upload context allocated by ftp_async_upload()
- Parameters
-
context
Upload context allocated by ftp_async_upload()
zos_result_t ftp_async_upload_write | ( | ftp_context_t * | context, |
const void * | data, |
||
uint16_t | length |
||
) |
Write FTP data to upload to remote server.
See ftp_async_upload() for more information.
- Parameters
-
context
Upload context allocated by ftp_async_upload() data
Data to write to remote FTP file, set as NULL to complete upload length
Length of data in bytes
- Returns
- Result of call, see zos_result_t
const char* ftp_get_state_str | ( | ftp_state_t | state | ) |