Skip to content

Commit 4f19438

Browse files
authored
Changing return type of 'requestFrom' from uint8_t to size_t allows the function to return the correct amount of bytes read (since internally it's already a size_t which is downcast to a uint8_t upon returning it. (#132)
1 parent 4bd75df commit 4f19438

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api/HardwareI2C.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ class HardwareI2C : public Stream
3636
virtual uint8_t endTransmission(bool stopBit) = 0;
3737
virtual uint8_t endTransmission(void) = 0;
3838

39-
virtual uint8_t requestFrom(uint8_t address, size_t len, bool stopBit) = 0;
40-
virtual uint8_t requestFrom(uint8_t address, size_t len) = 0;
39+
virtual size_t requestFrom(uint8_t address, size_t len, bool stopBit) = 0;
40+
virtual size_t requestFrom(uint8_t address, size_t len) = 0;
4141

4242
virtual void onReceive(void(*)(int)) = 0;
4343
virtual void onRequest(void(*)(void)) = 0;

0 commit comments

Comments
 (0)