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 "HTTPServer.h" 00003 #include "HTTPStaticPage.h" 00004 00005 #include <string.h> 00006 00007 const char content[] = "<HTML><BODY><H1>Hello World</H1></BODY></HTML>"; 00008 00009 HTTPServer http; 00010 00011 int main(void) { 00012 http.addHandler(new HTTPStaticPage("/index.htm", content, strlen(content))); 00013 http.bind(); 00014 NetServer *net = NetServer::get(); 00015 printf("%hhu.%hhu.%hhu.%hhu\n", (net->getIPAddr().addr)&0xFF, (net->getIPAddr().addr>>8)&0xFF, (net->getIPAddr().addr>>16)&0xFF, (net->getIPAddr().addr>>24)&0xFF); 00016 while(1) { 00017 http.poll(); 00018 } 00019 }
Generated on Mon Jul 18 2022 16:48:51 by
1.7.2