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.
Fork of RPC_Serial by
Diff: main.cpp
- Revision:
- 5:59421f613a13
- Parent:
- 4:d69dfbef9644
- Child:
- 6:cb40d6349b96
diff -r d69dfbef9644 -r 59421f613a13 main.cpp
--- a/main.cpp Sat Mar 12 02:30:33 2016 +0000
+++ b/main.cpp Tue Mar 15 04:28:17 2016 +0000
@@ -3,19 +3,17 @@
/**
* This example program has been updated to use the RPC implementation in the new mbed libraries.
- * This example demonstrates using RPC over serial with DigitalOut, DigitalIn, and PWMOut usages
+ * This example shows the creation of the RPCDigitalOut wrapper class over the RPC interface
*/
//Use the RPC enabled wrapped class - see RpcClasses.h for more info
-RpcDigitalOut myled(LED4,"mbedled");
-RpcDigitalIn swIn(p8, "switchIn");
-RpcPwmOut led(p21, "pwmled");
-
+RpcDigitalOut led1(LED1,"led1");
Serial pc(USBTX, USBRX);
+
int main() {
- //The mbed RPC classes are now wrapped to create an RPC enabled version - see RpcClasses.h so don't add to base class
-
- // receive commands, and send back the responses
+ //Allows RPC to create objects of type RPCDigitalOut via the RPC Interface
+ RPC::add_rpc_class<RpcDigitalOut>();
+
char buf[256], outbuf[256];
while(1) {
pc.gets(buf, 256);
