So you have a perfectly working Ethernet host and you want WiFi. So you plan to use another lwIP host as a module. What I would do is to delegate the netif to the module, so basically the netif running in the host will take care of delivering via the UART and receiving from the UART. However, you have to consider memory and the fact that now your netif on the send side works in an asynchronous mode: when the send function returns, data has not been sent, so you have to either copy data to your send buffer and free or reference the pbuf and free it when it's done. Plus, you will probably need to queue somewhere and pace your application so it does not send more than what the UART can carry. On the receiving side, you put in a pbuf what you get from the UART, and deliver to lwIP.
On the module... you collect from the UART, put in a pbuf, and send to the netif. When the netif has data, it will deliver to lwIP, so you will get it from there, in a pbuf, so you wait until the UART sends it to the host, and you free the pbuf (or you copy it to the send buffer and free it immediately). Plus, you will probably need to queue somewhere, as you will surely get more than what can be sent to the host via the UART. So, basically, you need a netif on the host and "an lwIP" on the module. A netif is a driver, and it depends entirely on what you do. There is a skeleton you can modify for your needs, and by checking other drivers you will get it in a short time. Search the net as there are a number of drivers to learn from, I did. Bear in mind that Espressif likes to modify lwIP with their own proprietary changes and we don't know what to expect. I guess the netifs have not been changed, but I don't really know. _______________________________________________ lwip-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/lwip-users
