W
waldek
Hi,
I'm using C dll with py module and wanna read value (buffer of bytes)
returned in py callback as parameter passed to dll function.
--------------------------------------------------
def mycallback(data, size):
# how to read data buffer here ?
return 0
cbfunc = CFUNCTYPE(c_int, POINTER(c_uint8), c_int)
mydll = cdll.somedll
mdll.foo(cbfunct)
---------------------------------------------------------------
Question: How to get bytes from the buffer passed to mycallback ???
Let's assume that the buffer consist of 4 bytes 4 bytes 8 bytes.
I tried unpack("ii8s", data[0]) and nothing. I tried different ctypes
passed to callback and nothing.
Any sugestions ?
Thanks,
Waldek
I'm using C dll with py module and wanna read value (buffer of bytes)
returned in py callback as parameter passed to dll function.
--------------------------------------------------
def mycallback(data, size):
# how to read data buffer here ?
return 0
cbfunc = CFUNCTYPE(c_int, POINTER(c_uint8), c_int)
mydll = cdll.somedll
mdll.foo(cbfunct)
---------------------------------------------------------------
Question: How to get bytes from the buffer passed to mycallback ???
Let's assume that the buffer consist of 4 bytes 4 bytes 8 bytes.
I tried unpack("ii8s", data[0]) and nothing. I tried different ctypes
passed to callback and nothing.
Any sugestions ?
Thanks,
Waldek