mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralfms.git
synced 2025-10-31 18:57:45 +00:00
27 lines
760 B
C++
27 lines
760 B
C++
//
|
|
// Created by stephane bourque on 2021-07-18.
|
|
//
|
|
|
|
#include "RESTAPI_connectedDeviceHandler.h"
|
|
#include "RESTObjects/RESTAPI_FMSObjects.h"
|
|
#include "StorageService.h"
|
|
#include "framework/ow_constants.h"
|
|
|
|
namespace OpenWifi {
|
|
|
|
void RESTAPI_connectedDeviceHandler::DoGet() {
|
|
auto SerialNumber = GetBinding(RESTAPI::Protocol::SERIALNUMBER,"");
|
|
|
|
if(SerialNumber.empty()) {
|
|
return BadRequest(RESTAPI::Errors::MissingSerialNumber);
|
|
}
|
|
|
|
FMSObjects::DeviceConnectionInformation DevInfo;
|
|
if(StorageService()->DevicesDB().GetDevice(SerialNumber, DevInfo)) {
|
|
Poco::JSON::Object Answer;
|
|
DevInfo.to_json(Answer);
|
|
return ReturnObject(Answer);
|
|
}
|
|
NotFound();
|
|
}
|
|
} |