Link Kit C-SDK  4.1.0
| 函数 | 变量
aiot_tunnel_switch_api.c 文件参考

隧道开关接口实现 更多...

#include <stdio.h>
#include "aiot_sysdep_api.h"
#include "aiot_state_api.h"
#include "aiot_tunnel_switch_api.h"
#include "aiot_mqtt_api.h"
#include "core_mqtt.h"
#include "core_string.h"
aiot_tunnel_switch_api.c 的引用(Include)关系图:

struct  tunnel_switch_handler_t
 

函数

static char * _core_json_get_value_char (const char *payload, int32_t payload_len, const char *key)
 
static void _tunnel_switch_notify_topic_handler (void *handle, const aiot_mqtt_recv_t *packet, void *userdata)
 
static void _tunnel_switch_request_reply_topic_handler (void *handle, const aiot_mqtt_recv_t *packet, void *userdata)
 
static int32_t _sub_switch_topic (tunnel_switch_handler_t *ts_handle)
 
static int32_t _unsub_switch_topic (tunnel_switch_handler_t *ts_handle)
 
void * aiot_tunnel_switch_init ()
 初始化tunnel_switch实例 更多...
 
int32_t aiot_tunnel_switch_setopt (void *handle, aiot_tunnel_switch_option_t option, void *data)
 设置tunnel_switch参数 更多...
 
int32_t aiot_tunnel_switch_deinit (void **handle)
 销毁tunnel_switch实例, 释放资源 更多...
 
int32_t aiot_tunnel_switch_request (void *handle)
 发送获取隧道信息 更多...
 

变量

static char * FMT_TOPIC_SWITCH = "/sys/%s/%s/secure_tunnel/notify"
 
static char * FMT_TOPIC_REQUEST = "/sys/%s/%s/secure_tunnel/proxy/request"
 
static char * FMT_TOPIC_REQUEST_REPLY = "/sys/%s/%s/secure_tunnel/proxy/request_reply"
 
static char * TAG = "TUNNEL"
 

详细描述

隧道开关接口实现

日期
2020-01-20

函数说明

static char* _core_json_get_value_char ( const char *  payload,
int32_t  payload_len,
const char *  key 
)
static

函数调用图:

static void _tunnel_switch_notify_topic_handler ( void *  handle,
const aiot_mqtt_recv_t packet,
void *  userdata 
)
static

函数调用图:

static void _tunnel_switch_request_reply_topic_handler ( void *  handle,
const aiot_mqtt_recv_t packet,
void *  userdata 
)
static

函数调用图:

static int32_t _sub_switch_topic ( tunnel_switch_handler_t ts_handle)
static

函数调用图:

static int32_t _unsub_switch_topic ( tunnel_switch_handler_t ts_handle)
static

函数调用图:

void* aiot_tunnel_switch_init ( )

初始化tunnel_switch实例

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

函数调用图:

int32_t aiot_tunnel_switch_setopt ( void *  handle,
aiot_tunnel_switch_option_t  option,
void *  data 
)

设置tunnel_switch参数

参数
[in]handletunnel_switch实例句柄
[in]option配置选项, 更多信息请查看aiot_tunnel_switch_option_t
[in]data配置数据, 更多信息请查看aiot_tunnel_switch_option_t
返回
int32_t
返回值
STATE_SUCCESS参数配置成功
others参考aiot_state_api.h

函数调用图:

int32_t aiot_tunnel_switch_deinit ( void **  handle)

销毁tunnel_switch实例, 释放资源

参数
[in]handle指向tunnel_switch实例句柄的指针
返回
int32_t
返回值
STATE_SUCCESS执行成功
<STATE_SUCCESS执行失败

函数调用图:

int32_t aiot_tunnel_switch_request ( void *  handle)

发送获取隧道信息

参数
[in]handle指向tunnel_switch实例句柄
返回
int32_t
返回值
STATE_SUCCESS执行成功
<STATE_SUCCESS执行失败

函数调用图:

变量说明

char* FMT_TOPIC_SWITCH = "/sys/%s/%s/secure_tunnel/notify"
static
char* FMT_TOPIC_REQUEST = "/sys/%s/%s/secure_tunnel/proxy/request"
static
char* FMT_TOPIC_REQUEST_REPLY = "/sys/%s/%s/secure_tunnel/proxy/request_reply"
static
char* TAG = "TUNNEL"
static