nRF Connect SDK API 2.8.99
|
int fota_download_any | ( | const char * | host, |
const char * | file, | ||
const int * | sec_tag_list, | ||
uint8_t | sec_tag_count, | ||
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.
host | Name of host to start downloading from. Can include scheme and port number, e.g. https://google.com:443 |
file | Path to the file you wish to download. May be either a single file path, relative to host (for example "path/to/binary.bin"), or, if bootloader FOTA is enabled, can be two paths (both relative to host), separated by a space (for example "path/to/s0.bin path/to/s1.bin"). If two paths are provided, the download will be assumed to be a bootloader download, both paths will be treated as upgradable bootloader slot 0 and slot 1 binaries respectively, and only the binary corresponding to the currently inactive bootloader slot will be selected and downloaded. See Secure Bootloader Chain Docs for details regarding the upgradable bootloader slots. |
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, CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZEis used. |
0 | If download has started successfully. |
-EALREADY | If download is already ongoing. |
-E2BIG | If sec_tag_count is larger than CONFIG_FOTA_DOWNLOAD_SEC_TAG_LIST_SIZE_MAXOtherwise, a negative value is returned. |