Link Kit C-SDK  5.0.0
aiot_shadow_api.h
浏览该文件的文档.
1 
10 #ifndef __AIOT_SHADOW_API_H__
11 #define __AIOT_SHADOW_API_H__
12 
13 #if defined(__cplusplus)
14 extern "C" {
15 #endif
16 
17 #include <stdint.h>
18 
22 typedef enum {
28 
33 
39 
43 typedef struct {
47  char *payload;
48 
52  uint32_t payload_len;
53 
57  char *status;
58 
62  uint64_t timestamp;
64 
68 typedef struct {
72  char *payload;
73 
77  uint32_t payload_len;
78 
82  uint64_t version;
84 
88 typedef struct {
92  char *payload;
93 
97  uint32_t payload_len;
98 
102  uint64_t version;
104 
108 typedef struct {
112  aiot_shadow_recv_type_t type;
116  union {
120  } data;
122 
132 typedef void (* aiot_shadow_recv_callback_t)(void *device,
133  const aiot_shadow_recv_t *recv, void *userdata);
134 
147 int32_t aiot_device_shadow_set_callback(void *device, aiot_shadow_recv_callback_t callback, void *userdata);
148 
161 int32_t aiot_device_shadow_update(void *device, char *reported, int64_t version);
162 
163 
175 int32_t aiot_device_shadow_clean_desired(void *device, int64_t version);
176 
187 int32_t aiot_device_shadow_get(void *device);
188 
203 int32_t aiot_device_shadow_delete_reported(void *device, char *reported, int64_t version);
204 
205 #if defined(__cplusplus)
206 }
207 #endif
208 
209 #endif
uint32_t payload_len
应答数据长度
Definition: aiot_shadow_api.h:52
void(* aiot_shadow_recv_callback_t)(void *device, const aiot_shadow_recv_t *recv, void *userdata)
shadow模块收到从网络上来的报文时, 通知用户所调用的数据回调函数
Definition: aiot_shadow_api.h:132
设备调用 aiot_device_shadow_get 发送消息后, 云端返回的设备影子数据
Definition: aiot_shadow_api.h:88
设备发送 aiot_device_shadow_update, aiot_device_shadow_clean_desired 或 aiot_device_shadow_delete_rep...
Definition: aiot_shadow_api.h:27
int32_t aiot_device_shadow_clean_desired(void *device, int64_t version)
清除设备影子中的desired数据
uint64_t version
设备影子版本
Definition: aiot_shadow_api.h:82
设备调用 aiot_device_shadow_update, aiot_device_shadow_clean_desired 或 aiot_device_shadow_delete_rep...
Definition: aiot_shadow_api.h:43
aiot_shadow_recv_type_t
shadow模块收到从网络上来的报文时, 通知用户的报文类型
Definition: aiot_shadow_api.h:22
aiot_shadow_recv_control_t control
Definition: aiot_shadow_api.h:118
uint64_t timestamp
应答报文对应的时间戳
Definition: aiot_shadow_api.h:62
uint64_t version
设备影子版本号
Definition: aiot_shadow_api.h:102
shadow模块收到从网络上来的报文时, 通知用户的报文内容
Definition: aiot_shadow_api.h:108
aiot_shadow_recv_get_reply_t get_reply
Definition: aiot_shadow_api.h:119
char * payload
指向设备影子数据的指针
Definition: aiot_shadow_api.h:72
char * payload
指向设备影子数据的指针
Definition: aiot_shadow_api.h:92
如果设备在线, 用户应用调用云端APIUpdateDeviceShadow后云端下推的消息
Definition: aiot_shadow_api.h:68
aiot_shadow_recv_type_t type
报文内容所对应的报文类型, 更多信息请参考aiot_shadow_recv_type_t
Definition: aiot_shadow_api.h:112
uint32_t payload_len
设备影子数据长度
Definition: aiot_shadow_api.h:77
aiot_shadow_recv_generic_reply_t generic_reply
Definition: aiot_shadow_api.h:117
int32_t aiot_device_shadow_get(void *device)
获取设备影子
int32_t aiot_device_shadow_set_callback(void *device, aiot_shadow_recv_callback_t callback, void *userdata)
设置设备影子消息回调函数
uint32_t payload_len
设备影子数据长度
Definition: aiot_shadow_api.h:97
char * payload
指向应答数据的指针
Definition: aiot_shadow_api.h:47
设备在线时, 云端自动下发的影子内容, 消息数据结构体参考 aiot_shadow_recv_control_t ...
Definition: aiot_shadow_api.h:32
int32_t aiot_device_shadow_delete_reported(void *device, char *reported, int64_t version)
用于删除设备影子中的reported数据
char * status
应答状态字符串, 云端处理成功则为success, 发送消息错误则为error, 错误信息和错误码放在在payload中 ...
Definition: aiot_shadow_api.h:57
int32_t aiot_device_shadow_update(void *device, char *reported, int64_t version)
更新设备影子中的reported数据
主动获取设备影子内容云端返回的影子内容, 消息数据结构体参考 aiot_shadow_recv_get_reply_t ...
Definition: aiot_shadow_api.h:37