Skip to content

Commit

Permalink
Changing return type of 'requestFrom' from uint8_t to size_t allows t…
Browse files Browse the repository at this point in the history
…he 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)
  • Loading branch information
aentinger authored Dec 10, 2020
1 parent 4bd75df commit 4f19438
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/HardwareI2C.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class HardwareI2C : public Stream
virtual uint8_t endTransmission(bool stopBit) = 0;
virtual uint8_t endTransmission(void) = 0;

virtual uint8_t requestFrom(uint8_t address, size_t len, bool stopBit) = 0;
virtual uint8_t requestFrom(uint8_t address, size_t len) = 0;
virtual size_t requestFrom(uint8_t address, size_t len, bool stopBit) = 0;
virtual size_t requestFrom(uint8_t address, size_t len) = 0;

virtual void onReceive(void(*)(int)) = 0;
virtual void onRequest(void(*)(void)) = 0;
Expand Down

0 comments on commit 4f19438

Please sign in to comment.