In the wire library, when using an Arduino as a slave, we use the Wire.onReceive(receiveEvent) and Wire.onRequest(requestEvent) methods to define the methods to use when data is received and requested. Simple enough; this I understand.
The receiveEvent(int howMany) method that I define has one parameter, an int, that presumably tells me how many bytes are being requested. This is all well and good - somebody stop me if I’m wrong or misunderstanding something.
Now, finally, the question:
The requestEvent() method that I define has NO parameters. Therefore the Arduino has no way of knowing what is actually being requested, only that a request has been made. This seems too ridiculous to be true - I’ve GOT to be missing something here.
Let’s say I want to store some data on the Arduino’s internal EEPROM and send that data to a master device. I have no way of determining what address the master is trying to read, do I? I’ve gotta be getting this wrong - right?