stephb9959
2024-03-13 14:07:10 -07:00
parent 1a0a6d4a70
commit e75d3cfdbb
14 changed files with 155 additions and 91 deletions

View File

@@ -184,15 +184,6 @@ namespace OpenWifi::GWObjects {
return false;
}
void DefaultConfiguration::to_json(Poco::JSON::Object &Obj) const {
EmbedDocument("configuration", Obj, Configuration);
field_to_json(Obj, "name", Name);
field_to_json(Obj, "modelIds", Models);
field_to_json(Obj, "description", Description);
field_to_json(Obj, "created", Created);
field_to_json(Obj, "lastModified", LastModified);
}
void DefaultFirmware::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj, "deviceType", deviceType);
field_to_json(Obj, "description", Description);
@@ -240,12 +231,25 @@ namespace OpenWifi::GWObjects {
field_to_json(Obj, "deferred", deferred);
}
void DefaultConfiguration::to_json(Poco::JSON::Object &Obj) const {
EmbedDocument("configuration", Obj, Configuration);
field_to_json(Obj, "name", Name);
field_to_json(Obj, "modelIds", Models);
field_to_json(Obj, "description", Description);
field_to_json(Obj, "created", Created);
field_to_json(Obj, "lastModified", LastModified);
field_to_json(Obj, "Platform", Platform);
}
bool DefaultConfiguration::from_json(const Poco::JSON::Object::Ptr &Obj) {
try {
field_from_json(Obj, "name", Name);
field_from_json(Obj, "configuration", Configuration);
field_from_json(Obj, "name", Name);
field_from_json(Obj, "modelIds", Models);
field_from_json(Obj, "description", Description);
field_from_json(Obj, "created", Created);
field_from_json(Obj, "lastModified", LastModified);
field_from_json(Obj, "Platform", Platform);
return true;
} catch (const Poco::Exception &E) {
}