8 #ifndef __AIOT_MQTT_DOWNLOAD_API_H__ 9 #define __AIOT_MQTT_DOWNLOAD_API_H__ 11 #if defined(__cplusplus) 20 #define STATE_MQTT_DOWNLOAD_BASE (-0x1D00) 25 #define STATE_MQTT_DOWNLOAD_MQTT_HANDLE_NULL (-0x1D01) 30 #define STATE_MQTT_DOWNLOAD_TASK_DEINIT (-0x1D02) 35 #define STATE_MQTT_DOWNLOAD_INIT (-0x1D03) 40 #define STATE_MQTT_DOWNLOAD_ING (-0x1D04) 45 #define STATE_MQTT_DOWNLOAD_FINISHED (-0x1D05) 50 #define STATE_MQTT_DOWNLOAD_SUCCESS (-0x1D06) 55 #define STATE_MQTT_DOWNLOAD_FAILED_TIMEOUT (-0x1D07) 60 #define STATE_MQTT_DOWNLOAD_FAILED_MISMATCH (-0x1D08) 65 #define STATE_MQTT_DOWNLOAD_FAILED_RECVERROR (-0x1D09) 70 #define STATE_MQTT_DOWNLOAD_ABORT (-0x1D0A) 75 #define STATE_MQTT_DOWNLOAD_FILESIZE_ERROR (-0x1D0B) 96 aiot_mqtt_download_recv_type_t
type;
284 #if defined(__cplusplus) 文件分片下载请求的返回报文
Definition: aiot_mqtt_download_api.h:86
用户需要SDK暂存的上下文
Definition: aiot_mqtt_download_api.h:178
void * aiot_mqtt_download_init(void)
创建mqtt_download会话实例, 并以默认值配置会话参数
Definition: aiot_mqtt_download_api.c:106
设置按照range下载的起始地址
Definition: aiot_mqtt_download_api.h:203
设置download实例句柄所包含下载任务的具体内容
Definition: aiot_mqtt_download_api.h:190
aiot_mqtt_download_recv_type_t
mqtt_download模块收到从网络上来的报文时, 通知用户的报文类型
Definition: aiot_mqtt_download_api.h:82
aiot_mqtt_download_option_t
aiot_mqtt_download_setopt 接口的option参数可选值.
Definition: aiot_mqtt_download_api.h:148
char * data
接收到的数据
Definition: aiot_mqtt_download_api.h:117
int32_t percent
接收到的数据
Definition: aiot_mqtt_download_api.h:121
单次请求数据的最大长度
Definition: aiot_mqtt_download_api.h:224
Definition: aiot_mqtt_download_api.h:226
int32_t aiot_mqtt_download_deinit(void **handle)
结束mqtt_download会话, 销毁实例并回收资源
Definition: aiot_mqtt_download_api.c:150
char * filename
用户标准的文件名称,一般为设置的文件名
Definition: aiot_mqtt_download_api.h:105
int32_t aiot_mqtt_download_setopt(void *handle, aiot_mqtt_download_option_t option, void *data)
配置mqtt_download会话
Definition: aiot_mqtt_download_api.c:410
设置MQTT的handle
Definition: aiot_mqtt_download_api.h:167
uint32_t data_size
接收到的数据长度
Definition: aiot_mqtt_download_api.h:113
设置处理OTA消息的用户回调函数
Definition: aiot_mqtt_download_api.h:156
uint32_t offset
文件的偏移
Definition: aiot_mqtt_download_api.h:109
设置按照range下载的结束地址
Definition: aiot_mqtt_download_api.h:215
int32_t file_lenth
文件的总大小
Definition: aiot_mqtt_download_api.h:125
int32_t aiot_mqtt_download_process(void *handle)
处理下载逻辑
Definition: aiot_mqtt_download_api.c:545
mqtt_download模块收到从网络上来的报文时, 通知用户的报文内容
Definition: aiot_mqtt_download_api.h:92
void(* aiot_mqtt_download_recv_handler_t)(void *handle, const aiot_mqtt_download_recv_t *packet, void *userdata)
mqtt_download模块收到从网络上来的报文时, 通知用户所调用的数据回调函数
Definition: aiot_mqtt_download_api.h:139
aiot_mqtt_download_recv_type_t type
报文内容所对应的报文类型, 更多信息请参考aiot_mqtt_download_recv_type_t
Definition: aiot_mqtt_download_api.h:96