From 3ced2d970961b94911ca303e7578de220516f811 Mon Sep 17 00:00:00 2001 From: sjurgw Date: Tue, 24 May 2022 14:54:24 +0200 Subject: [PATCH] Update: Removed stringstream to decrease static sizes --- .../esp_modem/src/esp_modem_command_library.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/components/esp_modem/src/esp_modem_command_library.cpp b/components/esp_modem/src/esp_modem_command_library.cpp index 7b3a0dbaa..39a3b6176 100644 --- a/components/esp_modem/src/esp_modem_command_library.cpp +++ b/components/esp_modem/src/esp_modem_command_library.cpp @@ -18,7 +18,6 @@ #include "cxx_include/esp_modem_dte.hpp" #include "cxx_include/esp_modem_dce_module.hpp" #include "cxx_include/esp_modem_command_library.hpp" -#include namespace esp_modem::dce_commands { @@ -495,15 +494,19 @@ command_result set_network_bands(CommandableIf *t, const std::string& mode, cons command_result set_network_bands_sim76xx(CommandableIf *t, const std::string& mode, const int* bands, int size) { ESP_LOGV(TAG, "%s", __func__ ); + static const char *hexDigits = "0123456789ABCDEF"; uint64_t band_bits = 0; + int hex_len = 16; + std::string band_string(hex_len, '0'); for (int i = 0; i0; i--){ + band_string[i-1] = hexDigits[(band_bits >> ((hex_len-i)*4)) & 0xF]; + } + return generic_command_common(t, "AT+CNBP=" + mode + ",0x" + band_string + "\r"); } command_result get_network_system_mode(CommandableIf *t, int &mode)