-
-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
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
array index bound exception #15
Comments
I have commited the fix for that. Could you please confirm if it works now? |
now doesn't provoke an exception, but i can't get the response from the device when the index of array is greater than 127 |
a workaround may be to set the size of the array to 128. The instruction register.compareAndSet(256, 1) will become register.compareAndSet(128, 1) |
Unfortunately I haven't managed to reproduce the issue. Another way around this bug is subscribing a listener and receiving updates continously. This way you don't have to invoke i2cDevice.subscribe(new I2CListener() {...});
i2cDevice.startReceivingUpdates(messageLength); |
Register type was promoted from byte to int in 2.3.5 and it fixes described bug. |
There's a numerical overflow in "ask" method of FirmataI2CDevice class. The type byte in Java is signed. So, when the AtomicInteger return a value greater than 127, the value of variable "reg" is negative, and that, provoke an array index bound exception
The text was updated successfully, but these errors were encountered: