esp-modem(Docs): Update documentation and minor fixes

This commit is contained in:
David Čermák
2021-05-26 16:41:19 +08:00
committed by David Cermak
parent 28433de4ad
commit e0e65856f0
24 changed files with 139 additions and 350 deletions

View File

@ -51,7 +51,7 @@ class CMuxInstance;
/**
* @brief CMux class which consumes the original terminal and creates multiple virtual terminals from it.
* This class is not usable applicable as a DTE terminal
* This class itself is not usable as a DTE terminal, only via its instances defined in `CMuxInstance`
*/
class CMux {
public:
@ -100,7 +100,7 @@ public:
void stop() override { }
private:
std::shared_ptr<CMux> cmux;
int instance;
size_t instance;
};
/**

View File

@ -88,7 +88,7 @@ protected:
* @brief Common abstraction of the modem DCE, specialized by the GenericModule which is a parent class for the supported
* defices and most common modems, as well.
*/
class DCE: public DCE_T<GenericModule> {
class DCE : public DCE_T<GenericModule> {
public:
using DCE_T<GenericModule>::DCE_T;

View File

@ -45,7 +45,7 @@ enum class terminal_error {
};
/**
* @brief Terminal interface. All communication interfaces must comply this interface in order to be used as a DTE
* @brief Terminal interface. All communication interfaces must comply to this interface in order to be used as a DTE
*/
class Terminal {
public:
@ -53,7 +53,7 @@ public:
void set_error_cb(std::function<void(terminal_error)> f) { on_error = std::move(f); }
virtual void set_read_cb(std::function<bool(uint8_t *data, size_t len)> f) { on_data = std::move(f); }
virtual void set_read_cb(std::function<bool(uint8_t *data, size_t len)> f) { on_read = std::move(f); }
/**
* @brief Writes data to the terminal
@ -76,7 +76,7 @@ public:
virtual void stop() = 0;
protected:
std::function<bool(uint8_t *data, size_t len)> on_data;
std::function<bool(uint8_t *data, size_t len)> on_read;
std::function<void(terminal_error)> on_error;
};

View File

@ -17,6 +17,10 @@
#include "driver/uart.h"
#include "esp_modem_dce_config.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup ESP_MODEM_CONFIG
* @brief Configuration structures for DTE and DCE
@ -56,6 +60,9 @@ struct esp_modem_uart_term_config {
int event_queue_size; /*!< UART Event Queue Size, set to 0 if no event queue needed */
};
// Forward declare the resource struct
struct esp_modem_vfs_resource;
/**
* @brief VFS configuration structure
*
@ -116,4 +123,8 @@ typedef struct esp_modem_dte_config esp_modem_dte_config_t;
* @}
*/
#ifdef __cplusplus
}
#endif
#endif // _ESP_MODEM_CONFIG_H_

View File

@ -15,6 +15,10 @@
#ifndef _ESP_MODEM_DCE_CONFIG_H_
#define _ESP_MODEM_DCE_CONFIG_H_
#ifdef __cplusplus
extern "C" {
#endif
/** @addtogroup ESP_MODEM_CONFIG
* @{
*/
@ -41,5 +45,8 @@ struct esp_modem_dce_config {
* @}
*/
#ifdef __cplusplus
}
#endif
#endif // _ESP_MODEM_DCE_CONFIG_H_

View File

@ -213,7 +213,7 @@ ESP_MODEM_DECLARE_DCE_COMMAND(set_baud, command_result, 1, INT_IN(x, baud))
#define _ARG(param, name) name
// --- DCE command documentation starts here ---
#ifdef __cplusplus
class esp_modem::DCE: public DCE_T<GenericModule> {
class esp_modem::DCE : public DCE_T<GenericModule> {
public:
using DCE_T<GenericModule>::DCE_T;
#define ESP_MODEM_DECLARE_DCE_COMMAND(name, return_type, TEMPLATE_ARG, ...) return_type name (__VA_ARGS__);