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

◆ downloader_get_with_host_and_file()

int downloader_get_with_host_and_file ( struct downloader * dl,
const struct downloader_host_cfg * host_cfg,
const char * host,
const char * file,
size_t from )

#include <include/net/downloader.h>

Download a file asynchronously with host and file as separate parameters.

This initiates an asynchronous connect-download-disconnect sequence to the target host.

Downloads are handled one at a time. If previous download is not finished, this returns -EALREADY.

Parameters
[in]dlDownloader instance.
[in]host_cfgHost configuration options.
[in]hostURL of the host to connect to. Can include scheme and port number, defaults to HTTP or HTTPS if no scheme is provided.
[in]fileFile to download
[in]fromOffset from where to resume the download, or zero to download from the beginning.
Returns
Zero on success, a negative error code otherwise.