Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(serde_at): deserialize _ #216

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

denysvitali
Copy link

@denysvitali denysvitali commented Nov 28, 2024

While parsing the CGMI of my device (SIM7020), I've noticed that I was getting a lot of parsing errors.
After digging deeper, I've discovered that the parsing errors were actually EofWhileParsingString errors.

Finally, I've discovered why: my manufacturer string looked like this:

SIMCOM_Ltd

And this was breaking at the _, because it's not considered alphanumeric.
My fix here is to allow all ASCII characters >= 32 (space + printable characters).

The only non-printable character included is DEL (127) - but it shouldn't be a big deal.


match client.send(&common::GetManufacturerId{}).await {
    Ok(resp) => {
        info!("Manufacturer ID OK: resp={:?}", resp.id.as_str());
    }
    Err(e) => {
        println!("Error: {:?}", e);
    }
}

Before my fix:

DEBUG Response: "SIMCOM_Ltd"
Error from serde_at: EofWhileParsingString

After my fix:

DEBUG Response: "SIMCOM_Ltd"
INFO Manufacturer ID OK: resp="SIMCOM_Ltd"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant