Link Kit C-SDK
4.1.0
|
隧道开关接口实现 更多...
#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"
类 | |
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" |
隧道开关接口实现
|
static |
|
static |
|
static |
|
static |
|
static |
void* aiot_tunnel_switch_init | ( | ) |
初始化tunnel_switch实例
非NULL | tunnel_switch实例句柄 |
NULL | 初始化失败, 一般是内存分配失败导致 |
int32_t aiot_tunnel_switch_setopt | ( | void * | handle, |
aiot_tunnel_switch_option_t | option, | ||
void * | data | ||
) |
设置tunnel_switch参数
[in] | handle | tunnel_switch实例句柄 |
[in] | option | 配置选项, 更多信息请查看aiot_tunnel_switch_option_t |
[in] | data | 配置数据, 更多信息请查看aiot_tunnel_switch_option_t |
STATE_SUCCESS | 参数配置成功 |
others | 参考aiot_state_api.h |
int32_t aiot_tunnel_switch_deinit | ( | void ** | handle | ) |
销毁tunnel_switch实例, 释放资源
[in] | handle | 指向tunnel_switch实例句柄的指针 |
STATE_SUCCESS | 执行成功 |
<STATE_SUCCESS | 执行失败 |
int32_t aiot_tunnel_switch_request | ( | void * | handle | ) |
发送获取隧道信息
[in] | handle | 指向tunnel_switch实例句柄 |
STATE_SUCCESS | 执行成功 |
<STATE_SUCCESS | 执行失败 |
|
static |
|
static |
|
static |
|
static |