felias-fogg / SoftI2CMaster

Software I2C Arduino library
GNU General Public License v3.0
368 stars 100 forks source link

RequestFrom in wire wrapper #25

Closed d0d0-the-bird closed 5 years ago

d0d0-the-bird commented 6 years ago

Hi!

Maybe it is deliberate, but requestFrom in wire wrapper always returns requested number of bytes, regardless of did it actualy receive them or not.

It seems to me that error atribute, or localerror variable could be used to check if anything at all is connected, if it is, start reading, and then depending on that return zero or received numbr of bytes.