stephb9959
2023-02-21 12:19:16 -08:00
parent efb2623613
commit 383343a2e5
113 changed files with 13223 additions and 13071 deletions

View File

@@ -2,8 +2,8 @@
// Created by stephane bourque on 2021-07-18.
//
#include "Poco/JSON/Object.h"
#include "Poco/JSON/Array.h"
#include "Poco/JSON/Object.h"
#include "RESTAPI_connectedDevicesHandler.h"
#include "RESTObjects/RESTAPI_FMSObjects.h"
@@ -11,20 +11,20 @@
#include "framework/ow_constants.h"
namespace OpenWifi {
void RESTAPI_connectedDevicesHandler::DoGet() {
std::vector<FMSObjects::DeviceConnectionInformation> Devices;
Poco::JSON::Object AnswerObj;
Poco::JSON::Array AnswerArr;
if (StorageService()->DevicesDB().GetDevices(QB_.Offset, QB_.Limit, Devices)) {
for (const auto &i:Devices) {
Poco::JSON::Object Obj;
i.to_json(Obj);
AnswerArr.add(Obj);
}
AnswerObj.set(RESTAPI::Protocol::DEVICES, AnswerArr);
return ReturnObject(AnswerObj);
}
AnswerObj.set(RESTAPI::Protocol::DEVICES, AnswerArr);
ReturnObject(AnswerObj);
}
}
void RESTAPI_connectedDevicesHandler::DoGet() {
std::vector<FMSObjects::DeviceConnectionInformation> Devices;
Poco::JSON::Object AnswerObj;
Poco::JSON::Array AnswerArr;
if (StorageService()->DevicesDB().GetDevices(QB_.Offset, QB_.Limit, Devices)) {
for (const auto &i : Devices) {
Poco::JSON::Object Obj;
i.to_json(Obj);
AnswerArr.add(Obj);
}
AnswerObj.set(RESTAPI::Protocol::DEVICES, AnswerArr);
return ReturnObject(AnswerObj);
}
AnswerObj.set(RESTAPI::Protocol::DEVICES, AnswerArr);
ReturnObject(AnswerObj);
}
} // namespace OpenWifi