hybridgroup/cylon-sphero — pull request #42 by chrisfp (2014-08-15 07:34:30+00:00)
Title: Fix quaternion access

Building mask/mask2 via ^ (XOR) throws an error "value out of bounds" in this.sphero.setDataStreaming() when accessing "quaternion" (wich means DATA_SOURCES2 = ["0xF0000000", ...]).

Reason: After adding DATA_SOURCES2 with ["0xF0000000", ...] (a leading f) to a mask, JS is interpreting the mask as a negative number, wich causes the bug in this.sphero.setDataStreaming(), when it calls packet.DATA.writeUInt32BE(mask2, 9).

My first pull request (yesterday), didn't fix the bug -> it just used the wrong numbers for quaternion access.