nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
download_client.h File Reference
#include <zephyr/kernel.h>
#include <zephyr/types.h>
#include <zephyr/net/coap.h>

Go to the source code of this file.

Data Structures

struct  download_fragment
 
struct  download_client_evt
 Download client event. More...
 
struct  download_client_cfg
 Download client configuration options. More...
 
struct  download_client
 Download client instance. More...
 

Typedefs

typedef int(* download_client_callback_t) (const struct download_client_evt *event)
 Download client asynchronous event handler.
 

Enumerations

enum  download_client_evt_id { DOWNLOAD_CLIENT_EVT_FRAGMENT , DOWNLOAD_CLIENT_EVT_ERROR , DOWNLOAD_CLIENT_EVT_DONE , DOWNLOAD_CLIENT_EVT_CLOSED }
 Download client event IDs. More...
 

Functions

int download_client_init (struct download_client *client, download_client_callback_t callback)
 Initialize the download client.
 
int download_client_set_host (struct download_client *client, const char *host, const struct download_client_cfg *config)
 Set a target hostname.
 
int download_client_start (struct download_client *client, const char *file, size_t from)
 Download a file.
 
int download_client_file_size_get (struct download_client *client, size_t *size)
 Retrieve the size of the file being downloaded, in bytes.
 
int download_client_downloaded_size_get (struct download_client *client, size_t *size)
 Retrieve the number of bytes downloaded so far.
 
int download_client_disconnect (struct download_client *client)
 Initiate disconnection.
 
int download_client_get (struct download_client *client, const char *host, const struct download_client_cfg *config, const char *file, size_t from)
 Download a file asynchronously.