Remote Procedure Call (RPC) over Websockets (uses MbedJSONValue)

Dependents:   RPC_mbed_client RPC_Wifly_HelloWorld RPC_Ethernet_HelloWorld

Revision:
7:067cb01b491e
Parent:
2:af408b5cae75
--- a/MbedJSONRpc.cpp	Mon Oct 03 08:40:53 2011 +0000
+++ b/MbedJSONRpc.cpp	Thu Aug 23 14:23:37 2012 +0000
@@ -10,7 +10,7 @@
 
 
     sprintf(json, (const char *)MSG_CALL, my_id, dest, id, fn, str.c_str());
-    webs->Send(json);
+    webs->send(json);
     t = waitAnswer(tmp, id, json);
     if (t != CALL_OK)
         return t;
@@ -61,7 +61,7 @@
     int id = rand() % 100;
 
     sprintf(json, (const char *)MSG_INFO_METHODS, my_id, dest, id);
-    webs->Send(json);
+    webs->send(json);
     waitAnswer(tmp, id, json);
     printf("methods available on %s: ", dest);
     for (int i = 0; i < tmp.size() - 1; i++) {
@@ -115,7 +115,7 @@
     RPC_TYPE t;
 
     sprintf(json, (const char *)MSG_REGISTER, my_id, id, public_name);
-    webs->Send(json);
+    webs->send(json);
     t = waitAnswer(tmp, id, json);
     if (t != REGISTER_OK)
         return t;
@@ -145,14 +145,14 @@
                     obj[i]->execute(v["params"], r);
                     sprintf(json_recv, (const char *)MSG_RESULT, my_id,
                             v["from"].get<std::string>().c_str(), v["id_msg"].get<int>(), r.serialize().c_str());
-                    webs->Send(json_recv);
+                    webs->send(json_recv);
                     
                 } else if ((i = procAlreadyRegistered((char *)s.c_str())) != -1) {
                 
                     proc[i](v["params"], r);
                     sprintf(json_recv, (const char *)MSG_RESULT, my_id,
                             v["from"].get<std::string>().c_str(), v["id_msg"].get<int>(), r.serialize().c_str());
-                    webs->Send(json_recv);
+                    webs->send(json_recv);
                     
                 }
             }