nRF Connect SDK API 0.1.0
|
int fota_download | ( | const char * | host, |
const char * | file, | ||
const int * | sec_tag_list, | ||
uint8_t | sec_tag_count, | ||
uint8_t | pdn_id, | ||
size_t | fragment_size, | ||
const enum dfu_target_image_type | expected_type | ||
) |
#include <include/net/fota_download.h>
Download the given file with the specified image type from the given host.
Validate that the file type matches the expected type before proceeding with the download. 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.
host | Name of host to start downloading from. Can include scheme and port number, for example https://google.com:443 |
file | Path to the file you wish to download. See fota_download_any() for details on expected format. |
sec_tag_list | Security tags that you want to use with HTTPS. Pass NULL to disable TLS. |
sec_tag_count | Number of TLS security tags in list. Pass 0 to disable TLS. |
pdn_id | Packet Data Network ID to use for the download, or 0 to use the default. |
fragment_size | Fragment size to be used for the download. If 0, embed:rst:inline :kconfig:option:`CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZE`is used. |
expected_type | Type of firmware file to be downloaded and installed. |
0 | If download has started successfully. |
-EALREADY | If download is already ongoing. |
-E2BIG | If sec_tag_count is larger than embed:rst:inline :kconfig:option:`CONFIG_FOTA_DOWNLOAD_SEC_TAG_LIST_SIZE_MAX`Otherwise, a negative value is returned. |