Open mzachar opened 1 month ago
@UUUNotifyCallback def _default_notify_callback(struct: UUUNotifyStruct, data) -> int: # type: ignore """A default callback function that stores the response in a class variable.
:param struct: A UUUNotifyStruct object
:param data: A pointer to data, here it is not used
"""
# pylint: disable=unused-argument
LibUUU._state.update(struct)
if struct.type == UUUNotifyType.NOTIFY_CMD_INFO:
LibUUU._response.value += bytes(struct.response.str)
Suppose problem should be here ^^^
return 1 if LibUUU._state.error else 0
I just tested this on Windows 11 and it works as expected:
libuuu version: 1.5.182
uuu version: uuu_1.5.182-0-g18656db
1 FB: getvar version: b'0.4'
2 FB: getvar version: b'0.4'
3 FB: getvar version: b'0.4'
4 FB: getvar version: b'0.4'
5 FB: getvar version: b'0.4'
I'm using python wrapper for libuuu to execute
FB: getvar version
but the response is corrupted. It looks like either the buffer is overridden or there is some issue with handling null byte terminated string.Sample python program:
will output: