Question about I2C


When using Wire.requestFrom(slave_address, count) the count information does not seem to be available at the slave.

Is this just the way the IC2 protocol works OR is it how "Wire" is implemented?

What is the common approach to letting the slave know what is being requested?

Thanks much.

That is right, the Slave does not know how much data is requested. It is part of the normal I2C protocol.
This is almost never a problem, since there should be known data packet between the Master and the Slave.
The Slave does have the possibility to reply with less bytes than requested.

For example when a Master requests 10 bytes, and the Slave decides to write only 2 bytes, the Master should check the number of bytes that are received.

Another example is the I2C EEPROM. The Master can request just one byte from the EEPROM or many bytes. During the I2C session, the EEPROM keeps sending bytes, as long as the Master keeps requesting new data.

P.S.: Can you say out loud : "eye square see", or "I-square-c".²C

Thanks much. That seemed to be the case BUT I thought I would ask just to be safe.