Files
esp-protocols/esp_modem/include/cxx_include/esp_modem_api.hpp

88 lines
2.2 KiB
C++
Raw Normal View History

2021-03-29 19:34:45 +02:00
// Copyright 2021 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef _ESP_MODEM_API_HPP_
#define _ESP_MODEM_API_HPP_
2021-03-03 20:35:08 +01:00
#include <memory>
#include "cxx_include/esp_modem_dce.hpp"
#include "cxx_include/esp_modem_dce_module.hpp"
2021-03-03 20:35:08 +01:00
2021-03-08 15:10:15 +01:00
struct esp_modem_dte_config;
2021-03-29 19:34:45 +02:00
struct esp_modem_dce_config;
namespace esp_modem {
class DTE;
2021-03-03 20:35:08 +01:00
typedef struct esp_netif_obj esp_netif_t;
2021-03-29 19:34:45 +02:00
/**
* @defgroup ESP_MODEM_INIT_DTE ESP_MODEM Initialization API for DTE
* @brief Create DTE's
*/
/** @addtogroup ESP_MODEM_INIT_DTE
* @{
*/
2021-04-14 17:57:42 +02:00
using dce_config = ::esp_modem_dce_config;
using dte_config = ::esp_modem_dte_config;
2021-03-29 19:34:45 +02:00
/**
* @brief Create UART DTE
* @param config DTE configuration
* @return shared ptr to DTE
*/
std::shared_ptr<DTE> create_uart_dte(const dte_config *config);
/**
* @}
*/
/**
* @defgroup ESP_MODEM_INIT_DCE ESP_MODEM Initialization API for DCE
2021-04-14 17:57:42 +02:00
* @brief ESP_MODEM Initialization API for DCE
2021-03-29 19:34:45 +02:00
*/
/** @addtogroup ESP_MODEM_INIT_DCE
* @{
*/
/**
* @brief Create DCE based on SIM7600 module
* @param config DCE configuration
* @param DTE reference to the communicating DTE
* @param netif reference to the network interface
*
* @return unique ptr to the created DCE on success
* nullptr on failure
*/
std::unique_ptr<DCE> create_SIM7600_dce(const dce_config *config, std::shared_ptr<DTE> dte, esp_netif_t *netif);
/**
* @brief Create DCE based on SIM800 module
*/
std::unique_ptr<DCE> create_SIM800_dce(const dce_config *config, std::shared_ptr<DTE> dte, esp_netif_t *netif);
2021-03-03 20:35:08 +01:00
2021-03-29 19:34:45 +02:00
/**
* @brief Create DCE based on BG96 module
*/
std::unique_ptr<DCE> create_BG96_dce(const dce_config *config, std::shared_ptr<DTE> dte, esp_netif_t *netif);
2021-03-29 19:34:45 +02:00
/**
* @}
*/
2021-03-29 19:34:45 +02:00
} // namespace esp_modem
2021-03-29 19:34:45 +02:00
#endif // _ESP_MODEM_API_HPP_