mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-11-02 19:48:03 +00:00
Standardization of device flags: rrm, firmwareUpgrade, rcOnly.
This commit is contained in:
34
src/sdks/SDK_fms.cpp
Normal file
34
src/sdks/SDK_fms.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// Created by stephane bourque on 2022-05-12.
|
||||
//
|
||||
|
||||
#include "SDK_fms.h"
|
||||
#include "framework/MicroService.h"
|
||||
#include "RESTObjects/RESTAPI_FMSObjects.h"
|
||||
|
||||
namespace OpenWifi::SDK::FMS {
|
||||
|
||||
namespace Firmware {
|
||||
|
||||
bool GetLatest(const std::string &device_type, bool RCOnly, FMSObjects::Firmware & FirmWare) {
|
||||
static const std::string EndPoint{"/api/v1/firmwares"};
|
||||
|
||||
OpenWifi::OpenAPIRequestGet API( uSERVICE_FIRMWARE,
|
||||
EndPoint,
|
||||
{ { "latestOnly" , "true"},
|
||||
{ "deviceType", device_type},
|
||||
{ "rcOnly" , RCOnly ? "true" : "false" }
|
||||
},
|
||||
50000);
|
||||
|
||||
auto CallResponse = Poco::makeShared<Poco::JSON::Object>();
|
||||
auto StatusCode = API.Do(CallResponse);
|
||||
if( StatusCode == Poco::Net::HTTPResponse::HTTP_OK) {
|
||||
return FirmWare.from_json(CallResponse);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user