1 #ifndef _DM_CLIENT_ADAPTER_H_ 2 #define _DM_CLIENT_ADAPTER_H_ 3 4 typedef struct { 5 int fd; 6 iotx_conn_info_t *conn_info; 7 void *callback; 8 } dm_client_ctx_t; 9 10 int dm_client_open(void); 11 int dm_client_connect(int timeout_ms); 12 int dm_client_close(void); 13 int dm_client_subscribe(char *uri, iotx_cm_data_handle_cb callback, 14 void *context); 15 int dm_client_unsubscribe(char *uri); 16 int dm_client_publish(char *uri, unsigned char *payload, int payload_len, 17 iotx_cm_data_handle_cb callback); 18 int dm_client_yield(unsigned int timeout); 19 void dm_client_user_sub_request(int fd, const char *topic, const char *payload, 20 unsigned int payload_len, void *context); 21 #endif 22