1 /*
2  * Copyright (C) 2015-2018 Alibaba Group Holding Limited
3  */
4 
5 #ifndef __INFRA_PREAUTH__
6 #define __INFRA_PREAUTH__
7 
8 #include "linkkit/infra/infra_defs.h"
9 #include "linkkit/infra/infra_types.h"
10 
11 #ifdef INFRA_LOG
12 #include "linkkit/infra/infra_log.h"
13 #define preauth_err(...)   log_err("preauth", __VA_ARGS__)
14 #define preauth_info(...)  log_info("preauth", __VA_ARGS__)
15 #define preauth_debug(...) log_debug("preauth", __VA_ARGS__)
16 #else
17 #define preauth_err(...)         \
18     do {                         \
19         HAL_Printf(__VA_ARGS__); \
20         HAL_Printf("\r\n");      \
21     } while (0)
22 #define preauth_info(...)        \
23     do {                         \
24         HAL_Printf(__VA_ARGS__); \
25         HAL_Printf("\r\n");      \
26     } while (0)
27 #define preauth_debug(...)       \
28     do {                         \
29         HAL_Printf(__VA_ARGS__); \
30         HAL_Printf("\r\n");      \
31     } while (0)
32 #endif
33 
34 int preauth_get_connection_info(iotx_mqtt_region_types_t region,
35                                 iotx_dev_meta_info_t *dev_meta,
36                                 const char *sign, const char *device_id,
37                                 iotx_sign_mqtt_t *preauth_output);
38 
39 #endif /* #ifndef __INFRA_PREAUTH__ */
40 
41