Ok I have the HTTP server and RPC handler working and I can turn on a LED. I have imported the RPCInterface libary into the program. However I cannot get RPCFunction example code to run
//Create a function of the required format
void foo(char * input, char * output);
//Attach it to an RPC object
RPCFunction rpc_foo(&foo, "foo");
void foo(char * input, char * output){
int x,y;
sscanf(input, "%i, %i", &x, &y);
//Do something here......
sprintf(ouput, "%i, %i", x, y );
}
The compiler complaints: Identifier "RPCFunction" is undefined (E20) in the line containing "RPCFunction rpc_foo(&foo, "foo");"
The compiler also complaints about: "Expected a ")" (E18) in the same line
The compiler complaints about: "Identifier "ouput" is undefined (E20)
I can imagine it complaints about "ouput" without the t. However when I add #include "RPCInterface.h" to the code the first two errors disapear and the new error is:
"Cannot open source input file "RPCInterface.h": No such file or directory (E5)
Can you create a working RPCfunction example that flashes a LED three times and post it to the cookbook?
And also the RPC command?
I know how to turn a LED ON using a RPC command over HTTP. For example http://<your_ip_address>/rpc/led4/write 1.
But I would like to toggle an output pin (100us ON, 200us OFF, 100us ON and so on) by using a RPC command.
How do I do this?