A demonstration of RPC object instantiation.

Dependencies:   mbed-rpc mbed

Fork of RPC_DigitalInDigitalOutPWMOutoverSerial by David Cabinian

Revision:
5:59421f613a13
Parent:
4:d69dfbef9644
--- 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);