本项止转自github官方arduino-esp32 传在这里仅为阅读源码方便
projectuser
2019-07-05 50148ccffe21ff54262064ec9f2245900eaf18aa
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
 * This file is subject to the terms and conditions defined in
 * file 'LICENSE', which is part of this source code package.
 * Tuan PM <tuanpm at live dot com>
 */
#ifndef _MQTT_CONFIG_H_
#define _MQTT_CONFIG_H_
 
#include "sdkconfig.h"
 
#define MQTT_PROTOCOL_311           CONFIG_MQTT_PROTOCOL_311
#define MQTT_RECONNECT_TIMEOUT_MS   (10*1000)
 
#if CONFIG_MQTT_BUFFER_SIZE
#define MQTT_BUFFER_SIZE_BYTE       CONFIG_MQTT_BUFFER_SIZE
#else
#define MQTT_BUFFER_SIZE_BYTE       1024
#endif
 
#define MQTT_MAX_HOST_LEN           64
#define MQTT_MAX_CLIENT_LEN         32
#define MQTT_MAX_USERNAME_LEN       32
#define MQTT_MAX_PASSWORD_LEN       65
#define MQTT_MAX_LWT_TOPIC          32
#define MQTT_MAX_LWT_MSG            128
#define MQTT_TASK_PRIORITY          5
 
#if CONFIG_MQTT_TASK_STACK_SIZE
#define MQTT_TASK_STACK             CONFIG_MQTT_TASK_STACK_SIZE
#else
#define MQTT_TASK_STACK             (6*1024)
#endif
 
#define MQTT_KEEPALIVE_TICK         (120)
#define MQTT_CMD_QUEUE_SIZE         (10)
#define MQTT_NETWORK_TIMEOUT_MS     (10000)
 
#ifdef CONFIG_MQTT_TCP_DEFAULT_PORT
#define MQTT_TCP_DEFAULT_PORT       CONFIG_MQTT_TCP_DEFAULT_PORT
#else
#define MQTT_TCP_DEFAULT_PORT       1883
#endif
 
#ifdef CONFIG_MQTT_SSL_DEFAULT_PORT
#define MQTT_SSL_DEFAULT_PORT       CONFIG_MQTT_SSL_DEFAULT_PORT
#else
#define MQTT_SSL_DEFAULT_PORT       8883
#endif
 
#ifdef CONFIG_MQTT_WS_DEFAULT_PORT
#define MQTT_WS_DEFAULT_PORT        CONFIG_MQTT_WS_DEFAULT_PORT
#else
#define MQTT_WS_DEFAULT_PORT        80
#endif
 
#ifdef MQTT_WSS_DEFAULT_PORT
#define MQTT_WSS_DEFAULT_PORT       CONFIG_MQTT_WSS_DEFAULT_PORT
#else
#define MQTT_WSS_DEFAULT_PORT       443
#endif
 
#define MQTT_CORE_SELECTION_ENABLED CONFIG_MQTT_TASK_CORE_SELECTION_ENABLED
 
#ifdef CONFIG_MQTT_USE_CORE_0
    #define MQTT_TASK_CORE    0
#else
    #ifdef CONFIG_MQTT_USE_CORE_1
        #define MQTT_TASK_CORE 1
    #else
        #define MQTT_TASK_CORE 0
    #endif
#endif
 
 
#define MQTT_ENABLE_SSL             CONFIG_MQTT_TRANSPORT_SSL
#define MQTT_ENABLE_WS              CONFIG_MQTT_TRANSPORT_WEBSOCKET
#define MQTT_ENABLE_WSS             CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE
 
#define OUTBOX_EXPIRED_TIMEOUT_MS   (30*1000)
#define OUTBOX_MAX_SIZE             (4*1024)
#endif