nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches
fota_download.h File Reference
#include <zephyr/kernel.h>
#include <zephyr/types.h>
#include <net/download_client.h>
#include <dfu/dfu_target.h>

Go to the source code of this file.

Data Structures

struct  fota_download_evt
 FOTA download event data. More...
 

Typedefs

typedef void(* fota_download_callback_t) (const struct fota_download_evt *evt)
 FOTA download asynchronous callback function.
 

Enumerations

enum  fota_download_evt_id {
  FOTA_DOWNLOAD_EVT_PROGRESS , FOTA_DOWNLOAD_EVT_FINISHED , FOTA_DOWNLOAD_EVT_ERASE_PENDING , FOTA_DOWNLOAD_EVT_ERASE_TIMEOUT ,
  FOTA_DOWNLOAD_EVT_ERASE_DONE , FOTA_DOWNLOAD_EVT_ERROR , FOTA_DOWNLOAD_EVT_CANCELLED , FOTA_DOWNLOAD_EVT_RESUME_OFFSET
}
 FOTA download event IDs. More...
 
enum  fota_download_error_cause {
  FOTA_DOWNLOAD_ERROR_CAUSE_NO_ERROR , FOTA_DOWNLOAD_ERROR_CAUSE_CONNECT_FAILED , FOTA_DOWNLOAD_ERROR_CAUSE_DOWNLOAD_FAILED , FOTA_DOWNLOAD_ERROR_CAUSE_INVALID_UPDATE ,
  FOTA_DOWNLOAD_ERROR_CAUSE_TYPE_MISMATCH , FOTA_DOWNLOAD_ERROR_CAUSE_INTERNAL
}
 FOTA download error cause values. More...
 

Functions

int fota_download_init (fota_download_callback_t client_callback)
 Initialize the firmware over-the-air download library.
 
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)
 Download the given file with the specified image type from the given host.
 
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)
 Start downloading the given file of any image type from the given host.
 
int fota_download_start (const char *host, const char *file, int sec_tag, uint8_t pdn_id, size_t fragment_size)
 Start downloading the given file of any image type from the given host.
 
int fota_download_start_with_image_type (const char *host, const char *file, int sec_tag, uint8_t pdn_id, size_t fragment_size, const enum dfu_target_image_type expected_type)
 Download the given file with the specified image type from the given host.
 
int fota_download_cancel (void)
 Cancel FOTA image downloading.
 
int fota_download_target (void)
 Get target image type.
 
int fota_download_s0_active_get (bool *const s0_active)
 Get the active bootloader (B1) slot, s0 or s1.
 
int fota_download_b1_file_parse (char *s0_s1_files)
 Parse and modify the provided file path so that it points to the bootloader file that should be used for a bootloader (B1) FOTA update.
 
int fota_download_external_start (const char *host, const char *file, const enum dfu_target_image_type expected_type, const size_t image_size)
 Start a FOTA download using an external download client. Requires.
 
int fota_download_external_evt_handle (struct download_client_evt const *const evt)
 Handle a download event from an external download client. Requires.