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 CGI for Quectel modems #2019

Merged
merged 2 commits into from Feb 24, 2020
Merged

Fix CGI for Quectel modems #2019

merged 2 commits into from Feb 24, 2020

Conversation

zfields
Copy link
Contributor

@zfields zfields commented Feb 10, 2020

submission notes
**Important:** Please sanitize/remove any confidential info like usernames, passwords, org names, product names/ids, access tokens, client ids/secrets, or anything else you don't wish to share.

Please Read and Sign the Contributor License Agreement ([Info here](https://github.com/spark/firmware/blob/develop/CONTRIBUTING.md)).

You may also delete this submission notes header if you'd like. Thank you for contributing!

Problem

Quectel modems do not correctly report CGI data.

quectel_ncp_client.cpp appears to have been copied before CGI data was finished.

This results in not setting the flags TWO_DIGIT_MNC flag value, and the lac and ci are reported from uninitialized values.

Solution

Copy the latest Gen3 implementation from sara_ncp_client.cpp.

Steps to Test

Create a sample application on new b5som hardware

Example App

void setup() {
  Particle.publishVitals(15);
}

void loop() {

}

References

ch46950


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

Copy link
Member

@technobly technobly left a comment

Choose a reason for hiding this comment

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

Great job solving this so fast!

@technobly technobly added ready to merge PR has been reviewed and tested and removed needs review labels Feb 10, 2020
@technobly technobly modified the milestones: 1.5.0, 1.5.0-rc.2 Feb 10, 2020
@zfields
Copy link
Contributor Author

zfields commented Feb 10, 2020

Codacy, does not like the scanf formatting. However, this same formatting is used by all our parser implementations. Fixing this one, or all of them, introduces unnecessary risk to a low risk, functional PR.

I will make a CH story and annotate the code with //TODO: statements that reference the CH ticket.

//TODO: Use correct data types to parse URC
//[ch46994](https://app.clubhouse.io/particle/story/46994/fix-scanf-input-formatting-for-at-creg-et-al)
//Warning: %x in format string (no. 3) requires 'unsigned int *' but the argument type is 'signed int *'.

ch46994

hal/src/b5som/network/quectel_ncp_client.cpp Outdated Show resolved Hide resolved
hal/src/b5som/network/quectel_ncp_client.cpp Outdated Show resolved Hide resolved
@technobly
Copy link
Member

technobly commented Feb 11, 2020 via email

Copy link
Member

@avtolstoy avtolstoy left a comment

Choose a reason for hiding this comment

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

I agree with the points raised by other reviewers.

This code was copied over from sara_ncp_client.cpp and for ublox modems the responses may contain additional parameters like <rac> One byte routing area in hexadecimal format and others. These handlers also take care of both the read responses and URCs, so should take care of any format expected due to CH28408, however the format is still different between the modems, so let's make sure we tailor the parsing to Quectel AT commands manual.

@avtolstoy avtolstoy merged commit ffa0b3b into develop Feb 24, 2020
@avtolstoy avtolstoy deleted the ch46950/quectel-cgi branch February 24, 2020 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ready to merge PR has been reviewed and tested
Projects
None yet
4 participants