Add "at" api for custom commands

This commit is contained in:
Bruno Binet
2022-05-31 14:22:41 +02:00
parent 51a50db0fd
commit 0cf08fb676
3 changed files with 31 additions and 2 deletions

View File

@ -379,6 +379,13 @@ command_result set_pin(CommandableIf *t, const std::string &pin)
return generic_command_common(t, set_pin_command);
}
command_result at(CommandableIf *t, const std::string &cmd, std::string &out)
{
ESP_LOGV(TAG, "%s", __func__ );
std::string at_command = cmd + "\r";
return generic_get_string(t, at_command, out);
}
command_result get_signal_quality(CommandableIf *t, int &rssi, int &ber)
{
ESP_LOGV(TAG, "%s", __func__ );
@ -543,4 +550,4 @@ command_result set_gnss_power_mode_sim76xx(CommandableIf *t, int mode)
return generic_command_common(t, "AT+CGPS=" + std::to_string(mode) + "\r");
}
} // esp_modem::dce_commands
} // esp_modem::dce_commands