mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-18 13:02:21 +02:00
Completed AT command library
This commit is contained in:
@ -19,12 +19,20 @@
|
||||
|
||||
using namespace esp_modem;
|
||||
|
||||
static const size_t dte_default_buffer_size = 1000;
|
||||
|
||||
DTE::DTE(const esp_modem_dte_config *config, std::unique_ptr<Terminal> terminal):
|
||||
buffer_size(config->dte_buffer_size), consumed(0),
|
||||
buffer(std::make_unique<uint8_t[]>(buffer_size)),
|
||||
term(std::move(terminal)), command_term(term.get()), other_term(nullptr),
|
||||
mode(modem_mode::UNDEF) {}
|
||||
|
||||
DTE::DTE(std::unique_ptr<Terminal> terminal):
|
||||
buffer_size(dte_default_buffer_size), consumed(0),
|
||||
buffer(std::make_unique<uint8_t[]>(buffer_size)),
|
||||
term(std::move(terminal)), command_term(term.get()), other_term(nullptr),
|
||||
mode(modem_mode::UNDEF) {}
|
||||
|
||||
command_result DTE::command(const std::string &command, got_line_cb got_line, uint32_t time_ms, const char separator)
|
||||
{
|
||||
Scoped<Lock> l(lock);
|
||||
@ -121,4 +129,4 @@ int DTE::read(uint8_t **d, size_t len)
|
||||
int DTE::write(uint8_t *data, size_t len)
|
||||
{
|
||||
return term->write(data, len);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user