Commit d156b285 authored by Pavel Vainerman's avatar Pavel Vainerman Committed by Pavel Vainerman

[uwebsocket]: added field "type": "SensorInfo"

parent 783c4c21
...@@ -192,6 +192,7 @@ UTCPCore::Buffer* UWebSocketGate::to_json( const SensorMessage* sm, const std::s ...@@ -192,6 +192,7 @@ UTCPCore::Buffer* UWebSocketGate::to_json( const SensorMessage* sm, const std::s
{ {
Poco::JSON::Object::Ptr json = new Poco::JSON::Object(); Poco::JSON::Object::Ptr json = new Poco::JSON::Object();
json->set("type", "SensorInfo");
json->set("error", err); json->set("error", err);
json->set("id", sm->id); json->set("id", sm->id);
json->set("value", sm->value); json->set("value", sm->value);
...@@ -594,6 +595,7 @@ std::shared_ptr<UWebSocketGate::UWebSocket> UWebSocketGate::newWebSocket( Poco:: ...@@ -594,6 +595,7 @@ std::shared_ptr<UWebSocketGate::UWebSocket> UWebSocketGate::newWebSocket( Poco::
slist = qp[0].first; slist = qp[0].first;
auto idlist = uniset::explode(slist); auto idlist = uniset::explode(slist);
if( idlist.empty() ) if( idlist.empty() )
{ {
resp->setStatus(HTTPResponse::HTTP_BAD_REQUEST); resp->setStatus(HTTPResponse::HTTP_BAD_REQUEST);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment