-
Notifications
You must be signed in to change notification settings - Fork 3k
Introduce the lwip-interface into the core mbed repo #2231
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
Conversation
Responded to feedback from mbed-client implementation to introduce a full feature set that should support most of the use cases for the API.
The size was increased to 4 bytes. Thanks @c1728p9 for spotting this.
Move the backend of LWIPInterface from the LWIP socket API to the asynch UDP/TCP APIs used in https://github.com/armmbed/sal-stack-lwip. Provides asynchronous functionality for the LWIPInterface.
Pros - Simplifies interface - Easier base implementation Cons - May need shutdown functionality, in this case shutdown can be added as another function in the future
Pros - Easier to implement - More similar to SIGIO in BDS sockets Cons - Less information, but this information had a high risk of being faulty/spurious
- socket_create -> socket_open - socket_destroy -> socket_close
Adds the following functions for direct configuration of interface - (set|get)stackopt - (set|get)sockopt
NetworkInterface -> NetworkStack EthernetInterface -> EthernetStack WiFiInterface -> WiFiStack CellularInterface -> CellularStack MeshInterface -> MeshStack
Remove all the hal files in preparation for pulling in mbedmicro/mbed.
Sync the directory lwip-eth with that of mbedmicro/mbed at revision b32f7a9.
per the socket API documentation: /** Get the local IP address * * @return Null-terminated representation of the local IP address * or null if not yet connected */ virtual const char *get_ip_address() = 0; LWIPInterface incorrectly returned "\0" if unconnected
- Semaphore returns 0 on timeout, and negative was incorrect used for errors - Correctly checked error code on tcp_connect thanks to @LiyouZhou fixes ARMmbed#284, fixes ARMmbed#285, fixes ARMmbed#166
For very slow networks the previous default has be problematically short
Don't have GCC_ARM use GCC_CR's memory region in mem.c. This fixes some tests.
…plicate file names when exporting.
Refactor LWIPInterface so it is a NetworkInterface rather than a NetworkStack. Rename LWIPInterface to EthernetInterface since it is no longer a stack. Update tests to use this new name.
* NUCLEO_F746ZG : enable Ethernet and LwIP for this target. Net tests were passed : mbed-os-features-feature_ipv4-tests-mbedmicro-net-nist_internet_time_service | OK mbed-os-features-feature_ipv4-tests-mbedmicro-net-tcp_client_hello_world | OK The 2 other are failing because I cannot test them on my ST computer.
- lwip socket api did not provide signaling mechanism compatible with mutliple stacks - lwip raw api did not support multiple threads The netconn api provides the necessary signalling mechanism while still supporting multiple threads. The netconn api also shares several design similarities to the current socket api. Additionally, the move to a higher-level api reduced implementation complexity significantly and will hopefully reduce integration difficulties
- Renamed LWIPInterface to LWIPStack - Moved LWIPStack to static declaration - Removed hidden comments - Reduced lwip includes
Globally declared C++ classes with vtables are not gced by current toolchains, even if the C++ class contains no member variables and no constructor. This causes all of lwip to be dragged into resulting binaries, even if lwip is not accessed. Adoption of the SingletonPtr class in lwip allows us to workaround this issue.
- Removes problem with non-gced vtables - Moves some tedius operations up into the nsapi
@mbed-bot: TEST HOST_OSES=windows |
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
Outputmbed Build Number: 481 A build failure occurred! |
[Build ${MBED_BUILD_ID}] |
@mbed-bot: TEST HOST_OSES=windows |
/morph test |
I'm already seeing an issue with It boiled down to not having @geky Could these two includes be added to |
[Build 681] |
Result: FAILUREYour command has finished executing! Here's what you wrote!
Outputmbed Build Number: 484 A build failure occurred! |
@mbed-bot: TEST HOST_OSES=windows |
/morph test |
Ah yeah, thanks @c1728p9! |
[Build 684] |
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
Outputmbed Build Number: 487 A test failure occurred! |
LGTM 👍 Failures are know test execution failures. |
This patch introduces the network-socket API compatible lwip-interface into the core mbed repo.
dir
features/net/FEATURE_IPV4/lwip-interface
related #2216
cc @sg-, @c1728p9