Closed bakerkj closed 2 years ago
+1 This is helping me solve some data inconsistency issues, thanks
Hi! Thanks for feedback! We've recieved your pull request, I'll take a time to talk with our CTO to approve it @bakerkj @krbaker
@climateguard / @octopolyr is it worth tagging a new release # with this fix?
@bakerkj We're working on a couple of features, the update will happen within a week. Please accept our apologies for the inconvenience
Hi @octopolyr , I was curious how the tag creation was going? Thanks!
@octopolyr / @climateguard I was just checking in. Would it be possible to issue a new release?
Thanks!
I believe this change addresses issues like #10 and maaad/RadSens1v2/issues/3 where i2c communications issues were not detected and therefore erroneous values were returned to the caller.
1) As documented here Arduino Wire endTransmission() documentation endTransmission() returns 0 on success and other values on error.
In the case of an error i2c_read() now returns false so callers do not try to interpret invalid data.
2) As documented here Arduino Wire requestFrom() documentation requestFrom() returns the number of bytes returned from the peripheral.
In the case of fewer bytes returned than the number requested in i2c_read() return false to callers so they do not try to interpret invalid data.