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.
Dependencies: EthernetInterface_2 HTTPServer mbed-rpc_2 mbed-rtos mbed
Fork of EthHTTPServer by
Diff: main.cpp
- Revision:
- 5:c5c2f7026638
- Parent:
- 1:6cbd17e628f1
- Child:
- 6:d71683e80eb3
--- a/main.cpp Sat Aug 17 15:35:01 2013 +0000
+++ b/main.cpp Sat Aug 17 17:00:35 2013 +0000
@@ -2,6 +2,8 @@
#include "HTTPServer.h"
#include "FsHandler.h"
#include "LocalFileSystem.h"
+#include "RpcHandler.h"
+#include "mbed_rpc.h"
#define ALTERNATIVE
//#undef ALTERNATIVE
@@ -15,6 +17,7 @@
// Instantiate a local file system handler named 'local' which will be used later to access files on the mbed.
LocalFileSystem local("local");
+
#ifdef ALTERNATIVE
// Create the EthernetInterface. This is optional, please see the documentation of HTTP Server's start method.
EthernetInterface eth;
@@ -24,9 +27,11 @@
int main() {
pc.baud(460800);
+ RPC::add_rpc_class<RpcDigitalOut>();
HTTPFsRequestHandler::mount("/local/", "/");
svr.addHandler<HTTPFsRequestHandler>("/");
-
+ svr.addHandler<HTTPRpcRequestHandler>("/RPC");
+
#ifdef ALTERNATIVE
// Initialize the EthernetInterface and initiate a connection using DHCP.
eth.init();
