anjay
Loading...
Searching...
No Matches
download.h
Go to the documentation of this file.
1/*
2 * Copyright 2017-2024 AVSystem <avsystem@avsystem.com>
3 * AVSystem Anjay LwM2M SDK
4 * All rights reserved.
5 *
6 * Licensed under the AVSystem-5-clause License.
7 * See the attached LICENSE file for details.
8 */
9
10#ifndef ANJAY_INCLUDE_ANJAY_DOWNLOAD_H
11#define ANJAY_INCLUDE_ANJAY_DOWNLOAD_H
12
13#include <stddef.h>
14#include <stdint.h>
15
16#include <avsystem/commons/avs_net.h>
17
18#include <anjay/anjay_config.h>
19#include <anjay/core.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
26typedef struct anjay_etag {
27 uint8_t size;
28 uint8_t value[1]; // actually a flexible array member
30
40anjay_etag_t *anjay_etag_new(uint8_t etag_size);
41
51
71typedef avs_error_t
73 const uint8_t *data,
74 size_t data_size,
75 const anjay_etag_t *etag,
76 void *user_data);
77
91
92typedef struct {
94
95 union {
116 avs_error_t error;
117
129 } details;
131
143 void *user_data);
144
210
212
243avs_error_t anjay_download(anjay_t *anjay,
244 const anjay_download_config_t *config,
245 anjay_download_handle_t *out_handle);
246
293avs_error_t
295 anjay_download_handle_t dl_handle,
296 size_t next_block_offset);
297
307
326
349
350#ifdef __cplusplus
351} /* extern "C" */
352#endif
353
354#endif /*ANJAY_INCLUDE_ANJAY_DOWNLOAD_H*/
struct anjay_struct anjay_t
Definition core.h:45
int anjay_download_reconnect(anjay_t *anjay, anjay_download_handle_t dl_handle)
avs_error_t anjay_download_set_next_block_offset(anjay_t *anjay, anjay_download_handle_t dl_handle, size_t next_block_offset)
void * anjay_download_handle_t
Definition download.h:211
void anjay_download_abort(anjay_t *anjay, anjay_download_handle_t dl_handle)
void anjay_download_suspend(anjay_t *anjay, anjay_download_handle_t dl_handle)
void anjay_download_finished_handler_t(anjay_t *anjay, anjay_download_status_t status, void *user_data)
Definition download.h:141
anjay_download_result
Definition download.h:78
@ ANJAY_DOWNLOAD_ERR_ABORTED
Definition download.h:89
@ ANJAY_DOWNLOAD_ERR_INVALID_RESPONSE
Definition download.h:85
@ ANJAY_DOWNLOAD_ERR_FAILED
Definition download.h:82
@ ANJAY_DOWNLOAD_FINISHED
Definition download.h:80
@ ANJAY_DOWNLOAD_ERR_EXPIRED
Definition download.h:87
avs_error_t anjay_download_next_block_handler_t(anjay_t *anjay, const uint8_t *data, size_t data_size, const anjay_etag_t *etag, void *user_data)
Definition download.h:72
anjay_etag_t * anjay_etag_new(uint8_t etag_size)
struct anjay_etag anjay_etag_t
struct anjay_download_config anjay_download_config_t
avs_error_t anjay_download(anjay_t *anjay, const anjay_download_config_t *config, anjay_download_handle_t *out_handle)
anjay_etag_t * anjay_etag_clone(const anjay_etag_t *old_etag)
enum anjay_download_result anjay_download_result_t
Definition download.h:145
void * user_data
Definition download.h:169
size_t start_offset
Definition download.h:154
const anjay_etag_t * etag
Definition download.h:160
bool prefer_same_socket_downloads
Definition download.h:208
avs_time_duration_t tcp_request_timeout
Definition download.h:198
anjay_download_next_block_handler_t * on_next_block
Definition download.h:163
anjay_download_finished_handler_t * on_download_finished
Definition download.h:166
anjay_security_config_t security_config
Definition download.h:179
avs_coap_udp_tx_params_t * coap_tx_params
Definition download.h:185
const char * url
Definition download.h:147
Definition download.h:92
anjay_download_result_t result
Definition download.h:93
avs_error_t error
Definition download.h:116
int status_code
Definition download.h:128
Definition download.h:26
uint8_t value[1]
Definition download.h:28
uint8_t size
Definition download.h:27
Definition core.h:1906