Link Kit C-SDK  4.1.0
函数
aiot_compress_api.c 文件参考

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"
aiot_compress_api.c 的引用(Include)关系图:

函数

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 void* _compress_malloc ( size_t  size)
static

函数调用图:

static void _compress_free ( void *  ptr)
static

函数调用图:

static void _compress_core_mqtt_process_handler ( void *  context,
aiot_mqtt_event_t event,
core_mqtt_event_t *  core_event 
)
static
static int32_t _compress_core_mqtt_operate_process_handler ( compress_handle_t *  compress_handle,
core_mqtt_option_t  option 
)
static

函数调用图:

static int32_t _compress_topic_filter ( compress_handle_t *  compress_handle,
char *  topic,
uint16_t  topic_len 
)
static

函数调用图:

static int32_t _decompress_topic_filter ( compress_handle_t *  compress_handle,
char *  topic,
uint16_t  topic_len 
)
static

函数调用图:

static int32_t _add_topic_filter ( compress_handle_t *  compress_handle,
struct core_list_head *  topic_list,
char *  topic 
)
static

函数调用图:

static int32_t _compress_process ( void *  context,
const core_mqtt_msg_t *  src,
core_mqtt_msg_t *  dest 
)
static

函数调用图:

static int32_t _core_decompress_process ( void *  context,
const core_mqtt_msg_t *  src,
core_mqtt_msg_t *  dest 
)
static

函数调用图:

static void _compress_comprlist_destroy ( compress_handle_t *  compress_handle)
static
void* aiot_compress_init ( void  )

创建compress会话实例, 并以默认值配置会话参数

返回
void *
返回值
非NULLcompress实例的句柄
NULL初始化失败, 一般是内存分配失败导致

函数调用图:

int32_t aiot_compress_setopt ( void *  handle,
aiot_compress_option_t  option,
void *  data 
)

配置compress模块参数

参数
[in]handlecompress会话句柄
[in]option配置选项, 更多信息请参考aiot_compress_option_t
[in]data配置选项数据, 更多信息请参考aiot_compress_option_t
返回
int32_t
返回值
<STATE_SUCCESS参数配置失败
>=STATE_SUCCESS参数配置成功

函数调用图:

int32_t aiot_compress_deinit ( void **  handle)

结束compress会话, 销毁实例并回收资源

参数
[in]handle指向compress会话句柄的指针
返回
int32_t
返回值
<STATE_SUCCESS执行失败
>=STATE_SUCCESS执行成功

函数调用图:

static void _compress_default_recv_handler ( void *  handle,
const aiot_mqtt_recv_t packet,
void *  userdata 
)
static
int32_t aiot_compress_topiclist_update ( void *  handle)

同步给云平台,需要压缩/解压缩的topic

参数
[in]handle指向compress会话句柄的指针
返回
int32_t
返回值
<STATE_SUCCESS执行失败
>=STATE_SUCCESS执行成功

函数调用图: