Files
MuditaOS/module-apps/application-settings-new/models/FactoryData.cpp
Przemysław Brudny e71a044bd3 [EGD-6019] Revert of two commits
This reverts commit b6416b15da.
This reverts commit e2f3882d8a.
2021-05-14 09:54:36 +02:00

33 lines
1.3 KiB
C++

// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "FactoryData.hpp"
#include <service-db/Settings.hpp>
#include <service-db/agents/settings/FactorySettings.hpp>
FactoryData::FactoryData(std::unique_ptr<settings::Settings> settingsProvider) : settings(std::move(settingsProvider))
{}
auto FactoryData::getModel() -> std::string
{
return settings->getValue(settings::factory::entry_key + std::string("/model"), settings::SettingsScope::Global);
}
auto FactoryData::getCase() -> std::string
{
return settings->getValue(settings::factory::entry_key + std::string("/case"), ::settings::SettingsScope::Global);
}
auto FactoryData::getSerial() -> std::string
{
return settings->getValue(settings::factory::entry_key + std::string("/serial"), settings::SettingsScope::Global);
}
auto FactoryData::getBatteryRev() -> std::string
{
return settings->getValue(settings::factory::entry_key + std::string("/battery_revision"),
settings::SettingsScope::Global);
}
auto FactoryData::getPcb(std::string type) -> std::string
{
std::string full_pcb = "/pcb_" + type + "_version";
return settings->getValue(settings::factory::entry_key + full_pcb, settings::SettingsScope::Global);
}