nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches

◆ download_client_start()

int download_client_start ( struct download_client client,
const char *  file,
size_t  from 
)

#include <include/net/download_client.h>

Download a file.

The download is carried out in fragments of up to

embed:rst:inline :kconfig:option:`CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZE` 

bytes for HTTP, or

embed:rst:inline :kconfig:option:`CONFIG_DOWNLOAD_CLIENT_COAP_BLOCK_SIZE` 

bytes for CoAP, which are delivered to the application via DOWNLOAD_CLIENT_EVT_FRAGMENT events.

Parameters
[in]clientClient instance.
[in]fileFile to download, null-terminated.
[in]fromOffset from where to resume the download, or zero to download from the beginning.
Return values
intZero on success, a negative error code otherwise.