mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-10-29 17:52:28 +00:00
Adding firmware upgrade management.
This commit is contained in:
@@ -211,6 +211,8 @@ namespace OpenWifi{
|
||||
AssignIfPresent(ParsedObj,"description", Existing.info.description);
|
||||
AssignIfPresent(ParsedObj, "rrm", Existing.rrm);
|
||||
NewConfig.info.modified = std::time(nullptr);
|
||||
AssignIfPresent(ParsedObj,"firmwareUpgrade",Existing.firmwareUpgrade);
|
||||
AssignIfPresent(ParsedObj,"firmwareRCOnly", Existing.firmwareRCOnly);
|
||||
|
||||
if(!NewConfig.variables.empty())
|
||||
Existing.variables = NewConfig.variables;
|
||||
|
||||
@@ -185,6 +185,14 @@ namespace OpenWifi {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool RESTAPIHandler::AssignIfPresent(const Poco::JSON::Object::Ptr &O, const std::string &Field, bool &Value) {
|
||||
if(O->has(Field)) {
|
||||
Value = O->get(Field).toString()=="true";
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void RESTAPIHandler::AddCORS() {
|
||||
auto Origin = Request->find("Origin");
|
||||
if (Origin != Request->end()) {
|
||||
|
||||
@@ -142,6 +142,7 @@ namespace OpenWifi {
|
||||
|
||||
static bool AssignIfPresent(const Poco::JSON::Object::Ptr &O, const std::string &Field, std::string &Value);
|
||||
static bool AssignIfPresent(const Poco::JSON::Object::Ptr &O, const std::string &Field, uint64_t &Value);
|
||||
static bool AssignIfPresent(const Poco::JSON::Object::Ptr &O, const std::string &Field, bool &Value);
|
||||
|
||||
template<typename T> void ReturnObject(const char *Name, const std::vector<T> & Objects) {
|
||||
Poco::JSON::Object Answer;
|
||||
|
||||
Reference in New Issue
Block a user