Skip to content

Commit

Permalink
Fix compile issues with LWIP_SINGLE_NETIF
Browse files Browse the repository at this point in the history
  • Loading branch information
peterharperuk committed Aug 16, 2024
1 parent 7fe60d6 commit e927d07
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pico_w/bt/picow_bt_example_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void picow_bt_example_main(void) {
} else {
printf("Connected in %lus.\n", (to_ms_since_boot(get_absolute_time()) - start_ms) / 1000);
}
printf("\nReady, running iperf server at %s\n", ip4addr_ntoa(netif_ip4_addr(netif_list)));
printf("\nReady, running iperf server at %s\n", ip4addr_ntoa(netif_ip4_addr(netif_default)));
lwiperf_start_tcp_server_default(&iperf_report, NULL);
#endif
}
2 changes: 1 addition & 1 deletion pico_w/bt/standalone/server_with_wifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ int main() {

// setup iperf
cyw43_arch_lwip_begin();
printf("\nReady, running iperf server at %s\n", ip4addr_ntoa(netif_ip4_addr(netif_list)));
printf("\nReady, running iperf server at %s\n", ip4addr_ntoa(netif_ip4_addr(netif_default)));
lwiperf_start_tcp_server_default(&iperf_report, NULL);
cyw43_arch_lwip_end();

Expand Down
2 changes: 1 addition & 1 deletion pico_w/wifi/freertos/httpd/pico_freertos_httpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void main_task(__unused void *params) {
#endif
#endif

printf("\nReady, running httpd at %s\n", ip4addr_ntoa(netif_ip4_addr(netif_list)));
printf("\nReady, running httpd at %s\n", ip4addr_ntoa(netif_ip4_addr(netif_default)));
httpd_init();

http_set_cgi_handlers(cgi_handlers, LWIP_ARRAYSIZE(cgi_handlers));
Expand Down
2 changes: 1 addition & 1 deletion pico_w/wifi/freertos/iperf/picow_freertos_iperf.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void main_task(__unused void *params) {
ip4_addr_set_u32(&clientaddr, ipaddr_addr(xstr(IPERF_SERVER_IP)));
assert(lwiperf_start_tcp_client_default(&clientaddr, &iperf_report, NULL) != NULL);
#else
printf("\nReady, running iperf server at %s\n", ip4addr_ntoa(netif_ip4_addr(netif_list)));
printf("\nReady, running iperf server at %s\n", ip4addr_ntoa(netif_ip4_addr(netif_default)));
lwiperf_start_tcp_server_default(&iperf_report, NULL);
#endif
cyw43_arch_lwip_end();
Expand Down
2 changes: 1 addition & 1 deletion pico_w/wifi/httpd/pico_httpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ int main() {
} else {
printf("Connected.\n");
}
printf("\nReady, running httpd at %s\n", ip4addr_ntoa(netif_ip4_addr(netif_list)));
printf("\nReady, running httpd at %s\n", ip4addr_ntoa(netif_ip4_addr(netif_default)));

// start http server
wifi_connected_time = get_absolute_time();
Expand Down
2 changes: 1 addition & 1 deletion pico_w/wifi/iperf/picow_iperf.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ int main() {
ip4_addr_set_u32(&clientaddr, ipaddr_addr(xstr(IPERF_SERVER_IP)));
assert(lwiperf_start_tcp_client_default(&clientaddr, &iperf_report, NULL) != NULL);
#else
printf("\nReady, running iperf server at %s\n", ip4addr_ntoa(netif_ip4_addr(netif_list)));
printf("\nReady, running iperf server at %s\n", ip4addr_ntoa(netif_ip4_addr(netif_default)));
lwiperf_start_tcp_server_default(&iperf_report, NULL);
#endif
cyw43_arch_lwip_end();
Expand Down
1 change: 1 addition & 0 deletions pico_w/wifi/lwipopts_examples_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#define LWIP_NETIF_TX_SINGLE_PBUF 1
#define DHCP_DOES_ARP_CHECK 0
#define LWIP_DHCP_DOES_ACD_CHECK 0
#define LWIP_SINGLE_NETIF 1

#ifndef NDEBUG
#define LWIP_DEBUG 1
Expand Down
2 changes: 1 addition & 1 deletion pico_w/wifi/tcp_server/picow_tcp_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static err_t tcp_server_accept(void *arg, struct tcp_pcb *client_pcb, err_t err)

static bool tcp_server_open(void *arg) {
TCP_SERVER_T *state = (TCP_SERVER_T*)arg;
DEBUG_printf("Starting server at %s on port %u\n", ip4addr_ntoa(netif_ip4_addr(netif_list)), TCP_PORT);
DEBUG_printf("Starting server at %s on port %u\n", ip4addr_ntoa(netif_ip4_addr(netif_default)), TCP_PORT);

struct tcp_pcb *pcb = tcp_new_ip_type(IPADDR_TYPE_ANY);
if (!pcb) {
Expand Down

0 comments on commit e927d07

Please sign in to comment.