mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralgw.git
synced 2026-03-20 03:41:02 +00:00
Added several new commands.
This commit is contained in:
@@ -638,26 +638,18 @@ void RESTAPI_device_commandHandler::LEDs(Poco::Net::HTTPServerRequest &Request,
|
||||
Poco::JSON::Object::Ptr Obj = parser.parse(Request.stream()).extract<Poco::JSON::Object::Ptr>();
|
||||
Poco::DynamicStruct ds = *Obj;
|
||||
|
||||
std::cout << __LINE__ <<std::endl;
|
||||
|
||||
if (ds.contains("pattern") &&
|
||||
ds.contains("serialNumber")) {
|
||||
std::cout << __LINE__ <<std::endl;
|
||||
|
||||
auto SerialNumber = ds["serialNumber"].toString();
|
||||
std::cout << __LINE__ <<std::endl;
|
||||
|
||||
if(SerialNumber != SNum) {
|
||||
std::cout << __LINE__ <<std::endl;
|
||||
BadRequest(Response);
|
||||
return;
|
||||
}
|
||||
std::cout << __LINE__ <<std::endl;
|
||||
|
||||
auto Pattern = ds["pattern"].toString();
|
||||
|
||||
std::cout << "LEDS:" << Pattern << " " << SerialNumber << " " << std::endl;
|
||||
|
||||
if(Pattern!="on" && Pattern!="off" && Pattern!="blink")
|
||||
{
|
||||
Logger_.warning(Poco::format("LEDs(%s): Bad pattern",SerialNumber));
|
||||
@@ -671,6 +663,8 @@ void RESTAPI_device_commandHandler::LEDs(Poco::Net::HTTPServerRequest &Request,
|
||||
if(ds.contains("when"))
|
||||
When = uCentral::Utils::from_RFC3339(ds["when"].toString());
|
||||
|
||||
Logger_.information(Poco::format("LEDS(%s): Pattern:%s Duration: %d", SerialNumber, Pattern, (int)Duration));
|
||||
|
||||
uCentral::Objects::CommandDetails Cmd;
|
||||
|
||||
Cmd.SerialNumber = SerialNumber;
|
||||
|
||||
Reference in New Issue
Block a user