Closed yanzixiang closed 3 years ago
Thanks @yanzixiang for your contribution.
My suggestion is to put the hook implementation into the port directory. E.g.
eth_unknow_type_callback()
, register_eth_unknow_type_callback()
...We need to minimize ESP-specific modifications in LWIP submodule.
Thanks @yanzixiang for your contribution.
My suggestion is to put the hook implementation into the port directory. E.g.
- Put HOOKS.h to $IDF_PATH/components/lwip/port/esp32/include/netif
- Add HOOKS.c to $IDF_PATH/components/lwip/port/esp32/netif/HOOKS.c and put
eth_unknow_type_callback()
,register_eth_unknow_type_callback()
...We need to minimize ESP-specific modifications in LWIP submodule.
So I shold gen a Pull Request at esp-idf instead of esp-lwip ?
@yanzixiang I agree with @liuzfesp that the hooks shall be defined in specific port layer.
Now (in IDF v4.3
), we have good a place in IDF, where we could put default lwip hooks:
https://github.com/espressif/esp-idf/blob/master/components/lwip/port/esp32/include/lwip_default_hooks.h
Closing this, as the hooks don't really fit into esp-lwip
repository. Please don't hesitate to post a PR to IDF repository!
https://github.com/espressif/esp-idf/issues/3526
Wonder If this is the right way, Maybe useful for someone else.
I use https://github.com/espressif/arduino-esp32 , to test this, replace netif.h and liblwip.a after using esp-idf to complie the example, esp-idf/examples/ethernet/ethernet.
IN
The num is the netif num, 0 for Wifi (Maybe) 1 For Eth (I Use this)