Reduce heap allocations by getting rid of temporary std::list and std::string

This commit is contained in:
2025-05-28 15:43:42 +02:00
parent b8cdd373f4
commit 1d49013fc6
10 changed files with 44 additions and 40 deletions
@@ -496,8 +496,8 @@ command_result SQNGM02S::connect(PdpContext &pdp)
return res;
}
//wait for +CEREG: 5 or +CEREG: 1.
const auto pass = std::list<std::string_view>({"+CEREG: 1", "+CEREG: 5"});
const auto fail = std::list<std::string_view>({"ERROR"});
const std::string_view pass[] {"+CEREG: 1", "+CEREG: 5"};
const std::string_view fail[] {"ERROR"};
res = esp_modem::dce_commands::generic_command(dte.get(), "", pass, fail, 1200000);
if (res != command_result::OK) {
config_network_registration_urc(0);