Using Wire.requestFrom with 0 bytes... bug report?

Hello,

Working with a TE Connectivity ms4515do pressure sensor via I2C, I want to send a fairly common message. (The message is detailed on page 4 in the Interfacing to Digital Pressure Modules document, called READ_MR.) In brief, the "ms4515do READ_MR message" is the standard I2C header of a "request for N" bytes from the sensor, achieved in Arduino (I think) by Wire.requestFrom(addr, N).

Since I don't actually want any bytes returned from the device, I used Wire.requestFrom(addr, 0).

This led to a very odd (and hard-to-find) bug in my application: While the I2C worked fine, during my writing to an SD card, using the SD/File libraries, the file on the SD card was continually being corrupted!

As a work-around, I now request 1 byte: Wire.requestFrom(addr, 1);
and then read-and-trash all the data: while (Wire.available()) Wire.read();

I'm not sure if this is a bug (and deserves a bug-report) or if requesting 0 bytes is intentionally unsupported. If it's intentionally unsupported, a warning or error message would have saved me lots of debugging time.

I love Arduinos, thank you all for your amazing work and support!

Why use reqestFrom when you don't want to read anything? As far as I can see, there's nothing to read after a READ_MR anyway.

Pete

If it's intentionally unsupported, a warning or error message would have saved me lots of debugging time.

As it doesn't make sense to request 0 bytes this is not supported. The check for 0 bytes does use some time and I don't want libraries for low level hardware features to waste time checking for stupid parameters. It would make sense to note in the reference that the quantity only makes sense inside some range (1 to 32 in the AVR case) but in the runtime code this is not worth wasting processing time.