Skip to content

Commit 309ba9e

Browse files
authored
Merge pull request #922 from JellevanKraaij/release-modem-v1.4
fix(modem): CEREG parsing fails due to incorrect state index (IDFGH-16681) (IDFGH-16682)
2 parents 2cc7c99 + a80a3cb commit 309ba9e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

components/esp_modem/src/esp_modem_command_library.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,8 @@ command_result get_network_registration_state(CommandableIf *t, int &state)
641641
return command_result::FAIL;
642642
}
643643

644+
state_pos_start += 1; // move past the comma
645+
644646
if (out.find(pattern) == std::string::npos || (state_pos_end = out.find(',', state_pos_start)) == std::string::npos) {
645647
if (std::from_chars(out.data() + state_pos_start, out.data() + out.size(), state).ec == std::errc::invalid_argument) {
646648
return command_result::FAIL;

0 commit comments

Comments
 (0)