Chris Styles
/
WorkingHTTPServer
HTTP Server based on Rolf Meyers work
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 #include "HTTPServer.h" 00003 #include "HTTPRPC.h" 00004 #include "HTTPFS.h" 00005 00006 HTTPServer http; 00007 DigitalOut led1(LED1, "led1"); 00008 DigitalOut led2(LED2, "led2"); 00009 DigitalOut led3(LED3, "led3"); 00010 DigitalOut led4(LED4, "led4"); 00011 LocalFileSystem local("local"); 00012 00013 int main(void) { 00014 Base::add_rpc_class<AnalogIn>(); 00015 Base::add_rpc_class<AnalogOut>(); 00016 Base::add_rpc_class<DigitalIn>(); 00017 Base::add_rpc_class<DigitalOut>(); 00018 Base::add_rpc_class<PwmOut>(); 00019 Base::add_rpc_class<Timer>(); 00020 Base::add_rpc_class<SPI>(); 00021 Base::add_rpc_class<BusOut>(); 00022 Base::add_rpc_class<BusIn>(); 00023 00024 http.addHandler(new HTTPRPC()); 00025 http.addHandler(new HTTPFileSystemHandler("/", "/local/")); 00026 http.bind(); 00027 00028 while(1) { 00029 http.poll(); 00030 } 00031 } 00032
Generated on Wed Jul 27 2022 20:15:13 by 1.7.2