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 /* Program Example 12.11 Remote Procedure Calls example 00002 */ 00003 #include "mbed.h" 00004 #include "EthernetNetIf.h" 00005 #include "HTTPServer.h" 00006 LocalFileSystem fs("webfs"); 00007 EthernetNetIf eth( 00008 IpAddr(192,168,0,101), //IP Address 00009 IpAddr(255,255,255,0), //Network Mask 00010 IpAddr(192,168,0,1), //Gateway 00011 IpAddr(192,168,0,1) //DNS 00012 ); 00013 HTTPServer svr; 00014 DigitalOut led1(LED1, "led1"); // define mbed object 00015 int main() { 00016 Base::add_rpc_class<DigitalOut>(); // RPC base command 00017 eth.setup(); // Ethernet setup 00018 FSHandler::mount("/webfs", "/"); // Mount /webfs path on root 00019 svr.addHandler<FSHandler>("/"); //Default handler 00020 svr.addHandler<RPCHandler>("/rpc"); // Define RPC handler 00021 svr.bind(80); 00022 while(1) 00023 { 00024 Net::poll(); 00025 } 00026 } 00027
Generated on Wed Aug 3 2022 04:39:06 by
1.7.2