My XML-RPC server is trying to recieve a flot but my code won't even compile.
at this line:
float value = (float) params[0]["VALUE"];
Thanks for your help
Entire method code:
class passFloat : public XmlRpcServerMethod
{
public:
passFloat(XmlRpcServer* s) : XmlRpcServerMethod("passFloat", s) {}
void execute(XmlRpcValue& params, XmlRpcValue& result)
{
float value =0;
//Get Value
if(params[0].hasMember("VALUE")){
value = (float) params[0]["VALUE"];
std::cout<<"passFloat recieved this from client: "<<value<<"\n"<<std::endl;
}
else
return;
result["VALUE"] = "CPPServer: Thanks we got your Float";
}
} passFloat(&s);
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can we send and recieve floats with XML-RPC?
My XML-RPC server is trying to recieve a flot but my code won't even compile.
at this line:
float value = (float) params[0]["VALUE"];
Thanks for your help
Entire method code:
class passFloat : public XmlRpcServerMethod
{
public:
passFloat(XmlRpcServer* s) : XmlRpcServerMethod("passFloat", s) {}
void execute(XmlRpcValue& params, XmlRpcValue& result)
{
float value =0;
//Get Value
if(params[0].hasMember("VALUE")){
value = (float) params[0]["VALUE"];
std::cout<<"passFloat recieved this from client: "<<value<<"\n"<<std::endl;
}
else
return;
result["VALUE"] = "CPPServer: Thanks we got your Float";
}
} passFloat(&s);