RPC over HTTP RPCfunction

20 May 2011

In my RPC over http program I have two RPCfunctions. Only the second one in order can be repeated the more than once. The first one hangs the mbed after the function is executed. The mbed needs a reset to restart.

//turn light on using PT2262 IC
void lamp(char * in, char * uit);
RPCFunction rpc_lamp(&lamp, "lamp");

//Open garage door
void open(char * input, char * output);
RPCFunction rpc_open(&open, "open");

When I swap both functions, the other function can be executed just once. So it seems to be an order problem.

Can you help me solve this problem?

21 May 2011

Hi Jasper

You could be running out of memory. I think buffers are allocated to call RPCFunction.

See if using the library AvailableMemory will help with your debugging:
http://mbed.org/users/segundo/programs/AvailableMemory_HelloWorld/ljrlpf

Also, which NetServices library are you using to start with? If you're not already using it, try segundo's which allocates memory in the AHBSRAM banks:
http://mbed.org/users/segundo/programs/NetServices_HelloWorld/ljh122

Note that the HelloWorld has an example with an RPCFunction call.

Regards
Daniel