Closed MatzeS closed 8 years ago
Sorry for the delay! I have no idea how this was even working for me! The tests must be flawed :) (I know they are) I'll try to get that fix pushed tonight with a couple more tweaks to make this functionality actually do what its supposed to :)
I'm looking on Firmata now for roughtly 4 hours and maybe I'm comleptly wrong posting this issue, but:
I tried to setup some custom messages and used there for the
DataTypeHelpers.encodeTwoSevenBitByteSequence(String)
method. Using this method produces following exception:Tracking down this stack trace the problem is located at
DataTypeHelpers
line 68:byteBuffer.put((byte) (bytes[offset] & 0x7F), (byte) ((bytes[offset] >> 7) & 0x7F));
I guess idea of this code is to put two bytes to the buffer, assuming the method is like:
ByteBuffer.put(byte... bytes)
. This is not the case! (API: https://docs.oracle.com/javase/7/docs/api/java/nio/ByteBuffer.html#put(byte) )So, localy I fixed it into two lines:
byteBuffer.put((byte) (bytes[offset] & 0x7F)); byteBuffer.put((byte) ((bytes[offset] >> 7) & 0x7F));
working out perfectly :)
(first issue report in my life, don't hate me) Matthias