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 HTTPServer mbed-rpc mbed-rtos mbed
Revision 5:c5c2f7026638, committed 2013-08-17
- Comitter:
- leihen
- Date:
- Sat Aug 17 17:00:35 2013 +0000
- Parent:
- 4:fdd7369eeebe
- Commit message:
- Added RPC functionality to sample application.
Changed in this revision
| HTTPServer.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/HTTPServer.lib Sat Aug 17 15:35:01 2013 +0000 +++ b/HTTPServer.lib Sat Aug 17 17:00:35 2013 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/leihen/code/HTTPServer/#909dcf44c3db +http://mbed.org/users/leihen/code/HTTPServer/#cc3f5c53d0d5
--- 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();