20 #ifndef __AIOT_LOGPOST_API_H__    21 #define __AIOT_LOGPOST_API_H__    23 #if defined(__cplusplus)    32 #define STATE_LOGPOST_BASE                                              (-0x1500)    37 #define STATE_LOGPOST_MQTT_HANDLE_IS_NULL                               (-0x1501)    42 #define STATE_LOGPOST_POST_TURN_OFF                                     (-0x1502)    47 #define STATE_LOGPOST_LOGLEVEL_ERROR                                    (-0x1503)    52 #define STATE_LOGPOST_LOG_MODULE_NAME_IS_NULL                           (-0x1504)    57 #define STATE_LOGPOST_LOG_CONTENT_IS_NULL                               (-0x1505)    62 #define STATE_LOGPOST_LOG_CONTENT_TOO_LONG                              (-0x1506)    67 #define STATE_LOGPOST_LOG_RECV                                          (-0x1507)    72 #define SATAE_LOGPOST_LOG_PARSE_MSG_FAILED                              (-0x1508)   182     aiot_logpost_event_type_t  
type;
   263 #if defined(__cplusplus) 系统日志的开关. 
Definition: aiot_logpost_api.h:107
 
aiot_logpost_event_type_t
logpost模块内部发生值得用户关注的状态变化时, 通知用户的事件类型 
Definition: aiot_logpost_api.h:168
 
aiot_logpost_event_type_t type
事件内容所对应的事件类型, 更多信息请参考aiot_logpost_event_type_t 
Definition: aiot_logpost_api.h:182
 
日志数据结构体定义 
Definition: aiot_logpost_api.h:132
 
aiot_logpost_level_t loglevel
日志级别, 请查看aiot_logpost_level_t 定义 
Definition: aiot_logpost_api.h:141
 
aiot_logpost_level_t
日志级别枚举类型定义 
Definition: aiot_logpost_api.h:120
 
int32_t aiot_logpost_setopt(void *handle, aiot_logpost_option_t option, void *data)
配置logpost会话 
Definition: aiot_logpost_api.c:272
 
配置选项数量最大值, 不可用作配置参数 
Definition: aiot_logpost_api.h:112
 
uint8_t on_off
日志开关状态, 0: 关闭日志上传; 1: 打开日志上传 
Definition: aiot_logpost_api.h:192
 
Definition: aiot_logpost_api.h:125
 
接受到云端下发的日志配置数据 
Definition: aiot_logpost_api.h:172
 
char * module_name
模块名称, 必须为以结束符'\0'结尾的字符串 
Definition: aiot_logpost_api.h:146
 
char * content
日志内容, 必须为以结束符'\0'结尾的字符串 
Definition: aiot_logpost_api.h:161
 
Definition: aiot_logpost_api.h:124
 
aiot_logpost_option_t
aiot_logpost_setopt 接口的option参数可选值. 
Definition: aiot_logpost_api.h:80
 
int32_t aiot_logpost_send(void *handle, aiot_logpost_msg_t *msg)
向服务器发送日志消息 
Definition: aiot_logpost_api.c:334
 
void * aiot_logpost_init(void)
创建logpost会话实例, 并以默认值配置会话参数 
Definition: aiot_logpost_api.c:249
 
Definition: aiot_logpost_api.h:122
 
Definition: aiot_logpost_api.h:121
 
void(* aiot_logpost_event_handler_t)(void *handle, const aiot_logpost_event_t *event, void *userdata)
logpost模块内部发生值得用户关注的状态变化时, 通知用户所调用的事件回调函数 
Definition: aiot_logpost_api.h:207
 
模块依赖的MQTT句柄 
Definition: aiot_logpost_api.h:88
 
uint64_t timestamp
utc时间戳, 单位为ms, 此数值会直接展示在云端控制台设备日志页面 
Definition: aiot_logpost_api.h:136
 
用户需要SDK暂存的上下文, 数据类型为(void *) 
Definition: aiot_logpost_api.h:100
 
int32_t aiot_logpost_deinit(void **handle)
结束logpost会话, 销毁实例并回收资源 
Definition: aiot_logpost_api.c:425
 
uint64_t msg_id
消息标示符, 用于标识云端下行消息, 可从data-module模块的消息接收回调函数中获得对应的标识符, 如果用户设置为0, 此字段将不上传。 
Definition: aiot_logpost_api.h:156
 
int32_t code
状态码, 可用于标识日志对应的状态 
Definition: aiot_logpost_api.h:151
 
Definition: aiot_logpost_api.h:123
 
logpost模块内部发生值得用户关注的状态变化时, 通知用户的事件内容 
Definition: aiot_logpost_api.h:178
 
设置回调, 它在SDK收到网络报文的时候被调用, 告知用户, 数据类型为(aiot_logpost_recv_handler_t) ...
Definition: aiot_logpost_api.h:93