Framework update.

This commit is contained in:
stephb9959
2022-02-23 11:47:33 -08:00
parent 1b182f8076
commit 2f3e802cee
4 changed files with 12 additions and 3 deletions

View File

@@ -27,8 +27,8 @@ namespace OpenWifi {
ArrayObj.add(Obj); ArrayObj.add(Obj);
} }
} }
Answer.set(RESTAPI::Protocol::USERS, ArrayObj);
} }
Answer.set(RESTAPI::Protocol::USERS, ArrayObj);
return ReturnObject(Answer); return ReturnObject(Answer);
} else { } else {
Poco::JSON::Array ArrayObj; Poco::JSON::Array ArrayObj;

View File

@@ -26,8 +26,8 @@ namespace OpenWifi {
ArrayObj.add(Obj); ArrayObj.add(Obj);
} }
} }
Answer.set(RESTAPI::Protocol::USERS, ArrayObj);
} }
Answer.set(RESTAPI::Protocol::USERS, ArrayObj);
return ReturnObject(Answer); return ReturnObject(Answer);
} else { } else {
Poco::JSON::Array ArrayObj; Poco::JSON::Array ArrayObj;

View File

@@ -27,7 +27,7 @@ namespace OpenWifi::GWObjects {
void Device::to_json(Poco::JSON::Object &Obj) const { void Device::to_json(Poco::JSON::Object &Obj) const {
field_to_json(Obj,"serialNumber", SerialNumber); field_to_json(Obj,"serialNumber", SerialNumber);
#ifdef TIP_GATEWAY_SERVICE #ifdef TIP_GATEWAY_SERVICE
field_to_json(Obj,"deviceType", CapabilitiesCache::instance()->Get(Compatible)); field_to_json(Obj,"deviceType", CapabilitiesCache::instance()->GetPlatform(Compatible));
#endif #endif
field_to_json(Obj,"macAddress", MACAddress); field_to_json(Obj,"macAddress", MACAddress);
field_to_json(Obj,"manufacturer", Manufacturer); field_to_json(Obj,"manufacturer", Manufacturer);
@@ -45,6 +45,9 @@ namespace OpenWifi::GWObjects {
field_to_json(Obj,"compatible", Compatible); field_to_json(Obj,"compatible", Compatible);
field_to_json(Obj,"fwUpdatePolicy", FWUpdatePolicy); field_to_json(Obj,"fwUpdatePolicy", FWUpdatePolicy);
field_to_json(Obj,"devicePassword", DevicePassword); field_to_json(Obj,"devicePassword", DevicePassword);
field_to_json(Obj,"subscriber", subscriber);
field_to_json(Obj,"entity", entity);
field_to_json(Obj,"modified", modified);
} }
void Device::to_json_with_status(Poco::JSON::Object &Obj) const { void Device::to_json_with_status(Poco::JSON::Object &Obj) const {
@@ -81,6 +84,8 @@ namespace OpenWifi::GWObjects {
field_from_json(Obj,"location",Location); field_from_json(Obj,"location",Location);
field_from_json(Obj,"venue",Venue); field_from_json(Obj,"venue",Venue);
field_from_json(Obj,"compatible",Compatible); field_from_json(Obj,"compatible",Compatible);
field_from_json(Obj,"subscriber", subscriber);
field_from_json(Obj,"entity", entity);
return true; return true;
} catch (const Poco::Exception &E) { } catch (const Poco::Exception &E) {
} }

View File

@@ -59,6 +59,10 @@ namespace OpenWifi::GWObjects {
uint64_t LastFWUpdate = 0 ; uint64_t LastFWUpdate = 0 ;
std::string Venue; std::string Venue;
std::string DevicePassword; std::string DevicePassword;
std::string subscriber;
std::string entity;
uint64_t modified=0;
void to_json(Poco::JSON::Object &Obj) const; void to_json(Poco::JSON::Object &Obj) const;
void to_json_with_status(Poco::JSON::Object &Obj) const; void to_json_with_status(Poco::JSON::Object &Obj) const;
bool from_json(Poco::JSON::Object::Ptr &Obj); bool from_json(Poco::JSON::Object::Ptr &Obj);