Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
lwipopts.h
00001 #ifndef LWIPOPTS_H 00002 #define LWIPOPTS_H 00003 00004 #include <string.h> 00005 #include <stdlib.h> 00006 //#include <mbed.h> 00007 #include <stdio.h> 00008 00009 #ifdef __cplusplus 00010 using namespace std; 00011 #endif 00012 00013 // Application specific lwIP Options. 00014 #define IPv6 0 00015 #define NO_SYS 1 00016 #define LWIP_ARP 1 00017 #define LWIP_RAW 0 00018 #define LWIP_UDP 1 00019 #define LWIP_TCP 1 00020 #define LWIP_DNS 1 00021 #define LWIP_DHCP 1 00022 #define LWIP_IGMP 0 00023 #define LWIP_SNMP 0 00024 #define LWIP_SOCKET 0 00025 #define LWIP_NETCONN 0 00026 #define LWIP_AUTOIP 0 00027 #define LWIP_CALLBACK_API 1 00028 00029 #define MEM_LIBC_MALLOC 0 00030 #define MEMP_MEM_MALLOC 1 00031 #define MEM_ALIGNMENT 4 00032 //#define MEM_SIZE 5000 00033 #define MEM_SIZE 10000 00034 //#define MEM_SIZE (EMAC_MEM_SIZE - (2 * SIZEOF_STRUCT_MEM) - MEM_ALIGNMENT) 00035 #define MEM_POSITION __attribute((section("AHBSRAM1"),aligned)) 00036 // EMAC_MEM_ADDR 00037 00038 #define ARP_QUEUEING 0 00039 #define LWIP_NETIF_HOSTNAME 1 00040 00041 #define ARP_TABLE_SIZE 4 00042 00043 #define DNS_TABLE_SIZE 1 00044 #define DNS_USES_STATIC_BUF 0 00045 // 0 - Stack 00046 // 1 - RW-MEM 00047 // 2 - Heap 00048 00049 #define IP_FRAG_USES_STATIC_BUF 0 00050 #define LWIP_STATS 0 00051 00052 #define DNS_LOCAL_HOSTLIST_IS_DYNAMIC 1 00053 00054 #define TCP_SND_BUF 2000 00055 #define TCP_MSS 0x276 00056 //0x300 00057 //#define TCP_SND_QUEUELEN (2 * TCP_SND_BUF/TCP_MSS) 00058 #define TCP_SND_QUEUELEN 16 00059 #define MEMP_NUM_TCP_PCB 5 00060 #define MEMP_NUM_TCP_PCB_LISTEN 8 00061 #define MEMP_NUM_TCP_SEG 20 00062 #define MEMP_NUM_PBUF 16 00063 #define PBUF_POOL_SIZE 6 00064 00065 #ifndef HOSTNAME 00066 #define HOSTNAME "mbed-c3p0" 00067 #endif 00068 00069 //#define LWIP_DEBUG 1 00070 //#define LWIP_DBG_TYPES_ON ~0x0 00071 //#define LWIP_DBG_MIN_LEVEL 0 00072 //#define MEM_DEBUG (LWIP_DBG_ON | LWIP_DBG_LEVEL_WARNING) 00073 //#define TCP_INPUT_DEBUG (LWIP_DBG_ON | LWIP_DBG_LEVEL_WARNING) 00074 //#define TCP_OUTPUT_DEBUG (LWIP_DBG_ON | LWIP_DBG_LEVEL_WARNING) 00075 //#define NETIF_DEBUG (LWIP_DBG_ON | LWIP_DBG_LEVEL_WARNING) 00076 //#define DHCP_DEBUG (LWIP_DBG_ON | LWIP_DBG_LEVEL_WARNING) 00077 //#define IP_DEBUG (LWIP_DBG_ON | LWIP_DBG_LEVEL_WARNING) 00078 //#define TCP_DEBUG (LWIP_DBG_ON | LWIP_DBG_LEVEL_WARNING) 00079 //#define TCP_CWND_DEBUG (LWIP_DBG_ON | LWIP_DBG_LEVEL_WARNING) 00080 00081 //------------------------------------------------------------------------------ 00082 // [iva2k] Defines for LWIP/sntp, using SNTPClient wrapper 00083 00084 #ifdef __cplusplus 00085 extern "C" { 00086 #endif 00087 00088 #include <time.h> 00089 extern unsigned int gSntpRecvTimeout_s; 00090 extern unsigned int gSntpUpdateDelay_s; // Never set this below 15 00091 void SntpClientSet(time_t sec); // Receives NTP timestamp 00092 00093 #ifdef __cplusplus 00094 }; 00095 #endif 00096 00097 // Do not change these: 00098 #define SNTP_SOCKET 0 00099 #define SNTP_DEBUG LWIP_DBG_OFF 00100 #define SNTP_PORT 123 00101 #define SNTP_SERVER_DNS 1 // Override. Use URLs. Do not use IP addresses! 00102 #define SNTP_SUPPORT_MULTIPLE_SERVERS 1 // Override. Allow multiple servers. 00103 #define SNTP_SET_SYSTEM_TIME(sec) SntpClientSet(sec) 00104 /** SNTP macro to get system time, used with SNTP_CHECK_RESPONSE >= 2 00105 * to send in request and compare in response. 00106 */ 00107 #define SNTP_GET_SYSTEM_TIME(sec, us) do { (sec) = 0; (us) = 0; } while(0) 00108 #define SNTP_RECV_TIMEOUT gSntpRecvTimeout_s 00109 #define SNTP_UPDATE_DELAY gSntpUpdateDelay_s 00110 #define SNTP_SUPPRESS_DELAY_CHECK 1 // needed to substitute define with global 00111 00112 // You can change these: 00113 #define SNTP_SERVER_ADDRESS \ 00114 "pool.ntp.org", \ 00115 "north-america.pool.ntp.org", \ 00116 "time-a.nist.gov", \ 00117 "time-b.nist.gov", \ 00118 // comma-separated list of server URLs 00119 #define SNTP_CHECK_RESPONSE 2 // For now use more checks. Do not set above 2. 00120 #define SNTP_STARTUP_DELAY 0 // seconds, Should be randomized 00121 00122 // END [iva2k] Defines for LWIP/sntp, using SNTPClient wrapper 00123 //------------------------------------------------------------------------------ 00124 00125 #endif
Generated on Tue Jul 12 2022 20:39:37 by
1.7.2