-
-
Notifications
You must be signed in to change notification settings - Fork 94
Fix 10 second delay in WiFiClient read methods when no data is available to read #458
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -298,6 +298,9 @@ ModemClass::ParseResult ModemClass::buf_read(const string &prompt, string &data_ | |
|
||
sized_read_size = atoi(data_res.c_str()); | ||
data_res.clear(); | ||
if (sized_read_size == 0) { | ||
state = at_parse_state_t::Res; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would remove the state transition at line 297 and keep the state change next to each other. This will improve the readability.
Suggested change
if (sized_read_size == 0) {
state = at_parse_state_t::Res;
}
if (sized_read_size != 0) {
state = at_parse_state_t::Sized;
} else {
state = at_parse_state_t::Res;
}
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the good suggestion - I have added another commit to address. |
||
} else if(c == '\r') { | ||
state = at_parse_state_t::ResWaitLF; | ||
} else if(c == '\n') { | ||
|