Skip to content

lwip: Add a configuration option to enable the lwip socket API. #2872

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions features/FEATURE_LWIP/lwip-interface/lwipopts.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,12 @@

#define LWIP_DHCP LWIP_IPV4
#define LWIP_DNS 1

#if MBED_CONF_LWIP_SOCKET_API
#define LWIP_SOCKET 1
#else
#define LWIP_SOCKET 0
#endif

#define SO_REUSE 1

Expand All @@ -126,7 +131,9 @@
#define LWIP_IGMP LWIP_IPV4
#define LWIP_RAND() rand()

#ifndef LWIP_COMPAT_SOCKETS
#define LWIP_COMPAT_SOCKETS 0
#endif
#define LWIP_POSIX_SOCKETS_IO_NAMES 0
#define LWIP_SO_RCVTIMEO 1
#define LWIP_TCP_KEEPALIVE 1
Expand Down
4 changes: 4 additions & 0 deletions features/FEATURE_LWIP/lwip-interface/mbed_lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
"addr-timeout": {
"help": "On dual stack system how long to wait preferred stack's address in seconds",
"value": 5
},
"socket-api": {
"help": "Enable the lwip socket API (see lwip/sockets.h) e.g. to aid porting of existing code. You may also want to \"#define LWIP_COMPAT_SOCKETS 1\" in code using the API.",
"value": false
}
}
}