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

esp8266 _oob_* : recv() brought back where it was needed #11541

Merged
merged 1 commit into from
Sep 30, 2019

Conversation

dmaziec
Copy link
Contributor

@dmaziec dmaziec commented Sep 20, 2019

Description

As reported in: #11537 in esp8266::_oob_* recv() is brought back where scanf() fails.
scanf() immediately returns after finding one digit of the number, while recv() matches the whole number.

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@ccli8
@michalpasztamobica
@0xc0170

Release Notes

@ciarmcom
Copy link
Member

@dmaziec1, thank you for your changes.
@michalpasztamobica @0xc0170 @ARMmbed/mbed-os-ipcore @ARMmbed/mbed-os-maintainers please review.

@michalpasztamobica
Copy link
Contributor

@VeijoPesonen , your feedback, as usually, will be appreciated :)

Copy link
Contributor

@ccli8 ccli8 left a comment

Choose a reason for hiding this comment

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

Verify OK on #11537

Copy link
Contributor

@VeijoPesonen VeijoPesonen left a comment

Choose a reason for hiding this comment

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

Looks ok but could you also add a comment to ATCmdParser.hpp about scanf and its limitations. The fact that it won't consider whitespace as part of the string it tries to match. Information source, @kjbracey-arm . An issue should also be created that there is a need to combine scanf's and recv's implementations in a way that scanf is just the one which gives up immeadiatelly after it doesn't find a match. Then it would also work as expected in a case like this where there are multiple digits at the end of a line.

@michalpasztamobica
Copy link
Contributor

@VeijoPesonen , regarding the comment that you would like us to add... do you mean something like this, but moved to the doxygen header's documentation?

Could you please clarify a bit further on what the bug report should aim at? vrecv and vscanf work in a similar manner. To my understanding the difference currently is that you can request a "whole line" in vrecv, while vscanf will not handle this (just as scanf doesn't). To me it seems neither of them will be able to handle a multiple character number, unless the format string ends with a new line (no other white space will do) and vrecv was used.

@VeijoPesonen
Copy link
Contributor

do you mean something like this, but moved to the doxygen header's documentation?

Yes, that should work.

Could you please clarify a bit further on what the bug report should aim at? vrecv and vscanf work in a similar manner. To my understanding the difference currently is that you can request a "whole line" in vrecv, while vscanf will not handle this (just as scanf doesn't). To me it seems neither of them will be able to handle a multiple character number, unless the format string ends with a new line (no other white space will do) and vrecv was used.

vrecv and vscanf should be merged together. The goal is to give a configuration parameter for this function which would indicate are we trying to find a match from one line(scanf) or do we might end up processing multiple lines(recv) to find a match.

@dmaziec dmaziec force-pushed the recv_scanf_oob_fixed branch 2 times, most recently from f05d9cc to cb7ff53 Compare September 27, 2019 13:22
@@ -271,6 +271,9 @@ class ATCmdParser : private NonCopyable<ATCmdParser> {

/**
* Direct scanf on underlying stream
* This function does not itself match whitespace in its format string, so \n is not significant to it.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please fix indentation. I would say that ESP8266 and ATCmdParser changes should be done on separate commits.

@michalpasztamobica
Copy link
Contributor

A separate PR was created (and approved) for documentation update.
An internal JIRA was created to track the possible merge of recv and scanf, as described by Veijo.
I guess this is pretty much ready for merge.

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 30, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Sep 30, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

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

Successfully merging this pull request may close these issues.

None yet

7 participants