remove all remaining C implementation

This commit is contained in:
David Cermak
2021-03-08 15:10:15 +01:00
parent 904cf94648
commit 2907eb9836
35 changed files with 114 additions and 4123 deletions

View File

@ -1,62 +0,0 @@
// Copyright 2020 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.
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include "esp_modem_dce.h"
#include "esp_modem.h"
/**
* @brief Finds the command par its symbolic name
*
* @param dce Modem DCE object
* @param command Symbolic name of the command
*
* @return Function pointer to the
*/
dce_command_t esp_modem_dce_find_command(esp_modem_dce_t *dce, const char *command);
/**
* @brief Delete specific command from the list
*
* @param dce Modem DCE object
* @param command Symbolic name of the command to delete
*
* @return ESP_OK on success
*/
esp_err_t esp_modem_dce_delete_command(esp_modem_dce_t *dce, const char *command_id);
/**
* @brief Deletes all commands in the list
*
* @param dce Modem DCE object
*
* @return ESP_OK on success
*/
esp_err_t esp_modem_dce_delete_all_commands(esp_modem_dce_t *dce);
/**
* @brief Creates internal structure for holding the command list
*
* @return Pointer to the command list struct on success, NULL otherwise
*/
struct esp_modem_dce_cmd_list *esp_modem_command_list_create(void);
#ifdef __cplusplus
}
#endif

View File

@ -1,51 +0,0 @@
// Copyright 2020 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.
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include "esp_modem.h"
/**
* @brief Specific init of SIM800 device
*
* @param dce Modem DCE object
*
* @return ESP_OK on success
*/
esp_err_t esp_modem_sim800_specific_init(esp_modem_dce_t *dce);
/**
* @brief Specific init of SIM7600 device
*
* @param dce Modem DCE object
*
* @return ESP_OK on success
*/
esp_err_t esp_modem_sim7600_specific_init(esp_modem_dce_t *dce);
/**
* @brief Specific init of BG96 device
*
* @param dce Modem DCE object
*
* @return ESP_OK on success
*/
esp_err_t esp_modem_bg96_specific_init(esp_modem_dce_t *dce);
#ifdef __cplusplus
}
#endif

View File

@ -1,57 +0,0 @@
// Copyright 2020 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.
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include "esp_log.h"
#include "esp_modem.h"
#include "esp_modem_dte.h"
#include "freertos/FreeRTOS.h"
#include "freertos/event_groups.h"
/**
* @brief Main lifecycle states of the esp-modem
*
* The bits below are used to indicate events in process_group
* field of the esp_modem_dte_internal_t
*/
#define ESP_MODEM_START_BIT BIT0
#define ESP_MODEM_COMMAND_BIT BIT1
#define ESP_MODEM_STOP_PPP_BIT BIT2
#define ESP_MODEM_STOP_BIT BIT3
/**
* @brief ESP32 Modem DTE
*
*/
typedef struct {
uart_port_t uart_port; /*!< UART port */
uint8_t *buffer; /*!< Internal buffer to store response lines/data from DCE */
QueueHandle_t event_queue; /*!< UART event queue handle */
esp_event_loop_handle_t event_loop_hdl; /*!< Event loop handle */
TaskHandle_t uart_event_task_hdl; /*!< UART event task handle */
EventGroupHandle_t process_group; /*!< Event group used for indicating DTE state changes */
esp_modem_dte_t parent; /*!< DTE interface that should extend */
esp_modem_on_receive receive_cb; /*!< ptr to data reception */
void *receive_cb_ctx; /*!< ptr to rx fn context data */
int line_buffer_size; /*!< line buffer size in command mode */
int pattern_queue_size; /*!< UART pattern queue size */
} esp_modem_dte_internal_t;
#ifdef __cplusplus
}
#endif

View File

@ -1,48 +0,0 @@
// Copyright 2020 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.
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include "esp_log.h"
#include "esp_modem.h"
/**
* @brief Macro defined for error checking
*
*/
#define ESP_MODEM_ERR_CHECK(a, str, goto_tag, ...) \
do \
{ \
if (!(a)) \
{ \
ESP_LOGE(TAG, "%s(%d): " str, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
goto goto_tag; \
} \
} while (0)
/**
* @brief common modem delay function
*
*/
static inline void esp_modem_wait_ms(size_t time)
{
vTaskDelay(pdMS_TO_TICKS(time));
}
#ifdef __cplusplus
}
#endif

View File

@ -7,10 +7,9 @@
#include "cxx_include/esp_modem_dte.hpp"
struct esp_modem_dte_config;
struct dte_config;
std::unique_ptr<Terminal> create_uart_terminal(const dte_config *config);
std::unique_ptr<Terminal> create_uart_terminal(const esp_modem_dte_config *config);