Skip to content

Commit 1e29ea8

Browse files
authored
Merge pull request #697 from Arnold-n/patch-1
Update readBytesUntil.adoc
2 parents 353e5c2 + 221ef38 commit 1e29ea8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Language/Functions/Communication/Serial/readBytesUntil.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ title: Serial.readBytesUntil()
1414

1515
[float]
1616
=== Description
17-
Serial.readBytesUntil() reads characters from the serial buffer into an array. The function terminates if the terminator character is detected, the determined length has been read, or it times out (see link:../settimeout[Serial.setTimeout()]). The function returns the characters up to the last character before the supplied terminator. The terminator itself is not returned in the buffer.
17+
Serial.readBytesUntil() reads characters from the serial buffer into an array. The function terminates (checks being done in this order) if the determined length has been read, if it times out (see link:../settimeout[Serial.setTimeout()]), or if the terminator character is detected (in which case the function returns the characters up to the last character before the supplied terminator). The terminator itself is not returned in the buffer.
1818

19-
`Serial.readBytesUntil()` returns the number of characters read into the buffer. A 0 means no valid data was found.
19+
`Serial.readBytesUntil()` returns the number of characters read into the buffer. A 0 means that the `length` parameter \<= 0, a time out occurred before any other input, or a termination character was found before any other input.
2020

2121
`Serial.readBytesUntil()` inherits from the link:../../stream[Stream] utility class.
2222
[%hardbreaks]
@@ -49,7 +49,7 @@ Data type: `size_t`.
4949

5050
[float]
5151
=== Notes and Warnings
52-
The terminator character is discarded from the serial buffer.
52+
The terminator character is discarded from the serial buffer, unless the number of characters read and copied into the buffer equals `length`.
5353
[%hardbreaks]
5454

5555
--

0 commit comments

Comments
 (0)