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
Revision 87:814e89e853a2, committed 2014-07-20
- Comitter:
- nyatla
- Date:
- Sun Jul 20 12:53:02 2014 +0000
- Parent:
- 86:a042fb18911b
- Child:
- 88:89598b2097fa
- Commit message:
- RpcPortIn/Out?unsignedInt?????; AnalogOut?????
Changed in this revision
--- a/mbed/jsonrpc/RpcAnalogOut.cpp Fri Jul 11 01:44:20 2014 +0000
+++ b/mbed/jsonrpc/RpcAnalogOut.cpp Sun Jul 20 12:53:02 2014 +0000
@@ -46,7 +46,7 @@
if(inst!=NULL){
unsigned int v;
if(getParamUInt(mod,i_rpc,v,1)){
- inst->write((unsigned int)v);
+ inst->write_u16((unsigned short)v);
mod->putResult(i_rpc->method.id);
}
}
--- a/mbed/jsonrpc/RpcPortIn.cpp Fri Jul 11 01:44:20 2014 +0000
+++ b/mbed/jsonrpc/RpcPortIn.cpp Sun Jul 20 12:53:02 2014 +0000
@@ -6,13 +6,13 @@
public:
static NyLPC_TBool new1(const union NyLPC_TJsonRpcParserResult* i_rpc,void* i_param)
{
- //ud
+ //uu
ModJsonRpc* mod=((ModJsonRpc::TcJsonRpcEx_t*)i_param)->cppmod_ptr;
unsigned int port;
- int mask;
+ unsigned int mask;
if(getParamUInt(mod,i_rpc,port,0)){
- if(getParamInt(mod,i_rpc,mask,1)){
- addNewObjectBatch(mod,i_rpc->method.id,new ModJsonRpc::RpcObject<PortIn>(new PortIn(portId2PortName(port),mask)));
+ if(getParamUInt(mod,i_rpc,mask,1)){
+ addNewObjectBatch(mod,i_rpc->method.id,new ModJsonRpc::RpcObject<PortIn>(new PortIn(portId2PortName(port),(int)mask)));
}
}
return NyLPC_TBool_TRUE;
@@ -33,7 +33,7 @@
const static struct NyLPC_TJsonRpcMethodDef func_table[]=
{
- { "_new1" ,"ud" ,PortInHandler::new1},
+ { "_new1" ,"uu" ,PortInHandler::new1},
{ "read" ,"d" ,PortInHandler::read},
{ NULL ,NULL ,NULL}
};
--- a/mbed/jsonrpc/RpcPortOut.cpp Fri Jul 11 01:44:20 2014 +0000
+++ b/mbed/jsonrpc/RpcPortOut.cpp Sun Jul 20 12:53:02 2014 +0000
@@ -6,13 +6,13 @@
public:
static NyLPC_TBool new1(const union NyLPC_TJsonRpcParserResult* i_rpc,void* i_param)
{
- //ud
+ //uu
ModJsonRpc* mod=((ModJsonRpc::TcJsonRpcEx_t*)i_param)->cppmod_ptr;
unsigned int port;
- int mask;
+ unsigned int mask;
if(getParamUInt(mod,i_rpc,port,0)){
- if(getParamInt(mod,i_rpc,mask,1)){
- addNewObjectBatch(mod,i_rpc->method.id,new ModJsonRpc::RpcObject<PortOut>(new PortOut(portId2PortName(port),mask)));
+ if(getParamUInt(mod,i_rpc,mask,1)){
+ addNewObjectBatch(mod,i_rpc->method.id,new ModJsonRpc::RpcObject<PortOut>(new PortOut(portId2PortName(port),(int)mask)));
}
}
return NyLPC_TBool_TRUE;
@@ -33,9 +33,9 @@
ModJsonRpc* mod=((ModJsonRpc::TcJsonRpcEx_t*)i_param)->cppmod_ptr;
PortOut* inst=(PortOut*)getObjectBatch(mod,i_rpc);
if(inst!=NULL){
- int v;
- if(getParamInt(mod,i_rpc,v,1)){
- inst->write(v);
+ unsigned int v;
+ if(getParamUInt(mod,i_rpc,v,1)){
+ inst->write((int)v);
mod->putResult(i_rpc->method.id);
}
}
@@ -47,9 +47,9 @@
const static struct NyLPC_TJsonRpcMethodDef func_table[]=
{
- { "_new1" ,"ud" ,PortOutHandler::new1},
+ { "_new1" ,"uu" ,PortOutHandler::new1},
{ "read" ,"d" ,PortOutHandler::read},
- { "write" ,"dd" ,PortOutHandler::write},
+ { "write" ,"du" ,PortOutHandler::write},
{ NULL ,NULL ,NULL}
};
