Return type for callbacks is void, not void*
This commit is contained in:
parent
e921be65b4
commit
1108f3fad2
2 changed files with 7 additions and 7 deletions
|
@ -58,11 +58,11 @@ def rawcallbackfunction(data, controllerId, callbackId, context):
|
|||
print string_at(data)
|
||||
|
||||
if (platform.system() == 'Windows'):
|
||||
CMPFUNC = WINFUNCTYPE(c_void_p, c_int, c_int, POINTER(c_ubyte), c_int, c_void_p) #first is return type
|
||||
CMPFUNCRAW = WINFUNCTYPE(c_void_p, POINTER(c_ubyte), c_int, c_int, c_void_p)
|
||||
CMPFUNC = WINFUNCTYPE(None, c_int, c_int, POINTER(c_ubyte), c_int, c_void_p) #first is return type
|
||||
CMPFUNCRAW = WINFUNCTYPE(None, POINTER(c_ubyte), c_int, c_int, c_void_p)
|
||||
else:
|
||||
CMPFUNC = CFUNCTYPE(c_void_p, c_int, c_int, POINTER(c_ubyte), c_int, c_void_p)
|
||||
CMPFUNCRAW = CFUNCTYPE(c_void_p, POINTER(c_ubyte), c_int, c_int, c_void_p)
|
||||
CMPFUNC = CFUNCTYPE(None, c_int, c_int, POINTER(c_ubyte), c_int, c_void_p)
|
||||
CMPFUNCRAW = CFUNCTYPE(None, POINTER(c_ubyte), c_int, c_int, c_void_p)
|
||||
|
||||
cmp_func = CMPFUNC(callbackfunction)
|
||||
cmp_funcraw = CMPFUNCRAW(rawcallbackfunction)
|
||||
|
@ -73,4 +73,4 @@ lib.tdRegisterDeviceEvent(cmp_func, 0)
|
|||
|
||||
print "Waiting for events..."
|
||||
while(1):
|
||||
time.sleep(0.5) #don't exit
|
||||
time.sleep(0.5) #don't exit
|
||||
|
|
|
@ -29,9 +29,9 @@ def callbackfunction(protocol, model, id, dataType, value, timestamp, callbackId
|
|||
|
||||
|
||||
if (platform.system() == 'Windows'):
|
||||
CMPFUNC = WINFUNCTYPE(c_void_p, POINTER(c_ubyte), POINTER(c_ubyte), c_int, c_int, POINTER(c_ubyte), c_int, c_int, c_void_p) #first is return type
|
||||
CMPFUNC = WINFUNCTYPE(None, POINTER(c_ubyte), POINTER(c_ubyte), c_int, c_int, POINTER(c_ubyte), c_int, c_int, c_void_p) #first is return type
|
||||
else:
|
||||
CMPFUNC = CFUNCTYPE(c_void_p, POINTER(c_ubyte), POINTER(c_ubyte), c_int, c_int, POINTER(c_ubyte), c_int, c_int, c_void_p)
|
||||
CMPFUNC = CFUNCTYPE(None, POINTER(c_ubyte), POINTER(c_ubyte), c_int, c_int, POINTER(c_ubyte), c_int, c_int, c_void_p)
|
||||
|
||||
cmp_func = CMPFUNC(callbackfunction)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue