Skip to content

Commit

Permalink
Print IP address after connecting to the network
Browse files Browse the repository at this point in the history
  • Loading branch information
mrozycki authored and krzmaz committed Oct 15, 2022
1 parent d74782c commit 883b1b6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ int main() {
return 1;
} else {
printf("Connected.\n");

extern cyw43_t cyw43_state;
auto ip_addr = cyw43_state.netif[CYW43_ITF_STA].ip_addr.addr;
printf("IP Address: %lu.%lu.%lu.%lu\n", ip_addr & 0xFF, (ip_addr >> 8) & 0xFF, (ip_addr >> 16) & 0xFF, ip_addr >> 24);
}

run_server();
Expand Down

0 comments on commit 883b1b6

Please sign in to comment.