AtomVM icon indicating copy to clipboard operation
AtomVM copied to clipboard

tcpip_adapter interfaces are depreciated in ESP-IDF v4.1 and later and should be replaced by esp_netif

Open UncleGrumpy opened this issue 3 years ago • 0 comments

When compiling for ESP32 after version 4.1.x there are compiler warning about tcpip_adapter depreciation, all versions have output similar to the following:

CC build/main/network_driver.o
In file included from /home/winford/github/UncleGrumpy/AtomVM/src/platforms/esp32/main/network_driver.c:40:
/home/winford/esp/esp-idf-v4.1.2/components/esp_event/include/esp_event_loop.h:2:2: warning: #warning "esp_event_loop.h is deprecated, please include esp_event.h instead" [-Wcpp]
 #warning "esp_event_loop.h is deprecated, please include esp_event.h instead"
 ^~~~~~~
In file included from /home/winford/github/UncleGrumpy/AtomVM/src/platforms/esp32/main/network_driver.c:43:
/home/winford/esp/esp-idf-v4.1.2/components/tcpip_adapter/include/tcpip_adapter.h:15:2: warning: #warning "This header is deprecated, please use new network related API in esp_netif.h" [-Wcpp]
 #warning "This header is deprecated, please use new network related API in esp_netif.h"
 ^~~~~~~

...
 different unrelated error also appears compiling this file...
...

/home/winford/github/UncleGrumpy/AtomVM/src/platforms/esp32/main/network_driver.c: In function 'wifi_event_handler':
/home/winford/github/UncleGrumpy/AtomVM/src/platforms/esp32/main/network_driver.c:561:31: warning: passing argument 2 of 'send_got_ip' from incompatible pointer type [-Wincompatible-pointer-types]
    send_got_ip(data, &event->event_info.got_ip.ip_info);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/winford/github/UncleGrumpy/AtomVM/src/platforms/esp32/main/network_driver.c:483:68: note: expected 'tcpip_adapter_ip_info_t *' {aka 'struct <anonymous> *'} but argument is of type 'esp_netif_ip_info_t *' {aka 'struct <anonymous> *'}
 static void send_got_ip(ClientData *data, tcpip_adapter_ip_info_t *info)
                                           ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/home/winford/github/UncleGrumpy/AtomVM/src/platforms/esp32/main/network_driver.c: In function 'network_driver_init':
/home/winford/github/UncleGrumpy/AtomVM/src/platforms/esp32/main/network_driver.c:607:5: warning: 'tcpip_adapter_init' is deprecated [-Wdeprecated-declarations]
    tcpip_adapter_init();
    ^~~~~~~~~~~~~~~~~~
In file included from /home/winford/esp/esp-idf-v4.1.2/components/esp_netif/include/esp_netif.h:35,
from /home/winford/esp/esp-idf-v4.1.2/components/esp_event/include/esp_event_legacy.h:22,
from /home/winford/esp/esp-idf-v4.1.2/components/esp_event/include/esp_event.h:26,
from /home/winford/esp/esp-idf-v4.1.2/components/esp_event/include/esp_event_loop.h:3,
from /home/winford/github/UncleGrumpy/AtomVM/src/platforms/esp32/main/network_driver.c:40:
/home/winford/esp/esp-idf-v4.1.2/components/tcpip_adapter/include/tcpip_adapter.h:34:6: note: declared here
 void tcpip_adapter_init(void)  __attribute__ ((deprecated));
 ^~~~~~~~~~~~~~~~~~
At top level:
/home/winford/github/UncleGrumpy/AtomVM/src/platforms/esp32/main/network_driver.c:539:13: warning: 'send_ap_sta_ip_acquired' defined but not used [-Wunused-function]
 static void send_ap_sta_ip_acquired(ClientData *data, ip4_addr_t *ip)
             ^~~~~~~~~~~~~~~~~~~~~~~
...
...

CC build/main/socket_driver.o
In file included from /home/winford/github/UncleGrumpy/AtomVM/src/platforms/esp32/main/socket_driver.c:46:
/home/winford/esp/esp-idf-v4.1.2/components/tcpip_adapter/include/tcpip_adapter.h:15:2: warning: #warning "This header is deprecated, please use new network related API in esp_netif.h" [-Wcpp]
 #warning "This header is deprecated, please use new network related API in esp_netif.h"
 ^~~~~~~

UncleGrumpy avatar Apr 19 '22 04:04 UncleGrumpy