From e17d02639c0ff456a340636a9f961de5ef745b7a Mon Sep 17 00:00:00 2001 From: David Cermak Date: Wed, 7 Apr 2021 09:11:53 +0200 Subject: [PATCH] Fix DTE crash on exit of PPP mode plus minor CMUX cleanup --- esp_modem/include/cxx_include/esp_modem_dte.hpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/esp_modem/include/cxx_include/esp_modem_dte.hpp b/esp_modem/include/cxx_include/esp_modem_dte.hpp index 8387fb5ba..ec827ae7a 100644 --- a/esp_modem/include/cxx_include/esp_modem_dte.hpp +++ b/esp_modem/include/cxx_include/esp_modem_dte.hpp @@ -51,14 +51,14 @@ public: data = buffer.get(); len = term->read(data, data_to_read); } - return on_data(data, len); + if (on_data) + return on_data(data, len); + return false; }); } void start() { term->start(); } - void data_mode_closed() { term->stop(); } - void set_mode(modem_mode m) { term->start(); mode = m; @@ -79,7 +79,6 @@ private: Lock lock; void setup_cmux(); -// command_result command(Terminal *t, const std::string &command, got_line_cb got_line, uint32_t time_ms); static const size_t GOT_LINE = signal_group::bit0; size_t buffer_size; @@ -93,12 +92,6 @@ private: std::function on_data; }; -//class DTE_inst: public DTE { -//public: -// DTE_inst(std::shared_ptr parent) : DTE(t), dte(parent) {} -//private: -// std::shared_ptr dte; -//}; } // namespace esp_modem