diff --git a/CMakeLists.txt b/CMakeLists.txt index fb0bc1d..3043aa7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.13) -project(owprov VERSION 2.2.0) +project(owprov VERSION 2.3.0) set(CMAKE_CXX_STANDARD 17) diff --git a/build b/build index 2415c06..56a6051 100644 --- a/build +++ b/build @@ -1 +1 @@ -448 \ No newline at end of file +1 \ No newline at end of file diff --git a/src/APConfig.cpp b/src/APConfig.cpp index 9c9c39c..7088f87 100644 --- a/src/APConfig.cpp +++ b/src/APConfig.cpp @@ -165,8 +165,9 @@ namespace OpenWifi { if(InsertInfo.second) { if(Explain_) { Poco::JSON::Object ExObj; - ExObj.set("from", i.uuid); - ExObj.set("added", true); + ExObj.set("from-uuid", i.info.id); + ExObj.set("from-uuid", i.info.name); + ExObj.set("action", "added"); ExObj.set("element",SectionInfo); Explanation_.add(ExObj); } @@ -174,8 +175,10 @@ namespace OpenWifi { } else { if(Explain_) { Poco::JSON::Object ExObj; - ExObj.set("from", i.uuid); - ExObj.set("added", false); + ExObj.set("from-uuid", i.info.id); + ExObj.set("from-name", i.info.name); + ExObj.set("action", "rejected"); + ExObj.set("reason","weight insufficient"); ExObj.set("element",SectionInfo); Explanation_.add(ExObj); } @@ -213,21 +216,22 @@ namespace OpenWifi { if(DeviceTypeMatch(DeviceType_,Config.deviceTypes)) { for(const auto &i:Config.configuration) { if(i.weight==0) { - VerboseElement VE{ .element = i, .uuid = UUID}; + VerboseElement VE{ .element = i, .info = Config.info}; Config_.push_back(VE); } else { // we need to insert after everything bigger or equal auto Hint = std::lower_bound(Config_.cbegin(),Config_.cend(),i.weight, [](const VerboseElement &Elem, int Value) { return Elem.element.weight>=Value; }); - VerboseElement VE{ .element = i, .uuid = UUID}; + VerboseElement VE{ .element = i, .info = Config.info}; Config_.insert(Hint,VE); } } } else { Poco::JSON::Object ExObj; - ExObj.set("from", UUID); - ExObj.set("added", false); + ExObj.set("from-uuid", Config.info.id); + ExObj.set("from-name",Config.info.name); + ExObj.set("action", "rejected"); ExObj.set("reason", "deviceType mismatch"); Explanation_.add(ExObj); } diff --git a/src/APConfig.h b/src/APConfig.h index 7ba2bf7..75df709 100644 --- a/src/APConfig.h +++ b/src/APConfig.h @@ -13,7 +13,7 @@ namespace OpenWifi { struct VerboseElement { ProvObjects::DeviceConfigurationElement element; - std::string uuid; + ProvObjects::ObjectInfo info; }; typedef std::vector ConfigVec;