-
Notifications
You must be signed in to change notification settings - Fork 0
/
sign_api.h
53 lines (42 loc) · 1.57 KB
/
sign_api.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef __SIGN_H__
#define __SIGN_H__
#if defined(__cplusplus)
extern "C" {
#endif
#include <stdint.h>
#define IOTX_PRODUCT_KEY_LEN (20)
#define IOTX_PRODUCT_SECRET_LEN (64)
#define IOTX_DEVICE_NAME_LEN (32)
#define IOTX_DEVICE_SECRET_LEN (64)
#define DEV_SIGN_SOURCE_MAXLEN (200)
#define DEV_SIGN_HOSTNAME_MAXLEN (64)
#define DEV_SIGN_CLIENT_ID_MAXLEN (200)
#define DEV_SIGN_USERNAME_MAXLEN (64)
#define DEV_SIGN_PASSWORD_MAXLEN (65)
typedef enum {
IOTX_CLOUD_REGION_SHANGHAI, /* Shanghai */
IOTX_CLOUD_REGION_SINGAPORE, /* Singapore */
IOTX_CLOUD_REGION_JAPAN, /* Japan */
IOTX_CLOUD_REGION_USA_WEST, /* America */
IOTX_CLOUD_REGION_GERMANY, /* Germany */
IOTX_CLOUD_REGION_CUSTOM, /* Custom setting */
IOTX_CLOUD_DOMAIN_MAX /* Maximum number of domain */
} iotx_mqtt_region_types_t;
typedef struct _iotx_dev_meta_info {
char product_key[IOTX_PRODUCT_KEY_LEN + 1];
char product_secret[IOTX_PRODUCT_SECRET_LEN + 1];
char device_name[IOTX_DEVICE_NAME_LEN + 1];
char device_secret[IOTX_DEVICE_SECRET_LEN + 1];
} iotx_dev_meta_info_t;
typedef struct {
char hostname[DEV_SIGN_HOSTNAME_MAXLEN];
uint16_t port;
char clientid[DEV_SIGN_CLIENT_ID_MAXLEN];
char username[DEV_SIGN_USERNAME_MAXLEN];
char password[DEV_SIGN_PASSWORD_MAXLEN];
} iotx_sign_mqtt_t;
int32_t IOT_Sign_MQTT(iotx_mqtt_region_types_t region, iotx_dev_meta_info_t *meta, iotx_sign_mqtt_t *signout);
#if defined(__cplusplus)
}
#endif
#endif /* #ifndef __SIGN_H__ */