Skip to content

Commit 9838170

Browse files
committed
Clarify Serial library return values
Addresses #487.
1 parent ef1d7b2 commit 9838170

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

content/api_en/LIB_serial/Serial_last.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void draw() {
3636
</example>
3737

3838
<description><![CDATA[
39-
Returns last byte received.
39+
Returns last byte received or -1 if there is none available.
4040
]]></description>
4141

4242

content/api_en/LIB_serial/Serial_lastChar.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void draw() {
3737
</example>
3838

3939
<description><![CDATA[
40-
Returns the last byte received as a char.
40+
Returns the last byte received as a char or -1 if there is none available.
4141
]]></description>
4242

4343

content/api_en/LIB_serial/Serial_readBytes.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void draw() {
4242
</example>
4343

4444
<description><![CDATA[
45-
Reads a group of bytes from the buffer. The version with no parameters returns a byte array of all data in the buffer. This is not efficient, but is easy to use. The version with the <b>byteBuffer</b> parameter is more memory and time efficient. It grabs the data in the buffer and puts it into the byte array passed in and returns an int value for the number of bytes read. If more bytes are available than can fit into the <b>byteBuffer</b>, only those that fit are read.
45+
Reads a group of bytes from the buffer or <b>null</b> if there are none available. The version with no parameters returns a byte array of all data in the buffer. This is not efficient, but is easy to use. The version with the <b>byteBuffer</b> parameter is more memory and time efficient. It grabs the data in the buffer and puts it into the byte array passed in and returns an int value for the number of bytes read. If more bytes are available than can fit into the <b>byteBuffer</b>, only those that fit are read.
4646
]]></description>
4747

4848

content/api_en/LIB_serial/Serial_readString.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void draw() {
3838
</example>
3939

4040
<description><![CDATA[
41-
Returns all the data from the buffer as a String. This method assumes the incoming characters are ASCII. If you want to transfer Unicode data, first convert the String to a byte stream in the representation of your choice (i.e. UTF8 or two-byte Unicode data), and send it as a byte array.
41+
Returns all the data from the buffer as a String or <b>null</b> if there is nothing available. This method assumes the incoming characters are ASCII. If you want to transfer Unicode data, first convert the String to a byte stream in the representation of your choice (i.e. UTF8 or two-byte Unicode data), and send it as a byte array.
4242
]]></description>
4343

4444

0 commit comments

Comments
 (0)