9
9
* <h2><center>© Copyright (c) 2017 STMicroelectronics International N.V.
10
10
* All rights reserved.</center></h2>
11
11
*
12
- * Redistribution and use in source and binary forms, with or without
13
- * modification, are permitted, provided that the following conditions are met:
14
- *
15
- * 1. Redistribution of source code must retain the above copyright notice,
16
- * this list of conditions and the following disclaimer.
17
- * 2. Redistributions in binary form must reproduce the above copyright notice,
18
- * this list of conditions and the following disclaimer in the documentation
19
- * and/or other materials provided with the distribution.
20
- * 3. Neither the name of STMicroelectronics nor the names of other
21
- * contributors to this software may be used to endorse or promote products
22
- * derived from this software without specific written permission.
23
- * 4. This software, including modifications and/or derivative works of this
24
- * software, must execute solely and exclusively on microcontroller or
25
- * microprocessor devices manufactured by or for STMicroelectronics.
26
- * 5. Redistribution and use of this software other than as permitted under
27
- * this license is void and will automatically terminate your rights under
28
- * this license.
29
- *
30
- * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
31
- * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
32
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
33
- * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
34
- * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
35
- * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
36
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
37
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
38
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
39
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
40
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
41
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12
+ * This software component is licensed by ST under Ultimate Liberty license
13
+ * SLA0044, the "License"; You may not use this file except in compliance with
14
+ * the License. You may obtain a copy of the License at:
15
+ * www.st.com/SLA0044
42
16
*
43
17
******************************************************************************
44
18
*/
58
32
*/
59
33
#define SYS_LIGHTWEIGHT_PROT 0
60
34
35
+ #define LWIP_NOASSERT
36
+
61
37
/* ---------- Memory options ---------- */
62
38
/* MEM_ALIGNMENT: should be set to the alignment of the CPU for which
63
39
lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2
@@ -100,9 +76,13 @@ a lot of data that needs to be copied, this should be set high. */
100
76
/* ---------- TCP options ---------- */
101
77
#define LWIP_TCP 1
102
78
#define TCP_TTL 255
79
+ #define LWIP_SO_RCVTIMEO 1
80
+ #define LWIP_SO_RCVRCVTIMEO_NONSTANDARD 1 /* Pass an integer number of ms instead of a timeval struct. */
81
+ #define LWIP_SO_SNDTIMEO 1
82
+ #define LWIP_SO_SNDRCVTIMEO_NONSTANDARD 1 /* Pass an integer number of ms instead of a timeval struct. */
103
83
104
84
/* Controls if TCP should queue segments that arrive out of
105
- order. Define to 0 if your device is low on memory. */
85
+ order. Define to 0 if your device is low on memory and you are not scared by TCP congestion and latencies . */
106
86
#define TCP_QUEUE_OOSEQ 0
107
87
108
88
/* TCP Maximum segment size. */
@@ -117,19 +97,25 @@ a lot of data that needs to be copied, this should be set high. */
117
97
#define TCP_SND_QUEUELEN (2* TCP_SND_BUF/TCP_MSS)
118
98
119
99
/* TCP receive window. */
120
- #define TCP_WND (2*TCP_MSS)
100
+ #define TCP_WND (3*TCP_MSS)
101
+
102
+ #define LWIP_TCP_KEEPALIVE 1 /* Keep the TCP link active. Important for MQTT/TLS */
103
+ #define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS 1 /* Prevent the same port to be used after reset.
104
+ Otherwise, the remote host may be confused if the port was not explicitly closed before the reset. */
121
105
122
106
123
107
/* ---------- ICMP options ---------- */
124
108
#define LWIP_ICMP 1
109
+ #define LWIP_RAW 1 /* PING changed to 1 */
110
+ #define DEFAULT_RAW_RECVMBOX_SIZE 3 /* for ICMP PING */
125
111
126
112
127
113
/* ---------- DHCP options ---------- */
114
+ /* Define LWIP_DHCP to 1 if you want DHCP configuration of
115
+ interfaces. DHCP is not implemented in lwIP 0.5.1, however, so
116
+ turning this on does currently not work. */
128
117
#define LWIP_DHCP 1
129
118
130
- /* ---------- DNS options ---------- */
131
- #define LWIP_DNS 1
132
-
133
119
134
120
/* ---------- UDP options ---------- */
135
121
#define LWIP_UDP 1
@@ -138,12 +124,17 @@ a lot of data that needs to be copied, this should be set high. */
138
124
139
125
/* ---------- Statistics options ---------- */
140
126
#define LWIP_STATS 0
127
+ #define LWIP_PROVIDE_ERRNO
141
128
142
129
/* ---------- link callback options ---------- */
143
130
/* LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface
144
131
* whenever the link changes (i.e., link down)
145
132
*/
133
+ // need for building net_ip.c
134
+ #define LWIP_NETIF_HOSTNAME 1
135
+ #define LWIP_NETIF_STATUS_CALLBACK 1
146
136
#define LWIP_NETIF_LINK_CALLBACK 1
137
+ #define LWIP_DHCP_CHECK_LINK_UP 1
147
138
148
139
/*
149
140
--------------------------------------
@@ -211,6 +202,7 @@ The STM32F4x7 allows computing and verifying the IP, UDP, TCP and ICMP checksums
211
202
* LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)
212
203
*/
213
204
#define LWIP_SOCKET 0
205
+ #define LWIP_DNS 1
214
206
215
207
/*
216
208
------------------------------------
0 commit comments