A demonstration of RPC object instantiation.

Dependencies:   mbed-rpc mbed

Fork of RPC_DigitalInDigitalOutPWMOutoverSerial by David Cabinian

Files at this revision

API Documentation at this revision

Comitter:
dhcabinian
Date:
Tue Mar 15 04:28:17 2016 +0000
Parent:
4:d69dfbef9644
Commit message:
First iteration of the RPC Instantiation over the RPC interface using the new RPC Library

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- 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);