2021-03-29 19:34:45 +02:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
2022-10-11 16:31:57 +02:00
|
|
|
*
|
2021-03-29 19:34:45 +02:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2021-03-07 19:43:45 +01:00
|
|
|
#include <functional>
|
|
|
|
#include "cxx_include/esp_modem_types.hpp"
|
|
|
|
#include "cxx_include/esp_modem_dte.hpp"
|
|
|
|
#include "cxx_include/esp_modem_dce_module.hpp"
|
|
|
|
|
2021-03-29 19:34:45 +02:00
|
|
|
namespace esp_modem {
|
|
|
|
|
2021-03-07 19:43:45 +01:00
|
|
|
template<typename T>
|
2021-06-01 10:21:51 +02:00
|
|
|
std::shared_ptr<T> create_device(const std::shared_ptr<DTE> &dte, std::string &apn)
|
2021-03-07 19:43:45 +01:00
|
|
|
{
|
|
|
|
auto pdp = std::make_unique<PdpContext>(apn);
|
|
|
|
return std::make_shared<T>(dte, std::move(pdp));
|
|
|
|
}
|
|
|
|
|
2021-06-01 10:21:51 +02:00
|
|
|
std::shared_ptr<GenericModule> create_generic_module(const std::shared_ptr<DTE> &dte, std::string &apn)
|
2021-03-07 19:43:45 +01:00
|
|
|
{
|
|
|
|
return create_device<GenericModule>(dte, apn);
|
|
|
|
}
|
|
|
|
|
2021-06-01 10:21:51 +02:00
|
|
|
std::shared_ptr<SIM7600> create_SIM7600_module(const std::shared_ptr<DTE> &dte, std::string &apn)
|
2021-03-07 19:43:45 +01:00
|
|
|
{
|
|
|
|
return create_device<SIM7600>(dte, apn);
|
|
|
|
}
|
2021-03-28 13:38:20 +02:00
|
|
|
|
2021-03-29 19:34:45 +02:00
|
|
|
}
|
2021-03-28 13:38:20 +02:00
|
|
|
|
|
|
|
#include "cxx_include/esp_modem_api.hpp"
|
|
|
|
#include "cxx_include/esp_modem_dce_factory.hpp"
|
|
|
|
|
2021-03-28 20:22:44 +02:00
|
|
|
namespace esp_modem::dce_factory {
|
2021-06-01 10:21:51 +02:00
|
|
|
std::unique_ptr<PdpContext> FactoryHelper::create_pdp_context(std::string &apn)
|
|
|
|
{
|
2021-03-28 13:38:20 +02:00
|
|
|
return std::unique_ptr<PdpContext>();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|