Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 #include "mbed.h" 00002 #include "ESP32Interface.h" 00003 #include "TCPSocket.h" 00004 00005 ESP32Interface wifi(P5_3, P3_14, P7_1, P0_1); 00006 00007 int main() { 00008 printf("NetworkSocketAPI Example\r\n"); 00009 00010 wifi.connect("ssid", "password"); 00011 printf("IP address: %s\r\n", wifi.get_ip_address()); 00012 printf("MAC address: %s\r\n", wifi.get_mac_address()); 00013 00014 TCPSocket socket(&wifi); 00015 socket.connect("4.ifcfg.me", 23); 00016 00017 char buffer[64]; 00018 int count = socket.recv(buffer, sizeof(buffer)); 00019 printf("public IP address is: %.15s\r\n", &buffer[15]); 00020 00021 socket.close(); 00022 wifi.disconnect(); 00023 00024 printf("Done\r\n"); 00025 }
Generated on Fri Jul 15 2022 09:50:28 by
1.7.2