HTTP Server upon new mbed Ethernet Interface. Based on original code by Henry Leinen.
Dependencies: EthernetInterface mbed-rtos mbed
Fork of HTTP_server by
main.cpp
00001 00002 #include "mbed.h" 00003 #include "EthernetInterface.h" 00004 #include "HTTPServer.h" 00005 00006 LocalFileSystem local("local"); 00007 00008 DigitalOut led1(LED1); 00009 00010 void http_thread (void const* arg); // 00011 00012 int main() { 00013 00014 EthernetInterface eth; 00015 eth.init(); //Use DHCP 00016 eth.connect(); 00017 printf("IP Address is %s\n", eth.getIPAddress()); 00018 00019 Thread httpsvr( &http_thread ); 00020 00021 while (true) { 00022 00023 led1 = 1-led1; 00024 00025 Thread::wait (1000); 00026 00027 } 00028 00029 } 00030 00031 ////////////////////////////////////////////////////////////////////////////////////////////////////// 00032 // HTTP THREAD // 00033 ////////////////////////////////////////////////////////////////////////////////////////////////////// 00034 00035 void http_thread (void const* arg) { 00036 00037 HTTPServer svr (80, "/local/"); // esto incluye el init 00038 00039 // osThreadSetPriority( Thread::gettid() , osPriorityBelowNormal ); 00040 00041 while (1) { 00042 00043 svr.poll(); 00044 00045 } 00046 }
Generated on Thu Jul 14 2022 22:45:21 by 1.7.2