Pages: [1]   Go Down
Author Topic: serial.readBytes vs serial.write  (Read 1535 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Serial.readBytes expects a char buffer.  Serial.write expects a byte buffer.  And never the twain shall meet without error messages (invalid conversion etc).
Surely they should use the same type, or at least have some (overloading) technique to accept either?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 46090
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
And never the twain shall meet without error messages (invalid conversion etc).
Or a simple cast.

Quote
Surely they should use the same type
Why? They perform different functions. Though, technically, readBytes() should really have been readChars(), but you can't tell the Arduino team much.

Quote
or at least have some (overloading) technique to accept either?
Is a cast too complicated for you?
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
or at least have some (overloading) technique to accept either?
Is a cast too complicated for you?

That's an awfully condescending response to a simple request for library standardization.
Logged

Pages: [1]   Go Up
Jump to: