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

◆ fota_download_start()

int fota_download_start ( const char *  host,
const char *  file,
int  sec_tag,
uint8_t  pdn_id,
size_t  fragment_size 
)

#include <include/net/fota_download.h>

Start downloading the given file of any image type from the given host.

When the download is complete, the secondary slot of MCUboot is tagged as having valid firmware inside it. The completion is reported through an event.

URI parameters (host and file) are not copied, so pointers must stay valid until download is finished.

Parameters
hostName of host to start downloading from. Can include scheme and port number, e.g. https://google.com:443
filePath to the file you wish to download. See fota_download_any() for details on expected format.
sec_tagSecurity tag you want to use with HTTPS. Pass -1 to disable TLS.
pdn_idPacket Data Network ID to use for the download, or 0 to use the default.
fragment_sizeFragment size to be used for the download. If 0,
embed:rst:inline :kconfig:option:`CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZE` 
is used.
Return values
0If download has started successfully.
-EALREADYIf download is already ongoing. Otherwise, a negative value is returned.