reduced delay

This commit is contained in:
oarcher 2024-07-17 13:15:37 +02:00
parent 7b393e71d4
commit 6b377ad1f8
2 changed files with 1 additions and 7 deletions

View file

@ -171,8 +171,6 @@ void ModemComponent::start_connect_() {
global_modem_component->got_ipv4_address_ = false; global_modem_component->got_ipv4_address_ = false;
delay(this->command_delay); // NOLINT
if (this->dte_config_.uart_config.flow_control == ESP_MODEM_FLOW_CONTROL_HW) { if (this->dte_config_.uart_config.flow_control == ESP_MODEM_FLOW_CONTROL_HW) {
if (command_result::OK != this->dce->set_flow_control(2, 2)) { if (command_result::OK != this->dce->set_flow_control(2, 2)) {
ESP_LOGE(TAG, "Failed to set the set_flow_control mode"); ESP_LOGE(TAG, "Failed to set the set_flow_control mode");
@ -209,7 +207,6 @@ void ModemComponent::start_connect_() {
} else { } else {
ESP_LOGE(TAG, "Failed to configure multiplexed command mode. Trying to continue..."); ESP_LOGE(TAG, "Failed to configure multiplexed command mode. Trying to continue...");
} }
delay(this->command_delay); // NOLINT
// send initial AT commands from yaml // send initial AT commands from yaml
for (const auto &cmd : this->init_at_commands_) { for (const auto &cmd : this->init_at_commands_) {
@ -244,13 +241,10 @@ void ModemComponent::loop() {
// Errors are not checked, because some commands return FAIL, but make the modem to answer again... // Errors are not checked, because some commands return FAIL, but make the modem to answer again...
ESP_LOGV(TAG, "Forcing cmux manual mode mode"); ESP_LOGV(TAG, "Forcing cmux manual mode mode");
this->dce->set_mode(esp_modem::modem_mode::CMUX_MANUAL_MODE); this->dce->set_mode(esp_modem::modem_mode::CMUX_MANUAL_MODE);
delay(this->command_delay); // NOLINT
ESP_LOGV(TAG, "Forcing cmux manual command mode"); ESP_LOGV(TAG, "Forcing cmux manual command mode");
this->dce->set_mode(esp_modem::modem_mode::CMUX_MANUAL_COMMAND); this->dce->set_mode(esp_modem::modem_mode::CMUX_MANUAL_COMMAND);
delay(this->command_delay); // NOLINT
ESP_LOGW(TAG, "Forcing cmux manual exit mode"); ESP_LOGW(TAG, "Forcing cmux manual exit mode");
this->dce->set_mode(esp_modem::modem_mode::CMUX_MANUAL_EXIT); this->dce->set_mode(esp_modem::modem_mode::CMUX_MANUAL_EXIT);
delay(this->command_delay); // NOLINT
if (!this->modem_ready()) { if (!this->modem_ready()) {
this->on_not_responding_callback_.call(); this->on_not_responding_callback_.call();
} }

View file

@ -89,7 +89,7 @@ class ModemComponent : public Component {
static void got_ip_event_handler(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data); static void got_ip_event_handler(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data);
void dump_connect_params_(); void dump_connect_params_();
std::string use_address_; std::string use_address_;
uint32_t command_delay = 2000; uint32_t command_delay = 500;
CallbackManager<void()> on_not_responding_callback_; CallbackManager<void()> on_not_responding_callback_;
}; };