Skip to content

Commit 71e4441

Browse files
committed
Document handling of terminator in Stream read*Until functions
- The returned read does not include the terminator. - The terminator is discarded from the stream.
1 parent 0ff7cf4 commit 71e4441

File tree

4 files changed

+56
-3
lines changed

4 files changed

+56
-3
lines changed

Language/Functions/Communication/Serial/readBytesUntil.adoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,19 @@ Serial.readBytesUntil() reads characters from the serial buffer into an array. T
4545
// OVERVIEW SECTION ENDS
4646

4747

48+
// HOW TO USE SECTION STARTS
49+
[#howtouse]
50+
--
51+
52+
[float]
53+
=== Notes and Warnings
54+
The terminator character is discarded from the serial buffer.
55+
[%hardbreaks]
56+
57+
--
58+
// HOW TO USE SECTION ENDS
59+
60+
4861
// SEE ALSO SECTION
4962
[#see_also]
5063
--

Language/Functions/Communication/Serial/readStringUntil.adoc

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,25 @@ This function is part of the Stream class, and is called by any class that inher
3333

3434
[float]
3535
=== Returns
36-
The entire String read from the serial buffer, until the terminator character is detected
36+
The entire String read from the serial buffer, up to the terminator character
3737

3838
--
3939
// OVERVIEW SECTION ENDS
4040

4141

42+
// HOW TO USE SECTION STARTS
43+
[#howtouse]
44+
--
45+
46+
[float]
47+
=== Notes and Warnings
48+
The terminator character is discarded from the serial buffer.
49+
[%hardbreaks]
50+
51+
--
52+
// HOW TO USE SECTION ENDS
53+
54+
4255
// SEE ALSO SECTION
4356
[#see_also]
4457
--

Language/Functions/Communication/Stream/streamReadBytesUntil.adoc

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ title: Stream.readBytesUntil()
1414

1515
[float]
1616
=== Description
17-
`readBytesUntil()` reads characters from a stream into a buffer. The function terminates if the terminator character is detected, the determined length has been read, or it times out (see link:../streamsettimeout[setTimeout()]).
17+
`readBytesUntil()` reads characters from a stream into a buffer. The function terminates if the terminator character is detected, the determined length has been read, or it times out (see link:../streamsettimeout[setTimeout()]). The function returns the characters up to the last character before the supplied terminator. The terminator itself is not returned in the buffer.
1818

1919
`readBytesUntil()` returns the number of bytes placed in the buffer. A 0 means no valid data was found.
2020

@@ -43,3 +43,16 @@ The number of bytes placed in the buffer.
4343

4444
--
4545
// OVERVIEW SECTION ENDS
46+
47+
48+
// HOW TO USE SECTION STARTS
49+
[#howtouse]
50+
--
51+
52+
[float]
53+
=== Notes and Warnings
54+
The terminator character is discarded from the stream.
55+
[%hardbreaks]
56+
57+
--
58+
// HOW TO USE SECTION ENDS

Language/Functions/Communication/Stream/streamReadStringUntil.adoc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,21 @@ This function is part of the Stream class, and is called by any class that inher
3333

3434
[float]
3535
=== Returns
36-
The entire String read from a stream, until the terminator character is detected.
36+
The entire String read from a stream, up to the terminator character
3737

3838
--
3939
// OVERVIEW SECTION ENDS
40+
41+
42+
// HOW TO USE SECTION STARTS
43+
[#howtouse]
44+
--
45+
46+
[float]
47+
=== Notes and Warnings
48+
The terminator character is discarded from the stream.
49+
[%hardbreaks]
50+
51+
--
52+
// HOW TO USE SECTION ENDS
53+

0 commit comments

Comments
 (0)