Open felixdollack opened 1 year ago
When parsing the blob, why do you use an integer (>%iQ) instead of a char (>%cQ)?
From osc.parser:
def parse_blob(value, offset=0, **kwargs):
"""Return a blob from offset in value."""
size = calcsize('>i')
length = unpack_from('>i', value, offset)[0]
data = unpack_from('>%iQ' % length, value, offset + size)
return data, padded(length, 8)
The specification says:
OSC-blob An int32 size count, followed by that many 8-bit bytes of arbitrary binary data, followed by 0-3 additional zero bytes to make the total number of bits a multiple of 32.
I think the line where the data is unpacked should be something like:
data = unpack_from('>%ic' % length value, offset + size)
Seems like a bug indeed, i didn’t put a lot of attention in the project since i don’t need it currently, but i’ll try to have a look at it, of course, if someone else has time before that, PR welcome.
Describe the bug I am sending an OSC message containing a single blob of data:
/destn/1\x00\x00\x00\x00,b\x00\x00\x00\x00\x00\x08...
[28 bytes] /destn/1 b [8]0123456789ABCDEFI am getting this result for both OSC data send from C and using Dart.
To Reproduce Code example showing the issue is the example code from the readme:
Here the sending portion in C using tinyosc compiled with
gcc *.c -Werror -std=c99 -O0 -g -o sendosc
Note: main.c from tinyosc has to be removed or the content be replaced with below:Expected behavior Read the correct size of the blob and get a binary array same way it was written. The same message works without any issue using e.g. python-osc.
blob = b'\x01#Eg\x89\xab\xcd\xef'
Logs/output
Platform (please complete the following information):
Additional context Add any other context about the problem here.