Skip to content

Commit e4d2053

Browse files
authored
Merge pull request #11587 from dmaziec1/ATCmdParser_doxygen_scanf
ATCmdParser doxygen header's documentation update for scanf
2 parents 7e62caf + 948bad1 commit e4d2053

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

platform/ATCmdParser.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@ class ATCmdParser : private NonCopyable<ATCmdParser> {
271271

272272
/**
273273
* Direct scanf on underlying stream
274+
* This function does not itself match whitespace in its format string, so \n is not significant to it.
275+
* It should be used only when certain string is needed or format ends with certain character, otherwise
276+
* it will fill the output with one character.
274277
* @see scanf
275278
*
276279
* @param format Format string to pass to scanf

platform/source/ATCmdParser.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,6 @@ bool ATCmdParser::vrecv(const char *response, std::va_list args)
309309
if (whole_line_wanted && c != '\n') {
310310
// Don't attempt scanning until we get delimiter if they included it in format
311311
// This allows recv("Foo: %s\n") to work, and not match with just the first character of a string
312-
// (scanf does not itself match whitespace in its format string, so \n is not significant to it)
313312
} else if (response) {
314313
sscanf(_buffer + offset, _buffer, &count);
315314
}

0 commit comments

Comments
 (0)