1 #ifndef _DM_CLIENT_H_
2 #define _DM_CLIENT_H_
3 
4 typedef struct {
5     const char *uri_name;
6     const char *uri_prefix;
7     int dev_type;
8     void *callback;
9 } dm_client_uri_map_t;
10 
11 void dm_client_event_handle(int fd, iotx_cm_event_msg_t *event, void *context);
12 
13 int dm_client_subscribe_all(int devid,
14                             char product_key[IOTX_PRODUCT_KEY_LEN + 1],
15                             char device_name[IOTX_DEVICE_NAME_LEN + 1],
16                             int dev_type);
17 
18 void dm_client_thing_model_down_raw(int fd, const char *topic,
19                                     const char *payload,
20                                     unsigned int payload_len, void *context);
21 void dm_client_thing_model_up_raw_reply(int fd, const char *topic,
22                                         const char *payload,
23                                         unsigned int payload_len,
24                                         void *context);
25 
26 #if !defined(DEVICE_MODEL_RAWDATA_SOLO)
27 void dm_client_thing_event_notify(int fd, const char *topic,
28                                   const char *payload, unsigned int payload_len,
29                                   void *context);
30 void dm_client_thing_property_desired_get_reply(int fd, const char *topic,
31                                                 const char *payload,
32                                                 unsigned int payload_len,
33                                                 void *context);
34 void dm_client_thing_property_desired_delete_reply(int fd, const char *topic,
35                                                    const char *payload,
36                                                    unsigned int payload_len,
37                                                    void *context);
38 void dm_client_thing_service_property_set(int fd, const char *topic,
39                                           const char *payload,
40                                           unsigned int payload_len,
41                                           void *context);
42 void dm_client_thing_service_property_get(int fd, const char *topic,
43                                           const char *payload,
44                                           unsigned int payload_len,
45                                           void *context);
46 void dm_client_thing_service_property_post(int fd, const char *topic,
47                                            const char *payload,
48                                            unsigned int payload_len,
49                                            void *context);
50 void dm_client_thing_event_property_post_reply(int fd, const char *topic,
51                                                const char *payload,
52                                                unsigned int payload_len,
53                                                void *context);
54 void dm_client_thing_deviceinfo_update_reply(int fd, const char *topic,
55                                              const char *payload,
56                                              unsigned int payload_len,
57                                              void *context);
58 void dm_client_thing_deviceinfo_delete_reply(int fd, const char *topic,
59                                              const char *payload,
60                                              unsigned int payload_len,
61                                              void *context);
62 void dm_client_thing_dynamictsl_get_reply(int fd, const char *topic,
63                                           const char *payload,
64                                           unsigned int payload_len,
65                                           void *context);
66 void dm_client_thing_service_request(int fd, const char *topic,
67                                      const char *payload,
68                                      unsigned int payload_len, void *context);
69 void dm_client_thing_event_post_reply(int fd, const char *topic,
70                                       const char *payload,
71                                       unsigned int payload_len, void *context);
72 void dm_client_rrpc_request_wildcard(int fd, const char *topic,
73                                      const char *payload,
74                                      unsigned int payload_len, void *context);
75 void dm_client_ntp_response(int fd, const char *topic, const char *payload,
76                             unsigned int payload_len, void *context);
77 void dm_client_ext_error(int fd, const char *topic, const char *payload,
78                          unsigned int payload_len, void *context);
79 #endif
80 
81 #ifdef DEVICE_MODEL_GATEWAY
82 int dm_client_subdev_unsubscribe(char product_key[IOTX_PRODUCT_KEY_LEN + 1],
83                                  char device_name[IOTX_DEVICE_NAME_LEN + 1]);
84 void dm_client_thing_topo_add_notify(int fd, const char *topic,
85                                      const char *payload,
86                                      unsigned int payload_len, void *context);
87 void dm_client_thing_disable(int fd, const char *topic, const char *payload,
88                              unsigned int payload_len, void *context);
89 void dm_client_thing_enable(int fd, const char *topic, const char *payload,
90                             unsigned int payload_len, void *context);
91 void dm_client_thing_delete(int fd, const char *topic, const char *payload,
92                             unsigned int payload_len, void *context);
93 void dm_client_thing_gateway_permit(int fd, const char *topic,
94                                     const char *payload,
95                                     unsigned int payload_len, void *context);
96 void dm_client_thing_sub_register_reply(int fd, const char *topic,
97                                         const char *payload,
98                                         unsigned int payload_len,
99                                         void *context);
100 void dm_client_thing_proxy_product_register_reply(int fd, const char *topic,
101                                                   const char *payload,
102                                                   unsigned int payload_len,
103                                                   void *context);
104 void dm_client_thing_sub_unregister_reply(int fd, const char *topic,
105                                           const char *payload,
106                                           unsigned int payload_len,
107                                           void *context);
108 void dm_client_thing_topo_add_reply(int fd, const char *topic,
109                                     const char *payload,
110                                     unsigned int payload_len, void *context);
111 void dm_client_thing_topo_delete_reply(int fd, const char *topic,
112                                        const char *payload,
113                                        unsigned int payload_len, void *context);
114 void dm_client_thing_topo_get_reply(int fd, const char *topic,
115                                     const char *payload,
116                                     unsigned int payload_len, void *context);
117 void dm_client_thing_list_found_reply(int fd, const char *topic,
118                                       const char *payload,
119                                       unsigned int payload_len, void *context);
120 void dm_client_combine_login_reply(int fd, const char *topic,
121                                    const char *payload,
122                                    unsigned int payload_len, void *context);
123 void dm_client_combine_logout_reply(int fd, const char *topic,
124                                     const char *payload,
125                                     unsigned int payload_len, void *context);
126 #endif
127 #endif
128