// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include "ApnSettingsModel.hpp" #include #include ApnSettingsModel::ApnSettingsModel(app::Application *application) : application{application} {} void ApnSettingsModel::requestAPNList() { application->bus.sendUnicast(std::make_shared(), ServiceCellular::serviceName); } void ApnSettingsModel::saveAPN(std::shared_ptr apn) { if (apn->contextId != packet_data::EmptyContextId) { CellularServiceAPI::SetAPN(application, *apn); } else { CellularServiceAPI::NewAPN(application, *apn); } } void ApnSettingsModel::removeAPN(std::shared_ptr apn) { CellularServiceAPI::DeleteAPN(application, apn->contextId); } void ApnSettingsModel::setAsDefaultAPN(std::shared_ptr apn) { apn->apnType = packet_data::APN::APNType::Default; application->bus.sendUnicast(std::make_shared(apn), ServiceCellular::serviceName); }