compress模块的API接口实现, 提供数据压缩/解压的能力 更多...
#include "compress_private.h"
#include "core_string.h"
#include "core_log.h"
#include "core_global.h"
#include "core_mqtt.h"
#include "libdeflate.h"
函数 | |
static void * | _compress_malloc (size_t size) |
static void | _compress_free (void *ptr) |
static void | _compress_core_mqtt_process_handler (void *context, aiot_mqtt_event_t *event, core_mqtt_event_t *core_event) |
static int32_t | _compress_core_mqtt_operate_process_handler (compress_handle_t *compress_handle, core_mqtt_option_t option) |
static int32_t | _compress_topic_filter (compress_handle_t *compress_handle, char *topic, uint16_t topic_len) |
static int32_t | _decompress_topic_filter (compress_handle_t *compress_handle, char *topic, uint16_t topic_len) |
static int32_t | _add_topic_filter (compress_handle_t *compress_handle, struct core_list_head *topic_list, char *topic) |
static int32_t | _compress_process (void *context, const core_mqtt_msg_t *src, core_mqtt_msg_t *dest) |
static int32_t | _core_decompress_process (void *context, const core_mqtt_msg_t *src, core_mqtt_msg_t *dest) |
static void | _compress_comprlist_destroy (compress_handle_t *compress_handle) |
void * | aiot_compress_init (void) |
创建compress会话实例, 并以默认值配置会话参数 更多... | |
int32_t | aiot_compress_setopt (void *handle, aiot_compress_option_t option, void *data) |
配置compress模块参数 更多... | |
int32_t | aiot_compress_deinit (void **handle) |
结束compress会话, 销毁实例并回收资源 更多... | |
static void | _compress_default_recv_handler (void *handle, const aiot_mqtt_recv_t *packet, void *userdata) |
int32_t | aiot_compress_topiclist_update (void *handle) |
同步给云平台,需要压缩/解压缩的topic 更多... | |
compress模块的API接口实现, 提供数据压缩/解压的能力
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
void* aiot_compress_init | ( | void | ) |
创建compress会话实例, 并以默认值配置会话参数
非NULL | compress实例的句柄 |
NULL | 初始化失败, 一般是内存分配失败导致 |
int32_t aiot_compress_setopt | ( | void * | handle, |
aiot_compress_option_t | option, | ||
void * | data | ||
) |
配置compress模块参数
[in] | handle | compress会话句柄 |
[in] | option | 配置选项, 更多信息请参考aiot_compress_option_t |
[in] | data | 配置选项数据, 更多信息请参考aiot_compress_option_t |
<STATE_SUCCESS | 参数配置失败 |
>=STATE_SUCCESS | 参数配置成功 |
int32_t aiot_compress_deinit | ( | void ** | handle | ) |
结束compress会话, 销毁实例并回收资源
[in] | handle | 指向compress会话句柄的指针 |
<STATE_SUCCESS | 执行失败 |
>=STATE_SUCCESS | 执行成功 |
|
static |
int32_t aiot_compress_topiclist_update | ( | void * | handle | ) |
同步给云平台,需要压缩/解压缩的topic
[in] | handle | 指向compress会话句柄的指针 |
<STATE_SUCCESS | 执行失败 |
>=STATE_SUCCESS | 执行成功 |