Adding new script command.

This commit is contained in:
stephb9959
2022-05-12 08:50:22 -07:00
parent 8b0ecb464b
commit dc95a8632a
10 changed files with 166 additions and 81 deletions

View File

@@ -72,8 +72,18 @@ namespace OpenWifi::RESTAPI_RPC {
if (StatusInnerObj->has(uCentralProtocol::TEXT))
Cmd.ErrorText = StatusInnerObj->get(uCentralProtocol::TEXT).toString();
std::stringstream ResultText;
Poco::JSON::Stringifier::stringify(rpc_answer.get(uCentralProtocol::RESULT),
ResultText);
if(rpc_answer.has(uCentralProtocol::RESULT)) {
Poco::JSON::Stringifier::stringify(
rpc_answer.get(uCentralProtocol::RESULT), ResultText);
} if (rpc_answer.has(uCentralProtocol::RESULT_64)) {
uint64_t sz=0;
if(rpc_answer.has(uCentralProtocol::RESULT_SZ))
sz=rpc_answer.get(uCentralProtocol::RESULT_SZ);
std::string UnCompressedData;
Utils::ExtractBase64CompressedData(rpc_answer.get(uCentralProtocol::RESULT_64).toString(),
UnCompressedData,sz);
Poco::JSON::Stringifier::stringify(UnCompressedData, ResultText);
}
Cmd.Results = ResultText.str();
Cmd.Status = "completed";
Cmd.Completed = OpenWifi::Now();