osc
osc copied to clipboard
First osc arg with 4 char string causes decode bug
var msg = OSCMessage("/dun/dap", arguments: ["aaaa", 1, 2]);
var bytes = msg.toBytes();
var msg2 = OSCMessage.fromBytes(bytes);
print(msg2.toString());
prints
OSCMesssage(/dun/dap, args: [aaaa, 0, 1])
Note the 0
as the first argument.
Actually same with other combinations such as
var msg = OSCMessage("/set", arguments: ["/dun/dap", 3, 3]);
OSCMesssage(/set, args: [/dun/dap, 0, 3])
I tested another OSC implementation and that implementation receives bytes from this library OK which makes me believe it is in the decoding.
~Actually this appears to be fixed on the most recent master commit. When cloning this lib and installing from path, it works.~
Found the location of the error (line: 336 of convert.dart)
// if (value is String) eat(byte: 0);
remove the comment and eating the padded string bytes fixes the issue. Not sure if it causes others.
Thanks for tracking this down! @jeffmikels: it looks like that change goes back to some parsing fixes you landed (https://github.com/pq/osc/commit/e1e4662d9b598fdb14666992cdbce723c29c0c64). Any thoughts?
I'll look into it.
Thanks!