We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The single byte read method in MockI2C returns an unmasked byte as its int result, i e return b; instead of return b & 0xff;
return b;
return b & 0xff;
Byte values from 0x80 to 0xff are returned as negative ints making it impossible to test for EOF.
Diff: `diff --git a/plugins/pi4j-plugin-mock/src/main/java/com/pi4j/plugin/mock/provider/i2c/MockI2C.java b/plugins/pi4j-plugin-mock/src/main/java/com/pi4j/plugin/mock/provider/i2c/MockI2C.java index f161576..bfad59a 100644 --- a/plugins/pi4j-plugin-mock/src/main/java/com/pi4j/plugin/mock/provider/i2c/MockI2C.java +++ b/plugins/pi4j-plugin-mock/src/main/java/com/pi4j/plugin/mock/provider/i2c/MockI2C.java @@ -155,7 +155,7 @@ public class MockI2C extends I2CBase implements I2C { logger.info("] :: READ(0x"); logger.info(StringUtil.toHexString(b)); logger.info(")");
}
/** {@inheritdoc} */`
The text was updated successfully, but these errors were encountered:
gugrim
Successfully merging a pull request may close this issue.
The single byte read method in MockI2C returns an unmasked byte as its int result, i e
return b;
instead of
return b & 0xff;
Byte values from 0x80 to 0xff are returned as negative ints making it impossible to test for EOF.
Diff:
`diff --git a/plugins/pi4j-plugin-mock/src/main/java/com/pi4j/plugin/mock/provider/i2c/MockI2C.java b/plugins/pi4j-plugin-mock/src/main/java/com/pi4j/plugin/mock/provider/i2c/MockI2C.java
index f161576..bfad59a 100644
--- a/plugins/pi4j-plugin-mock/src/main/java/com/pi4j/plugin/mock/provider/i2c/MockI2C.java
+++ b/plugins/pi4j-plugin-mock/src/main/java/com/pi4j/plugin/mock/provider/i2c/MockI2C.java
@@ -155,7 +155,7 @@ public class MockI2C extends I2CBase implements I2C {
logger.info("] :: READ(0x");
logger.info(StringUtil.toHexString(b));
logger.info(")");
}
/** {@inheritdoc} */`
The text was updated successfully, but these errors were encountered: