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 libMiMic by
Diff: mbed/jsonrpc/RpcDigitalOut.cpp
- Revision:
- 76:b375b3d750d8
- Parent:
- 75:2a18df0ef111
- Child:
- 77:8651d3c19a55
--- a/mbed/jsonrpc/RpcDigitalOut.cpp Sat Jun 14 15:55:57 2014 +0000
+++ b/mbed/jsonrpc/RpcDigitalOut.cpp Sat Jun 14 17:42:11 2014 +0000
@@ -3,10 +3,12 @@
#include "mbed.h"
namespace MiMic
{
+
+
class RpcHandlerBase
{
public:
- static void addNewObjectBatch(ModJsonRpc& i_mod,unsigned int i_id,void* i_new_object)
+ static void addNewObjectBatch(ModJsonRpc& i_mod,unsigned int i_id,ModJsonRpc::BasicRpcObject* i_new_object)
{
int i=i_mod.addObject(i_new_object);
if(i<0){
@@ -37,7 +39,7 @@
if(!NyLPC_TJsonRpcParserResult_getUInt32(i_rpc,0,&pin)){
mod->putError(i_rpc->method.id,ModJsonRpc::INVALID_PARAMS);
}else{
- addNewObjectBatch(*mod,i_rpc->method.id,new DigitalOut(PinName(pin)));
+ addNewObjectBatch(*mod,i_rpc->method.id,new ModJsonRpc::RpcObject<DigitalOut>(new DigitalOut(MbedJsApi::pinId2PinName(pin))));
}
return NyLPC_TBool_TRUE;
}
@@ -52,7 +54,7 @@
{
mod->putError(i_rpc->method.id,ModJsonRpc::INVALID_PARAMS);
}else{
- addNewObjectBatch(*mod,i_rpc->method.id,new DigitalOut(PinName(pin),value));
+ addNewObjectBatch(*mod,i_rpc->method.id,new ModJsonRpc::RpcObject<DigitalOut>(new DigitalOut(MbedJsApi::pinId2PinName(pin),value)));
}
return NyLPC_TBool_TRUE;
}
