Completed AT command library

This commit is contained in:
David Cermak
2021-04-19 11:28:53 +02:00
parent 26bde89834
commit 9e8ffbc760
20 changed files with 335 additions and 65 deletions

View File

@ -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);
}
}