1 #ifndef _DM_SERVER_ADAPTER_H_
2 #define _DM_SERVER_ADAPTER_H_
3 
4 #ifdef ALCS_ENABLED
5 
6 #define DM_SERVER_ALCS_ADDR          "224.0.1.187"
7 #define DM_SERVER_ALCS_PORT          (5863)
8 #define DM_SERVER_ALCS_SEND_MAXCOUNT (16)
9 #define DM_SERVER_ALCS_WAITTIME      (200)
10 #define DM_SERVER_ALCS_OBS_MAXCOUNT  (16)
11 #define DM_SERVER_ALCS_RES_MAXCOUNT  (255)
12 
13 typedef struct {
14     void *conn_handle;
15 } dm_server_ctx_t;
16 
17 typedef struct {
18     char *ip;
19     uint16_t port;
20     char *token;
21     int token_len;
22 } dm_server_alcs_context_t;
23 
24 int dm_server_open(void);
25 int dm_server_connect(void);
26 int dm_server_close(void);
27 int dm_server_send(char *uri, unsigned char *payload, int payload_len,
28                    void *context);
29 int dm_server_subscribe(char *uri, CoAPRecvMsgHandler callback, int auth_type);
30 int dm_server_add_device(char product_key[IOTX_PRODUCT_KEY_LEN + 1],
31                          char device_name[IOTX_DEVICE_NAME_LEN + 1]);
32 int dm_server_del_device(char product_key[IOTX_PRODUCT_KEY_LEN + 1],
33                          char device_name[IOTX_DEVICE_NAME_LEN + 1]);
34 int dm_server_yield(void);
35 
36 #endif
37 #endif
38 
39