Skip to content

Conversation

@JellevanKraaij
Copy link

@JellevanKraaij JellevanKraaij commented Oct 27, 2025

Description

This PR fixes a bug in get_network_registration_state where parsing the AT command response +CEREG: ,,... failed because std::from_chars was attempting to parse the number starting at the preceding comma.

The fix involves incrementing the start position by one (+ 1) before calling std::from_chars to correctly skip the leading comma delimiter.

Related

Fixes #923

Testing

Verified that the function now correctly extracts the integer from typical responses like +CEREG: 2,1

@CLAassistant
Copy link

CLAassistant commented Oct 27, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot changed the title fix(modem): CEREG parsing fails due to incorrect state index fix(modem): CEREG parsing fails due to incorrect state index (IDFGH-16681) Oct 27, 2025
@github-actions github-actions bot changed the title fix(modem): CEREG parsing fails due to incorrect state index (IDFGH-16681) fix(modem): CEREG parsing fails due to incorrect state index (IDFGH-16681) (IDFGH-16682) Oct 27, 2025
@espressif-bot espressif-bot added the Status: Opened Issue is new label Oct 27, 2025
Copy link
Collaborator

@david-cermak david-cermak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the fix 👍

Note that it's been fixed on master, but missed that when publishing v1.4.1

// Find the end of the state value - either a second comma or end of line
size_t state_pos_end = out.find(',', state_pos_start + 1);

will merge and create a new patch version.

@david-cermak david-cermak merged commit 309ba9e into espressif:release-modem-v1.4 Nov 5, 2025
161 of 166 checks passed
@JellevanKraaij
Copy link
Author

JellevanKraaij commented Nov 5, 2025

Thanks alot! I dont understand the release branch and how thats managed, but hope you keep track of it!
When will this be available in esp registry @david-cermak ?
Did not see it in main, sorry!

@david-cermak
Copy link
Collaborator

When will this be available in esp registry

just released, should be available already

Did not see it in main, sorry!

I am sorry, should have backported before v1.4.1.
I'll create v2.0 soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants