Link Kit C-SDK  5.0.0
aiot_tunnel_switch_api.h
浏览该文件的文档.
1 
10 #ifndef _AIOT_TUNNEL_SWITCH_API_H
11 #define _AIOT_TUNNEL_SWITCH_API_H
12 
13 #if defined(__cplusplus)
14 extern "C" {
15 #endif
16 
17 #include <stdint.h>
18 
23 typedef enum {
37 
42 typedef struct {
46  uint32_t msg_id;
50  char *tunnel_id;
54  int8_t operation;
58  char *host;
62  uint32_t port;
66  char *path;
70  char *token;
74  uint32_t expired_time;
78  uint64_t created_time;
82  char *close_reason;
86  char *udi;
88 
96 typedef void (*ts_callback_t)(void *device, const aiot_ts_msg_t *recv, void *userdata);
97 
110 int32_t aiot_device_ts_set_callback(void *device, ts_callback_t callback, void *userdata);
111 
122 int32_t aiot_device_ts_request(void *device);
123 
132 
138 void aiot_ts_msg_free(const aiot_ts_msg_t *msg);
139 
140 #if defined(__cplusplus)
141 }
142 #endif
143 
144 #endif
char * udi
用户自定义数据,需要用户在隧道创建时传入
Definition: aiot_tunnel_switch_api.h:86
int8_t operation
隧道操作类型,【1,打开隧道】 【0,关闭隧道】
Definition: aiot_tunnel_switch_api.h:54
char * path
隧道连接的具体路径
Definition: aiot_tunnel_switch_api.h:66
char * host
隧道连接的地址
Definition: aiot_tunnel_switch_api.h:58
int32_t aiot_device_ts_set_callback(void *device, ts_callback_t callback, void *userdata)
设置远程配置
隧道开关消息的结构体
Definition: aiot_tunnel_switch_api.h:42
uint32_t msg_id
消息id,用户可不关注
Definition: aiot_tunnel_switch_api.h:46
void aiot_ts_msg_free(const aiot_ts_msg_t *msg)
释放隧道的消息资源
int32_t aiot_device_ts_request(void *device)
请求默认的远程登录隧道建连信息
char * close_reason
如果是关闭操作,反馈是隧道过期,还是用户关闭
Definition: aiot_tunnel_switch_api.h:82
char * tunnel_id
字符串,隧道ID,用于标示指定隧道
Definition: aiot_tunnel_switch_api.h:50
uint64_t created_time
隧道token创建的时间,设备系统时间,单位ms
Definition: aiot_tunnel_switch_api.h:78
void(* ts_callback_t)(void *device, const aiot_ts_msg_t *recv, void *userdata)
设备隧道开关模块消息回调函数原型,用户定义后, 可通过 aiot_device_ts_set_callback 配置 ...
Definition: aiot_tunnel_switch_api.h:96
uint32_t port
隧道连接的端口号
Definition: aiot_tunnel_switch_api.h:62
char * token
隧道建连的token
Definition: aiot_tunnel_switch_api.h:70
打开隧道连接
Definition: aiot_tunnel_switch_api.h:31
aiot_ts_ops_t
隧道开关模块,物联网平台下发隧道操作类型
Definition: aiot_tunnel_switch_api.h:23
更新隧道连接信息, 发生在设备主动请求默认的远程登录隧道信息。
Definition: aiot_tunnel_switch_api.h:35
aiot_ts_msg_t * aiot_ts_msg_clone(const aiot_ts_msg_t *msg)
拷贝隧道的消息
uint32_t expired_time
隧道token过期的剩余时间,单位s
Definition: aiot_tunnel_switch_api.h:74
关闭隧道连接
Definition: aiot_tunnel_switch_api.h:27