Hi
RPCVariables will work over http.
To use RPCVariable you don't need to include SerialRPCInterface.h but you do need to include "RPCVariable.h". (You need to make sure you are using the newest version of the Library as there was a bug which meant that you did have to include the SerialRPCInterface header to use RPCVariable but that was fixed ages ago.)
Using RPCVariables by including SerialRPCInterface.h rather than RPCVariable.h doesn't mean that they won't work with HTTP, it just means that you've also defined the SerialRPCInterface Class as the SerialRPCInterface.h file includes RPCVariable.h for you. However unless you create an instance of SerialRPCInterface eg with the line
SerialRPCInterface SerialInterface(USBTX, USBRX);
Then it won't do anything over serial and RPCVariables will work over http.
Incidently you could even set it up so RPC commands were received over both serial and HTTP, you'd need to set up the mbed with both the HTTP server and looking for RPC commands over serial.
The RPCVariables (and any other objects controlled using RPC) are completely independant to the method of exchanging the RPC commands, they register with the RPC functionality defined in the mbed libraries. The HTTPServer and the SerialRPCInterface class both just provide different methods of passing the string of rpc commands into the rpc function and returning the response.
The absolute simplest way of doing this with a serial port is shown on the Interfacing Using RPC page, its just:
while(1){
pc.gets(buf, 256);
rpc(buf, outbuf);
pc.printf("%s\n", outbuf);
}
The SerialRPCInterface class does the above but using the serial interrupt rather than a while loop.
So in summary RPCVariables (and RPCFunctions) will work over HTTP, you can either include "SerialRPCInterface.h" or "RPCVariable.h"
Hope this helps.
Michael
RPCVariable is not a template (E864) ???????
What am I doing wrong or is RPCVariable not working at all? Please have a look at my compiler output.
/media/uploads/microfreak/bildschirmfoto_2011-04-10_um_11.08.15.jpg