From 0121ed5073f946718196e9326319f5c327ce4604 Mon Sep 17 00:00:00 2001 From: stephb9959 Date: Thu, 14 Dec 2023 17:26:12 -0800 Subject: [PATCH] https://telecominfraproject.atlassian.net/browse/WIFI-13200 Signed-off-by: stephb9959 --- src/sdks/SDK_fms.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/sdks/SDK_fms.cpp b/src/sdks/SDK_fms.cpp index f174b2d..cc9e2d1 100644 --- a/src/sdks/SDK_fms.cpp +++ b/src/sdks/SDK_fms.cpp @@ -44,18 +44,13 @@ namespace OpenWifi::SDK::FMS { auto StatusCode = API.Do(CallResponse); if (StatusCode == Poco::Net::HTTPResponse::HTTP_OK) { Poco::JSON::Array::Ptr FirmwareArr = CallResponse->getArray("firmwares"); - for (uint64_t i = 0; i < FirmwareArr->size(); i++) { + for(const auto &firmware:*FirmwareArr) { + auto Object = firmware.extract(); FMSObjects::Firmware F; - F.from_json(FirmwareArr->getObject(i)); + F.from_json(Object); + std::cout << "Adding firmware: " << F.revision << std::endl; FirmWares.emplace_back(F); } - int done=0; - if(!done) { - for (const auto &Firmware: FirmWares) { - std::cout << "Firmware: " << Firmware.revision << std::endl; - } - done=1; - } return true; } return false;